diff --git a/owlps-aggregator/Makefile b/owlps-aggregator/Makefile index cce9af1..0133b9d 100644 --- a/owlps-aggregator/Makefile +++ b/owlps-aggregator/Makefile @@ -10,13 +10,14 @@ INSTALL_LIB= $(PREFIX)/lib INSTALL_INC= $(PREFIX)/include INSTALL_MAN= $(PREFIX)/share/man -# Compiler +# Compilation tools ifeq "$(origin CC)" "default" COLORGCC := $(shell which colorgcc >/dev/null 2>&1 ; echo $$?) ifeq "$(COLORGCC)" "0" CC = colorgcc endif endif +STRIP = strip -s # Install/uninstall commands RM = rm -f @@ -47,15 +48,20 @@ LDFLAGS = $(LIBS) $(OWLPSFLAGS) ## Standard targets ## -.PHONY : all install uninstall clean purge help +.PHONY : all dynamic static install uninstall clean purge help -all : $(TARGET) +dynamic: $(TARGET) +static: $(TARGET).static +all: dynamic static # Cancel implicit make rule %: %.c % : %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) +%.static : %.o + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) -static + $(STRIP) $@ %.o : %.c $(HEADER) $(CC) $(XCFLAGS) $(OWLPSFLAGS) -c $< @@ -77,6 +83,7 @@ clean : purge : clean @$(RM) $(TARGET) + @$(RM) $(TARGET).static ## Help ## diff --git a/owlps-client/Makefile b/owlps-client/Makefile index cb1bbf1..c1bea96 100644 --- a/owlps-client/Makefile +++ b/owlps-client/Makefile @@ -10,13 +10,14 @@ INSTALL_LIB= $(PREFIX)/lib INSTALL_INC= $(PREFIX)/include INSTALL_MAN= $(PREFIX)/share/man -# Compiler +# Compilation tools ifeq "$(origin CC)" "default" COLORGCC := $(shell which colorgcc >/dev/null 2>&1 ; echo $$?) ifeq "$(COLORGCC)" "0" CC = colorgcc endif endif +STRIP = strip -s # Install/uninstall commands RM = rm -f @@ -66,10 +67,11 @@ all : dynamic static %: %.c %: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) %.static: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ \ + $(CC) $(XCFLAGS) -o $@ $^ \ $(LDFLAGS) $(LIBS) $(STATIC_LIBS) -static + $(STRIP) $@ %.o: %.c $(HEADER) $(CC) $(XCFLAGS) $(OWLPSFLAGS) -c $< diff --git a/owlps-client/Makefile_atheros_openwrt-10.03 b/owlps-client/Makefile_atheros_openwrt-10.03 index 2fdb726..7d4d5f7 100644 --- a/owlps-client/Makefile_atheros_openwrt-10.03 +++ b/owlps-client/Makefile_atheros_openwrt-10.03 @@ -16,8 +16,9 @@ INSTALL_LIB= $(PREFIX)/lib INSTALL_INC= $(PREFIX)/include INSTALL_MAN= $(PREFIX)/share/man -# Compiler +# Compilation tools CC = $(TOOLCHAIN_BIN)/mips-openwrt-linux-gcc +STRIP = $(TOOLCHAIN_BIN)/mips-openwrt-linux-strip -s # Install/uninstall commands RM = rm -f @@ -64,14 +65,16 @@ all: dynamic semistatic static %: %.c %: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(DYNAMIC_LIBS) + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(DYNAMIC_LIBS) %.semistatic: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(SEMISTATIC_LIBS) + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(SEMISTATIC_LIBS) + $(STRIP) $@ %.static: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(STATIC_LIBS) \ + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(STATIC_LIBS) \ -static + $(STRIP) $@ %.o: %.c $(HEADER) $(CC) $(XCFLAGS) $(IATHEROS) $(OWLPSFLAGS) -c $< diff --git a/owlps-listener/Makefile b/owlps-listener/Makefile index 15449a1..840badb 100644 --- a/owlps-listener/Makefile +++ b/owlps-listener/Makefile @@ -10,13 +10,14 @@ INSTALL_LIB= $(PREFIX)/lib INSTALL_INC= $(PREFIX)/include INSTALL_MAN= $(PREFIX)/share/man -# Compiler +# Compilation tools ifeq "$(origin CC)" "default" COLORGCC := $(shell which colorgcc >/dev/null 2>&1 ; echo $$?) ifeq "$(COLORGCC)" "0" CC = colorgcc endif endif +STRIP = strip -s # Install/uninstall commands RM = rm -f @@ -54,16 +55,20 @@ LDFLAGS = $(LIBS) $(OWLPSFLAGS) ## Standard targets ## -.PHONY : all install uninstall clean purge help +.PHONY : all dynamic static install uninstall clean purge help -all : $(TARGET) +dynamic: $(TARGET) +static: $(TARGET).static +all: dynamic static # Cancel implicit make rule %: %.c % : %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) - + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) +%.static : %.o + $(CC) $(XCFLAGS) -o $@ $^ $(LDFLAGS) -static + $(STRIP) $@ %.o : %.c $(HEADER) $(CC) $(XCFLAGS) $(OWLPSFLAGS) -c $< @@ -85,6 +90,7 @@ clean : purge : clean @$(RM) $(TARGET) + @$(RM) $(TARGET).static ## Help ## diff --git a/owlps-listener/Makefile_atheros_openwrt-10.03 b/owlps-listener/Makefile_atheros_openwrt-10.03 index 9184f6c..1cbed54 100644 --- a/owlps-listener/Makefile_atheros_openwrt-10.03 +++ b/owlps-listener/Makefile_atheros_openwrt-10.03 @@ -16,8 +16,9 @@ INSTALL_LIB= $(PREFIX)/lib INSTALL_INC= $(PREFIX)/include INSTALL_MAN= $(PREFIX)/share/man -# Compiler +# Compilation tools CC = $(TOOLCHAIN_BIN)/mips-openwrt-linux-gcc +STRIP = $(TOOLCHAIN_BIN)/mips-openwrt-linux-strip -s # Install/uninstall commands RM = rm -f @@ -68,13 +69,13 @@ all: dynamic semistatic static %: %.c %: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LOWLPS) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(DYNAMIC_LIBS) - + $(CC) $(XCFLAGS) -o $@ $^ $(LOWLPS) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(DYNAMIC_LIBS) %.semistatic: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LOWLPSA) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(SEMISTATIC_LIBS) - + $(CC) $(XCFLAGS) -o $@ $^ $(LOWLPSA) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(SEMISTATIC_LIBS) + $(STRIP) $@ %.static: %.o - $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LOWLPS) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(STATIC_LIBS) -static + $(CC) $(XCFLAGS) -o $@ $^ $(LOWLPS) $(IATHEROS) $(LATHEROS) $(LDFLAGS) $(STATIC_LIBS) -static + $(STRIP) $@ %.o: %.c $(HEADER) $(CC) $(XCFLAGS) $(IATHEROS) $(OWLPSFLAGS) -c $< diff --git a/owlps-positioning/Makefile b/owlps-positioning/Makefile index ce759f1..7e10374 100644 --- a/owlps-positioning/Makefile +++ b/owlps-positioning/Makefile @@ -32,6 +32,7 @@ ifeq "$(origin CXX)" "default" CXX = colorgcc endif endif +STRIP = strip -s # Flags LIBOWLPS_DIR = ../libowlps @@ -50,7 +51,7 @@ endif OWLPSFLAGS = -D OWLPS_VERSION=\"$(OWLPS_VERSION)\" # Targets -.PHONY : all test doc clean purge install uninstall style check +.PHONY : all dynamic static test doc clean purge install uninstall style check TARGET = owlps-positioning OBJ_TARGET = $(OBJ_DIR)/$(TARGET).o @@ -130,7 +131,9 @@ SOURCE_TESTS = $(OBJ:$(OBJ_DIR)/%.o=$(TESTS_DIR)/%_test.hh) OBJ_TESTS = $(TESTUTIL_OBJ) $(TESTSETUP_OBJ) INCLUDES_TESTS = $(TESTS_DIR)/valuetraits.hh -all: $(TARGET) +dynamic: $(TARGET) +static: $(TARGET).static +all: dynamic static # Generic targets $(TESTS_DIR)/%.o: $(TESTS_DIR)/%.cc $(TESTS_DIR)/%.hh @@ -140,7 +143,11 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cc $(SRC_DIR)/%.hh $(MKDIR) $(OBJ_DIR) && $(CXX) $(GXXFLAGS) $(OWLPSFLAGS) -o $@ -c $< %: $(OBJ_DIR)/%.o - $(LD) $(LDFLAGS) -o $@ $^ + $(LD) -o $@ $^ $(LDFLAGS) + +%.static: $(OBJ_DIR)/%.o + $(LD) -o $@ $^ $(LDFLAGS) -static + $(STRIP) $@ # Dependencies $(OBJ_DIR)/point3d.o: \ @@ -328,6 +335,7 @@ $(OBJ_DIR)/positioning.o: \ # Specific targets $(TARGET): $(OBJ) $(OBJ_NOTEST) $(OBJ_TARGET) +$(TARGET).static: $(OBJ) $(OBJ_NOTEST) $(OBJ_TARGET) $(OBJ_TARGET): $(SOURCE_TARGET) $(CXX) $(GXXFLAGS) -o $@ -c $< @@ -360,6 +368,7 @@ clean: purge: clean @$(RM) $(TARGET) + @$(RM) $(TARGET).static @$(RM) $(TESTS_TARGET) @$(RM_RECURSIVE) $(DOXYGEN_DIR)