3 # util routines for a C/C++ - build
9 *) echo "unknown architecture $1"
14 function install_cpp_make {
18 if [ -f makefile ]; then rm makefile; fi
19 if [ -f make.post ]; then rm make.post; fi
20 ln -s $cwd/Make/cpp.make makefile
21 echo "SOURCE = \\" > make.pre
22 for file in $(ls *.cpp)
24 echo " $file \\" >> make.pre
27 if [ "$ARCH" = "armel" ]
29 echo "CXX = arm-linux-gnueabi-g++" >> make.pre
30 echo "CC = arm-linux-gnueabi-g++" >> make.pre
31 echo "CXXFLAGS += -D_ARMEL" >> make.pre
32 echo 'export PATH := /opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi/:/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/bin/armv5te-linux-gnueabi/:$(PATH)' >> make.pre
34 echo "CXXFLAGS += -std=c++0x -I$src/util" >> make.pre
38 function append_dependency {
41 # $2: dependency directory
42 # $3: dependency artefact
45 echo "DEPS += $3" >> $1/make.pre
46 echo "$3:" >> $1/make.post
47 echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
48 echo "" >> $1/make.post
51 function append_library {
54 # $2: dependency directory
55 # $3: dependency artefact
58 echo "DEPS += $3" >> $1/make.pre
59 echo "LDLIBS += $3" >> $1/make.pre
60 echo "$3:" >> $1/make.post
61 echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
62 echo " ln -sf $src/$2/$3 ." >> $1/make.post
63 echo "" >> $1/make.post