From fd984eefe902aa347a6ce951987e3803dbf057de Mon Sep 17 00:00:00 2001 From: ppisa Date: Thu, 11 Nov 2004 19:21:49 +0100 Subject: [PATCH] Added script to build LinCAN project independent of OCERA tree. The code represented in this repository is in directory is based on the LinCAN (ocera/components/comm/can/lincan directory) component from OCERA (IST-2001 35102) project. Original project documentation can be found there http://www.ocera.org/download/components/WP7/index.html http://sourceforge.net/projects/ocera/ http://ocera.cvs.sourceforge.net/ocera/ocera/components/comm/can/ Can related components CVS repository can be accessed by cvs -d:pserver:anonymous@ocera.cvs.sourceforge.net:/cvsroot/ocera login cvs -z3 -d:pserver:anonymous@ocera.cvs.sourceforge.net:/cvsroot/ocera co ocera/components/comm/can The original code depend on OCERA make system. The minimal set of OMK rules has been introduced in the previous changeset to make this project independent of full OCERA repository. The scrip "build-lincan.sh" prepares "lincan-build/native" directory and links OMK rules and unmodified LinCAN directory there. Then it builds native version of the driver for current running kernel. Resulting driver can be found in directory lincan-build/native/_compiled/modules Utilities binaries are located in directories listed bellow lincan-build/native/_compiled/bin lincan-build/native/_compiled/bin-utils --- build-lincan.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 build-lincan.sh diff --git a/build-lincan.sh b/build-lincan.sh new file mode 100755 index 0000000..406af34 --- /dev/null +++ b/build-lincan.sh @@ -0,0 +1,36 @@ +SOURCE_DIRS="lincan" +OMK_RULES_DIR=omk/rules/linux +BUILD_DIR=lincan-build/native + +SOURCE_PATHS+=" $SOURCE_DIRS" +SOURCE_PATHS+=" $(echo $OMK_RULES_DIR/*)" + +TOP_RELATIVE="$( echo "$BUILD_DIR" | sed -n -e 's#[^/]*/[^/]*#../#pg' ).." + +echo "SOURCE_PATHS=$SOURCE_PATHS" +echo "TOP_RELATIVE=$TOP_RELATIVE" + +mkdir -p "$BUILD_DIR" || exit 1 + +for i in $SOURCE_PATHS ; do + b="$(basename $i)" + if [ ! -e "$BUILD_DIR/$b" ] ; then + echo "$BUILD_DIR : ln -s $TOP_RELATIVE/$i $b" + ( cd "$BUILD_DIR" && ln -s "$TOP_RELATIVE/$i" "$b" ) || exit 1 + fi +done + +for i in $SOURCE_DIRS ; do + b="$(basename $i)" + if ! grep -s "\<$b\>" "$BUILD_DIR/Makefile.omk" ; then + echo "SUBDIRS += $b" >>"$BUILD_DIR/Makefile.omk" || exit 1 + fi +done + +if [ ! -e "$BUILD_DIR/Makefile" ] ; then + cp omk/Makefile "$BUILD_DIR/Makefile" +fi + +( cd "$BUILD_DIR" && make default-config ) || exit 1 + +( cd "$BUILD_DIR" && make ) || exit 1 -- 2.39.2