]> git.proxmox.com Git - qemu.git/commitdiff
Makefile dependencies for device configs
authorPaul Brook <paul@codesourcery.com>
Sun, 22 Nov 2009 16:25:30 +0000 (16:25 +0000)
committerPaul Brook <paul@codesourcery.com>
Sun, 22 Nov 2009 21:24:54 +0000 (21:24 +0000)
Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code.  If a config already exists but is older than the
default then print a warning.

Also remove config-devices.h.  Code does not and should not care which
devices are being built.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Makefile
Makefile.target
config.h
configure

index d770e2a674076d9d85cc675e1aa104764fbc3336..e9b09ca825ce89e0a6b291f3bd231709b47d8dce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # Makefile for QEMU.
 
 # This needs to be defined before rules.mak
-GENERATED_HEADERS = config-host.h config-all-devices.h
+GENERATED_HEADERS = config-host.h
 
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
@@ -41,6 +41,19 @@ SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
        $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep "=y$$" | sort -u > $@,"  GEN   $@")
 
+%/config-devices.mak: default-configs/%.mak
+       $(call quiet-command,cat $< > $@.tmp, "  GEN   $@")
+       @if test -f $@ ; then \
+         echo "WARNING: $@ out of date." ;\
+         echo "Run \"make defconfing\" to regenerate." ; \
+         rm $@.tmp ; \
+        else \
+         mv $@.tmp $@ ; \
+        fi
+
+defconfig:
+       rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
+
 -include config-all-devices.mak
 
 build-all: $(DOCS) $(TOOLS) recurse-all
@@ -48,9 +61,6 @@ build-all: $(DOCS) $(TOOLS) recurse-all
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
 
-config-all-devices.h: config-all-devices.h-timestamp
-config-all-devices.h-timestamp: config-all-devices.mak
-
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 
 subdir-%: $(GENERATED_HEADERS)
@@ -246,7 +256,7 @@ clean:
 
 distclean: clean
        rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
-       rm -f config-all-devices.mak config-all-devices.h*
+       rm -f config-all-devices.mak
        rm -f roms/seabios/config.mak roms/vgabios/config.mak
        rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
        for d in $(TARGET_DIRS) libhw32 libhw64 libuser; do \
index ab774e529bbde1db95800623634f914455c49d6e..2985658d9ddcf64081e850e4727ca3ae69bf0df2 100644 (file)
@@ -1,7 +1,7 @@
 # -*- Mode: makefile -*-
 
 # This needs to be defined before rules.mak
-GENERATED_HEADERS = config-target.h config-devices.h
+GENERATED_HEADERS = config-target.h
 
 include ../config-host.mak
 include config-devices.mak
index 07d79d4ba17032179d0a4a48f4542cc7fc3a37c0..e20f78696a1b7c8c0c3b4d6b7b6c1c9dbdfad427 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,13 +1,2 @@
-
 #include "config-host.h"
 #include "config-target.h"
-
-/* We want to include different config files for specific targets
-   And for the common library.  They need a different name because
-   we don't want to rely in paths */
-
-#if defined(NEED_CPU_H)
-#include "config-devices.h"
-#else
-#include "config-all-devices.h"
-#endif
index b65c11c725ad22c65568cb20adafbdde98b47571..1223fc8293bb80bdd07ca97f24a3d6448871c928 100755 (executable)
--- a/configure
+++ b/configure
@@ -2209,10 +2209,6 @@ if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$targ
   mkdir -p $target_dir/nwfpe
 fi
 
-if test ! -f $target_dir/config-devices.mak ; then
-  cp $source_path/default-configs/${target}.mak $target_dir/config-devices.mak
-fi
-
 #
 # don't use ln -sf as not all "ln -sf" over write the file/link
 #