]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - build-lincan.sh
host driver: support access to the chip register wider then 8-bit.
[lincan.git] / build-lincan.sh
index 406af343e00c287af3de461f5b477d46ce49a672..a02a8fd9ac28e06d4faf1a8c217ff16036b827ab 100755 (executable)
@@ -2,8 +2,7 @@ SOURCE_DIRS="lincan"
 OMK_RULES_DIR=omk/rules/linux
 BUILD_DIR=lincan-build/native
 
-SOURCE_PATHS+=" $SOURCE_DIRS"
-SOURCE_PATHS+=" $(echo $OMK_RULES_DIR/*)"
+SOURCE_PATHS="$SOURCE_PATHS $SOURCE_DIRS $(echo $OMK_RULES_DIR/*)"
 
 TOP_RELATIVE="$( echo "$BUILD_DIR" | sed -n -e 's#[^/]*/[^/]*#../#pg' ).."
 
@@ -28,7 +27,12 @@ for i in $SOURCE_DIRS ; do
 done
 
 if [ ! -e "$BUILD_DIR/Makefile" ] ; then
-  cp omk/Makefile "$BUILD_DIR/Makefile"
+  m=$OMK_RULES_DIR
+  if [ ! -e "$m/Makefile" ] ; then m="$(dirname $m)" ; fi
+  if [ ! -e "$m/Makefile" ] ; then m="$(dirname $m)" ; fi
+  if [ -e "$m/Makefile" ] ; then
+    cp -v "$m/Makefile" "$BUILD_DIR/Makefile"
+  fi
 fi
 
 ( cd "$BUILD_DIR" && make default-config ) || exit 1