# Some Coloring ECHOEN=echo -en ESC=`$(ECHOEN) "\033"` RED="$(ESC)[1;31m" GRN="$(ESC)[1;32m" YEL="$(ESC)[1;33m" BLU="$(ESC)[1;34m" VIO="$(ESC)[1;35m" TUK="$(ESC)[1;36m" WHT="$(ESC)[1;37m" NOR="$(ESC)[m" IWEAR_PREFIX?=$(HOME) # Variables needed by the installation PREFIX=$(IWEAR_PREFIX) export LD_LIBRARY_PATH=$(IWEAR_PREFIX)/lib SVN_USER=$(USER) # Variables needed to run export IWEAR_NO_GSTACK=1 # What is done # - Should we run an 'cvs up' (or, if the directory is not there, checkout) for every target? RUN_UPDATE='false' # - Should we run ./configure && make links for every target? RUN_CONFIGURE='false' # - Should we run 'make' for every target? RUN_MAKE='true' # - Should we run 'make link' for every target ? RUN_LINK='false' # - Should run 'make clean' for target ? RUN_CLEAN='false' RUN_DIST='false' RUN_TESTS='false' # Information # - The svn path #, not set yet SVN_PATH='/home/svn/iwear/src/trunk' # - The module name MODULE_NAME='' # What to ignore #export CVSIGNORE=" .depend .depend.err config.log makefile.conf config.h lib *.so* old " #disabled: # @echo "Sorry, this makefile has not yet been ported to the SVN structure" .PHONY: compile rpm core help sensor_serialsensor uiservices input_x11 scipio input_scipio input_sdl output_griffin output_audio output_console iowarrior audioplayer utilities utilities_images languageselector applications conf context_manager core dbclasses doc framework_test gps_locator griffin input input_sdl input_x11 iowarrior iwearrpc location map markassistant output output_audio output_standard power routetracker scripts sensor ser_sensor sprachmodul uiservices utils utils_image utils_xml # Make help output help: @echo "" @echo $(BLU)"iWear - Makefile:"$(NOR) @echo "" @echo $(RED)"Due to the conversion from a CVS based structure with" @echo "individual makefiles to a SVN based structure with common" @echo "shared data, this makefile will not yet fully work."$(NOR) @echo "" @echo "Targets marked with a "$(RED)"*"$(NOR)" are known broken and should not be used" @echo "Targets marked with a "$(YEL)"*"$(NOR)" are known to sometimes work" @echo "Targets marked with a "$(GRN)"*"$(NOR)" are known to be ok" @echo "" @echo $(GRN)"*"$(NOR)" make" @echo $(GRN)"*"$(NOR)" make help " @echo " Prints this help." @echo "" # @echo " make init " # @echo " make build" # @echo " Will do a checkout, configure and make." # @echo " It will create a directory 'iwear' in which all modules" # @echo " will be checked out. " # @echo "" @echo $(GRN)"*"$(NOR)" make all" @echo " Calls a 'make all' in all subproject. This is what you" @echo " most likely want." @echo "" @echo $(RED)"*"$(NOR)" make rebuild" @echo " Same es 'make build' but does neither do a checkout" @echo " nor a cvs update. It simply runs a configure and" @echo " a make on the whole code." @echo "" @echo $(RED)"*"$(NOR)" make compile " @echo " Will run a make in all iwear modules. " @echo "" @echo $(RED)"*"$(NOR)" make svn_update " @echo " Will run a svn update on all modules. " @echo "" @echo $(GRN)"*"$(NOR)" make configure " @echo " Will run a configure on all modules. " @echo "" @echo $(GRN)"*"$(NOR)" make clean" @echo " Will run a clean on all modules. " @echo "" @echo $(GRN)"*"$(NOR)" make debian-install" @echo " Installes all needed pakages into your debian/ubuntu." @echo " "$(RED)"Note:"$(NOR)" Must be run as root " @echo "" @echo $(YEL)"*"$(NOR)" make tests" @echo " Does a make test in all subdirectories, which will" @echo " run all unit/regression tests. Will not abort on" @echo " failed tests" @echo "" @echo $(RED)"*"$(NOR)" make resources" @echo " Will get all needed icons from the interent. " @echo " Note: Should be run as root " @echo "" tests: @($(MAKE) RUN_TESTS='true' RUN_MAKE='false' all) # Make just a building compile: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='false' RUN_LINK='false' RUN_DIST='false' RUN_MAKE='true' all) # Make a cvs update for all targets svn_update: @(svn up) # $(MAKE) a configure configure: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='true' RUN_LINK='true' RUN_DIST='false' RUN_MAKE='false' all) clean: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='false' RUN_LINK='false' RUN_DIST='false' RUN_MAKE='false' RUN_CLEAN='true' all) # Make a build build: @($(MAKE) RUN_UPDATE='true' RUN_CONFIGURE='true' RUN_LINK='true' RUN_DIST='false' RUN_MAKE='true' all) # Make a rebuild rebuild: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='true' RUN_LINK='true' RUN_DIST='false' RUN_MAKE='true' all) link: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='false' RUN_LINK='true' RUN_DIST='false' RUN_MAKE='false' all) dist: @($(MAKE) RUN_UPDATE='false' RUN_CONFIGURE='false' RUN_LINK='false' RUN_DIST='true' RUN_MAKE='false' all) init: build # All-Target #all: uiservices input_x11 input_sdl output_griffin output_audio output_console iowarrior audioplayer utilities map routetracker framework_test all: sensor_serialsensor uiservices input_x11 scipio input_scipio input_sdl output_griffin output_audio output_console iowarrior audioplayer utilities utilities_images languageselector markassistant framework_test net routetracker # resources resources: (echo "Out of order") # ( cd /tmp; wget http://sputnik.iwear.tzi.de/iwear-share.tar.bz2; cd /usr/share/; tar -xjf /tmp/iwear-share.tar.bz2; rm /tmp/iwear-share.tar.bz2) # Debian install debian-install: apt-get install \ libmagick++6-dev \ libxerces26-dev \ xlibs-dev \ libsdl1.2-dev \ libboost-dev \ libboost-filesystem-dev \ libboost-serialization-dev libsdl-mixer1.2-dev \ libpqxx-dev \ libsdl-gfx1.2-dev \ libsdl-image1.2-dev \ libsdl-ttf2.0-dev \ g++-3.3 \ gcc-3.3 \ doxygen \ graphviz \ libssl-dev \ libusb-dev \ libid3tag0-dev \ libiw-dev \ postgresql-dev \ libhighgui-dev \ libgd2-dev \ ttf-bitstream-vera \ gettext \ binutils-dev \ bison \ flex # @( if [ -e /usr/bin/g++ ]; then \ # echo "found g++"; else \ # ln -s /usr/bin/g++-3.3 /usr/bin/g++; \ # fi ) # @( if [ -e /usr/lib/libcv.so ]; then \ # echo "/usr/lib/libcv.so does exist"; else \ # ln -s /usr/lib/libcv0.9.so /usr/lib/libcv.so; \ # fi ) # @( if [ -e /usr/lib/libcvaux.so ]; then \ # echo "/usr/lib/libcvaux.so does exist"; else \ # ln -s /usr/lib/libcvaux0.9.so /usr/lib/libcvaux.so;\ # fi ) # @( if [ -e /usr/lib/libhighgui.so ]; then \ # echo "/usr/lib/libhighgui.so does exist"; else \ # ln -s /usr/lib/libhighgui0.9.so /usr/lib/libhighgui.so; \ # fi) # ---------------------------------------------- # General install target %.install: @echo $(BLU)Calling make for: $(NOR)$(GRN)`echo $@ | sed -e "s/\.[^.]*//"`$(NOR) # If the directory is NOT there OR if it is there and the RUN_UPDATE variable has been set, we have to check it out. # @(if [ ! -d `echo $@ | sed -e "s/\.[^.]*//"` ] || [ $(RUN_UPDATE) = 'true' ]; then \ # svn up; \ # fi) # If 'RUN_CONFIGURE' has been set to true, we run ./congfigure and make # Only if the config.h is to be found, we can make a make steril @(if [ $(RUN_CONFIGURE) = 'true' ]; then \ cd $(MODULE_NAME); \ if [ -f include/config.h ]; then \ echo "Sterilizing first"; \ $(MAKE) steril; \ fi; \ ./configure --prefix=$(PREFIX); $(MAKE) links; \ fi) @(if [ $(RUN_LINK) = 'true' ]; then \ cd $(MODULE_NAME); $(MAKE) links; \ fi) # If 'RUN_MAKE' has been set to true, we run 'make' @(if [ $(RUN_MAKE) = 'true' ]; then \ cd $(MODULE_NAME); $(MAKE); \ fi) @(if [ $(RUN_CLEAN) = 'true' ]; then \ cd $(MODULE_NAME); make clean; \ fi) @(if [ $(RUN_DIST) = 'true' ]; then \ cd $(MODULE_NAME); $(MAKE) dist; \ fi) @(if [ $(RUN_TESTS) = 'true' ]; then \ cd $(MODULE_NAME); $(MAKE) tests; \ fi) # ---------------------------------------------- # All targets as usual # Core core: @$(MAKE) \ MODULE_NAME='core' \ core.install # Database database: core @$(MAKE) \ MODULE_NAME='dbclasses' \ database.install # net net: core @$(MAKE) \ MODULE_NAME='net' \ net.install # Sensor sensor: core @$(MAKE) \ MODULE_NAME='sensor' \ sensor.install # Sensor location location: database sensor @$(MAKE) \ MODULE_NAME='location' \ location.install # Power power: core sensor @$(MAKE) \ MODULE_NAME='power' \ power.install # Utilities utilities: @$(MAKE) \ MODULE_NAME='utils' \ utilities.install # Utilities Images utilities_images: @$(MAKE) \ MODULE_NAME='utils_image' \ utilities_images.install # Utilities XML utilities_xml: @$(MAKE) \ MODULE_NAME='utils_xml' \ utilities_xml.install # Context context: sensor power location utilities_xml @$(MAKE) \ MODULE_NAME='context_manager' \ context.install # output output: context @$(MAKE) \ MODULE_NAME='output' \ output.install # output_console output_console: output @$(MAKE) \ MODULE_NAME='output_standard' \ output_console.install # output_audio output_audio: output @$(MAKE) \ MODULE_NAME='output_audio' \ output_audio.install # input input: core @$(MAKE) \ MODULE_NAME='input' \ input.install # input_sdl input_sdl: input @$(MAKE) \ MODULE_NAME='input_sdl' \ input_sdl.install # input_x11 input_x11: input @$(MAKE) \ MODULE_NAME='input_x11' \ input_x11.install # scipio scipio: @$(MAKE) \ MODULE_NAME='scipio' \ scipio.install # input_scipio input_scipio: input scipio @$(MAKE) \ MODULE_NAME='input_scipio' \ input_scipio.install # iowarrior iowarrior: input output @$(MAKE) \ MODULE_NAME='iowarrior' \ iowarrior.install # uiservices uiservices: input output @$(MAKE) \ MODULE_NAME='uiservices' \ uiservices.install # output_griffin output_griffin: uiservices @$(MAKE) \ MODULE_NAME='griffin' \ output_griffin.install # sensor_serialsensor sensor_serialsensor: sensor # @$(MAKE) \ # MODULE_NAME='ser_sensor' \ # sensor_serialsensor.install # map map: core utilities_images @$(MAKE) \ MODULE_NAME='map' \ map.install # network network: core @$(MAKE) \ MODULE_NAME='network' \ network.install # sensor_gps sensor_gps: @$(MAKE) \ MODULE_NAME='gps_locator' \ sensor_gps.install # voicetransmission voicetransmission: core @$(MAKE) \ MODULE_NAME='sprachmodul' \ voicetransmission.install # markassistant markassistant: uiservices utilities @$(MAKE) \ MODULE_NAME='markassistant' \ markassistant.install # routetracker routetracker: uiservices @$(MAKE) \ MODULE_NAME='routetracker' \ routetracker.install # audioplayer audioplayer: input_x11 output_griffin output_audio utilities output_console @$(MAKE) \ MODULE_NAME='applications/audioplayer' \ audioplayer.install # languageselector languageselector: utilities @$(MAKE) \ MODULE_NAME='applications/languageselector' \ languageselector.install # framework test framework_test: input_x11 @$(MAKE) \ MODULE_NAME='applications/framework' \ framework_test.install #rpm: svn_update configure rpm: rebuild @rm -f distseds @$(MAKE) dist