aboutsummaryrefslogtreecommitdiff
path: root/rules.mak
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-01-15 13:12:35 +0200
committerMichael S. Tsirkin <mst@redhat.com>2013-01-30 01:31:08 +0200
commit4b25966ab976f3a7fd9008193b2defcc82f8f04d (patch)
treea19816b62db02be320ee3bec52790bcb8248debb /rules.mak
parenta52a8841038638afe54ffb00e0aca48de0b1539a (diff)
downloadqemu-4b25966ab976f3a7fd9008193b2defcc82f8f04d.zip
qemu-4b25966ab976f3a7fd9008193b2defcc82f8f04d.tar.gz
qemu-4b25966ab976f3a7fd9008193b2defcc82f8f04d.tar.bz2
rules.mak: cleanup config generation rules
This addresses two issues with config generation 1. rule generating timestamp has side effect. Thus cleanup on error does not work. 2. rule for handling timestamp is too generic. It can create any missing .h file. As a result when .h file is removed, build might try to create it using this rule which results in build errors. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'rules.mak')
-rw-r--r--rules.mak9
1 files changed, 4 insertions, 5 deletions
diff --git a/rules.mak b/rules.mak
index 6d82c0d..d11a5b4 100644
--- a/rules.mak
+++ b/rules.mak
@@ -82,12 +82,11 @@ TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py
# Generate timestamp files for .h include files
-%.h: %.h-timestamp
- @test -f $@ || cp $< $@
+config-%.h: config-%.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
-%.h-timestamp: %.mak
- $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@, " GEN $(TARGET_DIR)$*.h")
- @cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h
+config-%.h-timestamp: config-%.mak
+ $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@, " GEN $(TARGET_DIR)config-$*.h")
# will delete the target of a rule if commands exit with a nonzero exit status
.DELETE_ON_ERROR: