Skip to contentSkip to conversation

Call configure automatically when needed

PATCH Applied Stefan Weil 3 participants 3 messages Apr 5, 2009 – Apr 15, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Call configure automatically when needed

Hello,

this patch calls configure automatically when configure changed since the last time it was called.

If configure was never called, the user is told to do so.

Regards
Stefan

Automatically rerun configure when it is needed.

Makefile +12 -0
Index: trunk/Makefile
===================================================================
@@ -1,7 +1,13 @@
 # Makefile for QEMU.
 
+ifneq ($(wildcard config-host.mak),)
 include config-host.mak
 include $(SRC_PATH)/rules.mak
+else
+config-host.mak:
+	@echo "Please call configure before running make!"
+	@exit 1
+endif
 
 .PHONY: all clean cscope distclean dvi html info install install-doc \
 	recurse-all speed tar tarbin test
@@ -36,6 +42,12 @@
 
 all: $(TOOLS) $(DOCS) recurse-all
 
+config-host.mak: configure
+ifneq ($(wildcard config-host.mak),)
+	@echo $@ is out-of-date, running configure
+	@fgrep "Configured with:" $@ | sed s/.*Configured.with:.// | sh
+endif
+
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 
 subdir-%:
#1 lore raw
Quoted 8 lines · Stefan Weil

Hello,

this patch calls configure automatically when configure changed since the last time it was called.

If configure was never called, the user is told to do so.

Nice one!

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#2 lore raw
In reply to Stefan Weil
Quoted 10 lines · Stefan Weil

Hello,

this patch calls configure automatically when configure changed since the last time it was called.

If configure was never called, the user is told to do so.

Regards
Stefan

Thanks, applied.

Quoted 35 lines

Automatically rerun configure when it is needed.

Index: trunk/Makefile
===================================================================

Makefile +12 -0
@@ -1,7 +1,13 @@
 # Makefile for QEMU.
 
+ifneq ($(wildcard config-host.mak),)
 include config-host.mak
 include $(SRC_PATH)/rules.mak
+else
+config-host.mak:
+	@echo "Please call configure before running make!"
+	@exit 1
+endif
 
 .PHONY: all clean cscope distclean dvi html info install install-doc \
 	recurse-all speed tar tarbin test
@@ -36,6 +42,12 @@
 
 all: $(TOOLS) $(DOCS) recurse-all
 
+config-host.mak: configure
+ifneq ($(wildcard config-host.mak),)
+	@echo $@ is out-of-date, running configure
+	@fgrep "Configured with:" $@ | sed s/.*Configured.with:.// | sh
+endif
+
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 
 subdir-%:
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net