From 74cda1e49b8c0d3ee6d6069452cfc74ab8f9a536 Mon Sep 17 00:00:00 2001 From: Ulf Samuelsson Date: Tue, 14 Aug 2007 07:24:45 +0000 Subject: [PATCH] Avoid continuous rebuilds of TARGET_DIR and /etc/* project files --- Makefile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f3dc4f051d..4d5227ba6d 100644 --- a/Makefile +++ b/Makefile @@ -230,7 +230,7 @@ world: dependencies dirs target-host-info $(BASE_TARGETS) $(TARGETS) # ############################################################# $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) \ - $(PROJECT_BUILD_DIR) $(BINARIES_DIR): + $(PROJECT_BUILD_DIR) $(BINARIES_DIR) $(TARGET_DIR): @mkdir -p $@ $(STAGING_DIR): @@ -246,23 +246,28 @@ else endif @mkdir -p $(STAGING_DIR)/usr/include -$(TARGET_DIR): $(STAGING_DIR) - mkdir -p $(TARGET_DIR) - if [ -d "$(TARGET_SKELETON)" ] ; then \ - cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ +$(PROJECT_BUILD_DIR)/.root: $(TARGET_DIR) + if ! [ -d "$(TARGET_DIR)/bin" ] ; then \ + @echo "Rebuilding TARGET_DIR" ; \ + if [ -d "$(TARGET_SKELETON)" ] ; then \ + cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ + fi; \ + touch $(STAGING_DIR)/.fakeroot.00000 ; \ + -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf ; \ + -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf ; \ fi; - touch $(STAGING_DIR)/.fakeroot.00000 - -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf - -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf + touch $@ -target-host-info: dirs $(TARGET_DIR)/etc/issue $(TARGET_DIR)/etc/hostname +target-host-info: $(TARGET_DIR)/etc/issue $(TARGET_DIR)/etc/hostname -$(TARGET_DIR)/etc/issue: $(TARGET_DIR) .config +$(TARGET_DIR)/etc/issue: .config + mkdir -p $(TARGET_DIR)/etc echo "" > $(TARGET_DIR)/etc/issue echo "" >> $(TARGET_DIR)/etc/issue echo "$(BANNER)" >> $(TARGET_DIR)/etc/issue -$(TARGET_DIR)/etc/hostname: $(TARGET_DIR) .config +$(TARGET_DIR)/etc/hostname: .config + mkdir -p $(TARGET_DIR)/etc echo "$(TARGET_HOSTNAME)" > $(TARGET_DIR)/etc/hostname source: $(TARGETS_SOURCE) $(HOST_SOURCE) -- 2.30.2