Skip to contentSkip to conversation

Makefile: Fix "make install" when "make all" needs work

PATCH In review Markus Armbruster 4 participants 4 messages Jul 12, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Fix "make install" when "make all" needs work

Until recently, target install used to recurse into target directories in its recipe: it ran make install in a for-loop. Since target install depends on target all, this trivially ensured we run the sub-make install only after completing target all.

Commit 1338a4b "Makefile: Reuse all's recursion machinery for clean and install" moved the target recursion to dependencies. That's good (the commit message explains why), but I forgot to add dependencies to ensure make runs the sub-make install only after completing target all. Do that now.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 1fcbaed62c..09b77e8a7b 100644
@@ -522,6 +522,7 @@ $(ROM_DIRS_RULES):
 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
+$(addsuffix /install, $(TARGET_DIRS)): all
 
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Markus Armbruster

Until recently, target install used to recurse into target directories in its recipe: it ran make install in a for-loop. Since target install depends on target all, this trivially ensured we run the sub-make install only after completing target all.

Commit 1338a4b "Makefile: Reuse all's recursion machinery for clean and install" moved the target recursion to dependencies. That's good (the commit message explains why), but I forgot to add dependencies to ensure make runs the sub-make install only after completing target all. Do that now.

Quoted 8 lines
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 1/1
#2 lore raw
In reply to Markus Armbruster
Quoted 25 lines · Markus Armbruster

Until recently, target install used to recurse into target directories in its recipe: it ran make install in a for-loop. Since target install depends on target all, this trivially ensured we run the sub-make install only after completing target all.

Commit 1338a4b "Makefile: Reuse all's recursion machinery for clean and install" moved the target recursion to dependencies. That's good (the commit message explains why), but I forgot to add dependencies to ensure make runs the sub-make install only after completing target all. Do that now.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 1fcbaed62c..09b77e8a7b 100644

Makefile $(ROM_DIRS_RULES): · line 528

Quoted 7 lines
Makefile +1 -0
@@ -522,6 +522,7 @@ $(ROM_DIRS_RULES):
 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
+$(addsuffix /install, $(TARGET_DIRS)): all
 
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
Tested-by on v1 1/1
#3 lore raw
In reply to Markus Armbruster
Quoted 26 lines · Markus Armbruster

Until recently, target install used to recurse into target directories in its recipe: it ran make install in a for-loop. Since target install depends on target all, this trivially ensured we run the sub-make install only after completing target all.

Commit 1338a4b "Makefile: Reuse all's recursion machinery for clean and install" moved the target recursion to dependencies. That's good (the commit message explains why), but I forgot to add dependencies to ensure make runs the sub-make install only after completing target all. Do that now.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 1fcbaed62c..09b77e8a7b 100644

Makefile $(ROM_DIRS_RULES): · line 528

Quoted 7 lines
Makefile +1 -0
@@ -522,6 +522,7 @@ $(ROM_DIRS_RULES):
 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
+$(addsuffix /install, $(TARGET_DIRS)): all
 
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")

I've just tried this on my faster workstation and it now works fine with all of -j2, -j4 and -j8.

ATB,

Mark.