Skip to contentSkip to conversation

Makefile: create $(BUILD_DIR) before attempting to touch .root

PATCH New Thomas De Schampheleire 3 participants 4 messages Jul 14, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: create $(BUILD_DIR) before attempting to touch .root

From: Thomas De Schampheleire <[email protected]>

The target $(BUILD_DIR)/.root does not have a direct dependency on $(BUILD_DIR), meaning that cases could exist where the target is executed without $(BUILD_DIR) being present.
Instead of hoping on a specific order, and instead of adding new make dependencies, just make sure the directory is created.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8eb8c6d..ee65417 100644
@@ -471,7 +471,7 @@ RSYNC_VCS_EXCLUSIONS = \
 	--exclude CVS
 
 $(BUILD_DIR)/.root:
-	mkdir -p $(TARGET_DIR)
+	mkdir -p $(TARGET_DIR) $(BUILD_DIR)
 	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
 		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
Signature · 1 line
1.9.5
#1 lore raw

PATCH 1/1 Makefile: create $(BUILD_DIR) before attempting to touch .root

Quoted 1 line · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

Regards,
Arnout

Quoted 26 lines

The target $(BUILD_DIR)/.root does not have a direct dependency on $(BUILD_DIR), meaning that cases could exist where the target is executed without $(BUILD_DIR) being present.
Instead of hoping on a specific order, and instead of adding new make dependencies, just make sure the directory is created.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8eb8c6d..ee65417 100644
@@ -471,7 +471,7 @@ RSYNC_VCS_EXCLUSIONS = \
 	--exclude CVS
 
 $(BUILD_DIR)/.root:
-	mkdir -p $(TARGET_DIR)
+	mkdir -p $(TARGET_DIR) $(BUILD_DIR)
 	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
 		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 Makefile: create $(BUILD_DIR) before attempting to touch .root

In reply to Thomas De Schampheleire

Dear Thomas De Schampheleire,

Quoted 8 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

The target $(BUILD_DIR)/.root does not have a direct dependency on $(BUILD_DIR), meaning that cases could exist where the target is executed without $(BUILD_DIR) being present.
Instead of hoping on a specific order, and instead of adding new make dependencies, just make sure the directory is created.

Quoted 4 lines
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Marked as superseded, because the skeleton package from Maxime makes this no longer needed. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com