proper error handling in package/Makefile
authorFelix Fietkau <nbd@openwrt.org>
Sat, 22 Oct 2005 21:54:11 +0000 (21:54 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 22 Oct 2005 21:54:11 +0000 (21:54 +0000)
SVN-Revision: 2264

openwrt/package/Makefile

index 9053acb377db72ccdc713063d083d0e886490e60..1bdbbbfd853628faf76e75e42060863615465aa8 100644 (file)
@@ -443,21 +443,25 @@ $(TARGET_DIR):
 %-prepare: $(STAMP_DIR) $(TARGET_DIR)
        @[ -f $(STAMP_DIR)/.$@ ] || { \
                $(START_TRACE) "package/$(patsubst %-prepare,%,$@)/prepare: "; \
-               $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
-               $(CMD_TRACE) " done"; \
-               $(END_TRACE); \
+               $(MAKE) -C $(patsubst %-prepare,%,$@) prepare && { \
+                       touch $(STAMP_DIR)/.$@; \
+               } || { \
+                       $(CMD_TRACE) " done"; \
+                       $(END_TRACE); \
+               } \
        }
-       @touch $(STAMP_DIR)/.$@
 
 %-compile:
        @[ -f $(STAMP_DIR)/.$@ ] || { \
                $(START_TRACE) "package/$(patsubst %-compile,%,$@)/compile: "; \
-               $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
-               $(CMD_TRACE) " done"; \
-               $(END_TRACE); \
+               $(MAKE) -C $(patsubst %-compile,%,$@) compile && { \
+                       touch $(STAMP_DIR)/.$(patsubst %-compile,%,$@)-prepare; \
+                       touch $(STAMP_DIR)/.$@; \
+               } || { \
+                       $(CMD_TRACE) " done"; \
+                       $(END_TRACE); \
+               } \
        }
-       @touch $(STAMP_DIR)/.$(patsubst %-compile,%,$@)-prepare
-       @touch $(STAMP_DIR)/.$@
 
 %-install: %-compile
        @$(START_TRACE) "package/$(patsubst %-install,%,$@)/install: "