]> git.proxmox.com Git - qemu.git/commitdiff
rules.mak: cleanup config generation rules
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 15 Jan 2013 11:12:35 +0000 (13:12 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 29 Jan 2013 23:31:08 +0000 (01:31 +0200)
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>
rules.mak

index 6d82c0d5a0a7332c076154b42678e96222c8d7b4..d11a5b4f0036000208ee41349e866772dda177e4 100644 (file)
--- 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: