# This Makefile.am is processed by the gnu autotools # See http://socgsa.cs.clemson.edu/seminar/tools06/resources/08_autotools/automake.htm # for a nice introduction with examples. # Automake has some keywords # and does all the rest for us. # General CFLAGS WARNINGS = -Wall -W -Wconversion -Wshadow AM_CFLAGS = $(WARNINGS) # 'Programs' is a 'primary', bin means going to /usr/local/bin bin_PROGRAMS = mcserver # 'Sources' is a variable for a program (or library) # variable can be CFLAGS, CPPFLAGS, CXXFLAGS, LDFLAGS, # LIBADD (add obj. to a library), # LDADD (add obj. to a program) ... mcserver_SOURCES = mcserver.c mcserver_CFLAGS = -Ilibdcs/include/dim $(WARNINGS) -pthread mcserver_LDFLAGS = -Llibdcs/lib/ -ldim -lpthread # libdcs as dependency of mcserver mcserver.c: mc.h libdcs # Hans Feb 1st: Add libdcs as dependency .PHONY: ipkg libdcs ipkg: libdcs rm Makefile ipkg/rules configure fakeroot ipkg-buildpackage # libdcs is the dim library compiled for the dcs board libdcs: @echo "Building the libdcs" cd dim; \ ./bootstrap ; \ ./configure --host=arm-linux-uclibc \ --prefix=`pwd`/../libdcs \ --disable-utils ; \ make clean install # # This is the old stuff # # CROSSCC=arm-linux-gcc # CFLAGS=-Wall -W -Wconversion -Wshadow # # Here, we build the memory checker server # # running on the DCS board # mcserver: mcserver.c mc.h libdcs # @echo "Building the mcserver" # $(CROSSCC) $(CFLAGS) -Ilibdcs/include/dim $< -Llibdcs/lib/ -ldim -lpthread -o $@ # arm-linux-strip $@ # # libdcs is the dim library compiled for the dcs board # libdcs: # @echo "Building the libdcs" # cd dim; \ # ./bootstrap ; \ # ./configure --host=arm-linux-uclibc \ # --prefix=`pwd`/../libdcs \ # --disable-utils ; \ # make clean install # ipkg/rules/CONTROL/control: # @echo "Building the ipkg/rules/CONTROL/control" # ipkg/rules configure # ipkg: mcserver libdcs ipkg/rules/CONTROL/control # # creating the ipkg control is done with ipkg/rules configure # @cp mcserver ipkg/usr/local/bin # @cp rc_trd_memctrl.sh ipkg/etc/init.d/rc # @cp memcheck.o ipkg/lib/modules/2.4.21-rmk1-dcs1/ # ipkg-build -o root -g root ipkg/ # clean: # rm -rf mcserver # rm -rf ipkg # distclean: clean # rm -rf libdcs # (cd dim ; make distclean ; echo "return OK") # rm -f mcserver*ipk # copy: # scp mcserver start_mcserver.sh memcheck.o rdwrmem memuser dcs0004:/tmp # # # #Static linked: # # # # $(CROSSCC) $(CFLAGS) -Ilibdcs/include/dim $< -Llibdcs/lib/ -ldim -lpthread -static -o $@