v2: generate config-devices.h which contains the list of devices enabled

---
config-devices.h is an auto-generated header file that will use
config-devices.mak to define the list of devices enabled.
Configs that are set to 'n' are ignored.

Signed-off-by: Julio Montes <julio.mon...@intel.com>
---
 Makefile.target        | 5 +++++
 scripts/clean-includes | 2 +-
 scripts/create_config  | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile.target b/Makefile.target
index a6919e0caf..65eda0994d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -45,6 +45,9 @@ include $(SRC_PATH)/tests/tcg/Makefile.include
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak

+config-devices.h: config-devices.h-timestamp
+config-devices.h-timestamp: config-devices.mak
+
 ifdef CONFIG_TRACE_SYSTEMTAP
 stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp 
$(QEMU_PROG)-log.stp

@@ -170,6 +173,8 @@ generated-files-y += hmp-commands.h hmp-commands-info.h

 endif # CONFIG_SOFTMMU

+generated-files-y += config-devices.h
+
 dummy := $(call unnest-vars,,obj-y)
 all-obj-y := $(obj-y)

diff --git a/scripts/clean-includes b/scripts/clean-includes
index dd938daa3e..fb05a639d5 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -161,7 +161,7 @@ for f in "$@"; do
   # Remove includes that osdep.h already provides
   perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ ||
                           ! (grep { $_ eq $1 } qw (
-           "config-host.h" "config-target.h" "qemu/compiler.h"
+           "config-host.h" "config-target.h" "config-devices.h" 
"qemu/compiler.h"
            <setjmp.h> <stdarg.h> <stddef.h> <stdbool.h> <stdint.h> 
<sys/types.h>
            <stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
            <limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
diff --git a/scripts/create_config b/scripts/create_config
index d727e5e36e..00e86c82b0 100755
--- a/scripts/create_config
+++ b/scripts/create_config
@@ -58,6 +58,8 @@ case $line in
     name=${line%=*}
     echo "#define $name 1"
     ;;
+ CONFIG_*=n) # configuration
+    ;;
  CONFIG_*=*) # configuration
     name=${line%=*}
     value=${line#*=}
--
2.17.2

Reply via email to