PUD: cleanup Makefiles
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 5 Feb 2012 12:44:58 +0000 (13:44 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 5 Feb 2012 13:15:26 +0000 (14:15 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/Makefile
lib/pud/wireformat-java/Makefile
lib/pud/wireformat/Makefile

index 9f2d73f..0334503 100644 (file)
@@ -32,32 +32,32 @@ LIBRARY_LIB = $(LIBRARY_PATH)/lib
 CFLAGS += -I $(LIBRARY_INC)
 LIBS += -L $(LIBRARY_LIB) -lnmea -lm -l$(LIBRARY_NAME)
 
+ifneq ($(OS),linux)
 
-# repeat from toplevel Makefile.inc, and adjust: we need the library includes
-%.d: %.c
-       @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
-
+.PHONY: all default_target install clean
 
-ifneq ($(OS),linux)
+all: default_target
 
 default_target install clean:
        @echo "*** $(PLUGIN_NAME) plugin only supported on Linux, sorry!"
 
 else
 
+.PHONY: all default_target install uninstall clean doc doc-clean library java java-instal java-uninstall
+
 all: default_target
 
-default_target: version $(PLUGIN_FULLNAME)
+default_target: library $(VERSION_FILE) $(PLUGIN_FULLNAME)
 
-$(PLUGIN_FULLNAME): library $(OBJS) version-script.txt
+# repeat from toplevel Makefile.inc, and adjust: we need the library includes
+%.d: %.c
+       @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
+
+$(PLUGIN_FULLNAME): $(OBJS) version-script.txt
        @echo "[LD] $@"
        @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
-
-.PHONY:        version install uninstall clean dist distclean doc doc-clean library library-clean library-doc library-doc-clean
-
-version: Makefile scripts/makeVersionH
-       @echo "[$(VERSION_FILE)]"
+$(VERSION_FILE): library scripts/makeVersionH
        @./scripts/makeVersionH "$(VERSION_FILE)" "$(PLUGIN_VER)"
 
 install: all
@@ -78,19 +78,19 @@ clean:
        @$(MAKE) -C $(LIBRARY_PATH) clean
        @$(MAKE) -C $(JAVA_PATH) clean
 
-dist:                          distclean
-distclean:                     clean
-
-
 doc:
        @$(MAKE) -C doc all
        @$(MAKE) -C $(LIBRARY_PATH) doc
        @$(MAKE) -C $(JAVA_PATH) doc
 
+doc-clean:
+       @$(MAKE) -C doc clean
+       @$(MAKE) -C $(LIBRARY_PATH) doc clean
+       @$(MAKE) -C $(JAVA_PATH) doc clean
+
 library:
        @$(MAKE) -C $(LIBRARY_PATH) all
 
-
 java:
        @$(MAKE) -C $(JAVA_PATH) all
 
index 8b0d3e7..e75e6e6 100644 (file)
@@ -64,11 +64,17 @@ JAVA_PKG_UNDER = $(subst .,_,$(JAVA_PKG))
 
 ifneq ($(OS),linux)
 
-default_target install clean all:
+.PHONY: all default_target install clean
+
+all: default_target
+
+default_target install clean:
        @echo "*** only supported on Linux"
 
 else
 
+.PHONY: all default_target java prepare clean doc doc-clean install uninstall
+
 #
 # Targets
 #
@@ -77,6 +83,17 @@ all: default_target
 
 default_target: prepare $(LIBDIR_BUILD)/$(SONAME) java
 
+.gitignore:
+       @echo "[$@]"
+       @echo "/$(BUILD_DIR)/" > $@
+       @echo "/$(LIBDIR_BUILD)/" >> $@
+       @echo "/build.xml" >> $@
+       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h" >> $@
+       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h" >> $@
+       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h" >> $@
+       @echo "/$(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java" >> $@
+       @$(MAKE) -C doc $@
+
 $(LIBDIR_BUILD)/$(SONAME): $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o \
                            $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o \
                            $(BUILD_DIR)/$(JAVA_PKG_UNDER)_PositionUpdate.o
@@ -204,19 +221,6 @@ $(BUILD_DIR_JNI)/c/wireFormat.h: $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h
 # Phony Targets
 #
 
-.PHONY: .gitignore prepare clean doc doc-clean install uninstall
-
-.gitignore:
-       @echo "[$@]"
-       @echo "/$(BUILD_DIR)/" > $@
-       @echo "/$(LIBDIR_BUILD)/" >> $@
-       @echo "/build.xml" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h" >> $@
-       @echo "/$(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java" >> $@
-       @$(MAKE) -C doc $@
-
 prepare:
        @mkdir -p "$(BUILD_DIR)" \
                  "$(LIBDIR_BUILD)" \
index 3cbdc7a..6f39055 100644 (file)
@@ -42,11 +42,17 @@ INC_DIR_INSTALL = usr/$(INC_DIR_C)
 
 ifneq ($(OS),linux)
 
-default_target install clean all:
+.PHONY: all default_target install clean
+
+all: default_target
+
+default_target install clean:
        @echo "*** only supported on Linux"
 
 else
 
+.PHONY: all default_target prepare clean doc doc-clean install uninstall
+
 #
 # Targets
 #
@@ -63,19 +69,17 @@ $(BUILD_DIR)/%.o: $(SRC_DIR_C)/%.c $(INC_DIR_C)/compiler.h
        @echo "[CC] $<"
        @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
 
-
-#
-# Phony Targets
-#
-
-.PHONY: .gitignore prepare clean doc doc-clean install uninstall java-clean java-doc java-install java-uninstall
-
 .gitignore:
        @echo "[$@]"
        @echo "/$(BUILD_DIR)/" > $@
        @echo "/$(LIBDIR_BUILD)/" >> $@
        @$(MAKE) -C doc $@
 
+
+#
+# Phony Targets
+#
+
 prepare:
        @mkdir -p "$(BUILD_DIR)" "$(LIBDIR_BUILD)"