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 [ -L makefile ]; then rm makefile; fi
20 if [ -f make.post ]; then rm make.post; fi
21 ln -s $cwd/projects/tools/make/cpp.make makefile
22 echo "SOURCE = \\" > make.pre
23 for file in $(ls *.cpp)
25 echo " $file \\" >> make.pre
28 if [ "$ARCH" = "armel" ]
30 echo "CXX = arm-linux-gnueabi-g++" >> make.pre
31 echo "CC = arm-linux-gnueabi-g++" >> make.pre
32 echo "CXXFLAGS += -D_ARMEL" >> make.pre
33 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
35 echo "CXXFLAGS += -std=c++0x" >> make.pre
40 function append_dependency {
41 # adds another drectory, where a c++ compile is performed
44 # $2: dependency directory
45 # $3: dependency artefact
48 echo "DEPS += $3" >> $1/make.pre
49 echo "$3:" >> $1/make.post
50 echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
51 echo "" >> $1/make.post
54 function add_include {
55 # adds a include directory
61 echo "CXXFLAGS += -I$src/$2" >> $1/make.pre
64 function append_library {
65 # same as append_dependency. In addition a include statement + a link to the library is added to "main directory"
68 # $2: dependency directory
69 # $3: dependency artefact
72 echo "DEPS += $3" >> $1/make.pre
73 echo "LDLIBS += $3" >> $1/make.pre
74 echo "CXXFLAGS += -I$src/$2" >> $1/make.pre
75 echo "$3:" >> $1/make.post
76 echo " cd $src/$2 && make TARGET=$3" >> $1/make.post
77 echo " ln -sf $src/$2/$3 ." >> $1/make.post
78 echo "" >> $1/make.post