[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [v2 05/71] Makefile: Clone kconfig git submodule in Makefil
From: |
Ákos Kovács |
Subject: |
[Qemu-devel] [v2 05/71] Makefile: Clone kconfig git submodule in Makefile |
Date: |
Fri, 27 Sep 2013 04:30:26 +0200 |
configure: Append CONFIG_DEVICES_FILE=config-all-devices.mak to the
config-host.mak
Use this new variable to control the current device configuration place.
If the user wants to configure QEMU with Kconfig, replace
config-all-devices.mak to kconfig-devices.mak at config-host.mak to
use the new configuration.
Make defconfig target capable to restore the original behaviour.
Signed-off-by: Ákos Kovács <address@hidden>
---
Makefile | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Makefile.target | 2 +-
configure | 3 ++
3 files changed, 99 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 4d257f1..c8466a5 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ endif
CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
CONFIG_ALL=y
--include config-all-devices.mak
+-include $(CONFIG_DEVICES_FILE)
-include config-all-disas.mak
include $(SRC_PATH)/rules.mak
@@ -56,7 +56,7 @@ Makefile: ;
configure: ;
.PHONY: all clean cscope distclean dvi html info install install-doc \
- pdf recurse-all speed test dist
+ pdf recurse-all speed test dist help config-devices-file
kconfig-reconfigure
$(call set-vpath, $(SRC_PATH))
@@ -73,8 +73,11 @@ else
DOCS=
endif
+export KCONFIG_CONFIG=kconfig-devices.mak
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
+ifneq ($(CONFIG_DEVICES_FILE),$(KCONFIG_CONFIG))
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
+endif
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
ifeq ($(SUBDIR_DEVICES_MAK),)
@@ -112,6 +115,9 @@ endif
defconfig:
rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
+ifeq ($(CONFIG_DEVICES_FILE),$(KCONFIG_CONFIG))
+ $(call quiet-command,sed -i
"s/CONFIG_DEVICES_FILE=.*/CONFIG_DEVICES_FILE=config-all-devices.mak/"
config-host.mak)
+endif
ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
@@ -180,6 +186,93 @@ libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o
######################################################################
+######################################################################
+# Kconfig rules
+#
+KCONFIG_PATH:=scripts/kconfig
+Kconfig:=$(SRC_PATH)/Kconfig
+export KCONFIG_AUTOHEADER=auto.h
+export KCONFIG_AUTOCONFIG=auto.mak
+
+KCONFIG_FRONTENDS:=$(KCONFIG_PATH)/frontends
+KCONFIG_CONF:=$(KCONFIG_FRONTENDS)/conf/conf
+
+kconfig-reconfigure:
+ $(call quiet-command, cd $(KCONFIG_PATH) ; ./configure)
+
+define kconfig-check-deps
address@hidden test -f $1 ; then \
+ $1 $(Kconfig); \
+else \
+ echo $2; \
+ echo "After installing the missing dependencies, please run \"make
kconfig-reconfigure\""; \
+fi
+endef
+
+$(KCONFIG_PATH)/bootstrap:
+ @echo Cloning kconfig-frontends...
+ $(call quiet-command,git submodule update --init $(KCONFIG_PATH))
+
+$(KCONFIG_PATH)/Makefile: $(KCONFIG_PATH)/bootstrap
+ $(call quiet-command,cd $(KCONFIG_PATH) ; ./bootstrap ; ./configure)
+
+$(foreach i, conf nconf mconf gconf xconf, \
+ $(KCONFIG_FRONTENDS)/$i/$i): $(KCONFIG_PATH)/Makefile config-host.mak
+ $(MAKE) -C $(KCONFIG_PATH)
+
+config-devices-file:
+ifneq ($(CONFIG_DEVICES_FILE),$(KCONFIG_CONFIG))
+ $(call quiet-command,sed -i
"s/CONFIG_DEVICES_FILE=.*/CONFIG_DEVICES_FILE=$(KCONFIG_CONFIG)/"
config-host.mak)
+endif
+
+config: $(KCONFIG_CONF) config-devices-file
+ $< --oldaskconfig $(Kconfig)
+
+nconfig: $(KCONFIG_FRONTENDS)/nconfig/nconfig config-devices-file
+ $(call kconfig-check-deps,$<,"Please install libncurses5 and
libncurses5-dev")
+
+xconfig: $(KCONFIG_FRONTENDS)/qconf/qconf config-devices-file
+ $(call kconfig-check-deps,$<,"Please install Qt headers and libraries
(libqt4-gui, libqt4-dev)")
+
+gconfig: $(KCONFIG_FRONTENDS)/gconf/gconf config-devices-file
+ $(call kconfig-check-deps,$<,"Please install GTK+ headers and libraries
(libgtk-dev, libglade-dev, gir-glib)")
+
+oldconfig: $(KCONFIG_CONF) config-devices-file
+ $< --$@ $(Kconfig)
+
+menuconfig: $(KCONFIG_FRONTENDS)/mconf/mconf config-devices-file
+ $(call kconfig-check-deps,$<,"Please install libncurses5 and
libncurses5-dev")
+
+silentoldconfig: $(KCONFIG_CONF) config-devices-file
+ @echo " Build Kconfig config file"
+ mkdir -p include/config
+ $< --$@ $(Kconfig)
+
+savedefconfig: $(obj)/conf config-devices-file
+ $< address@hidden $(Kconfig)
+
+%config: $(KCONFIG_CONF) config-devices-file
+ $< --$@ $(Kconfig)
+
+help:
+ @echo ' config - Update current config utilising a
line-oriented program'
+ @echo ' nconfig - Update current config utilising a ncurses
menu based program'
+ @echo ' menuconfig - Update current config utilising a menu
based program'
+ @echo ' xconfig - Update current config utilising a QT based
front-end'
+ @echo ' gconfig - Update current config utilising a GTK based
front-end'
+ @echo ' oldconfig - Update current config utilising a provided
.config as base'
+ @echo ' silentoldconfig - Same as oldconfig, but quietly,
additionally update deps'
+ @echo ' defconfig - New config with default from ARCH supplied
defconfig'
+ @echo ' savedefconfig - Save current config as ./defconfig (minimal
config)'
+ @echo ' allnoconfig - New config where all options are answered
with no'
+ @echo ' allyesconfig - New config where all options are accepted
with yes'
+ @echo ' alldefconfig - New config with all symbols set to default'
+ @echo ' randconfig - New config with random answer to all
options'
+ @echo ' listnewconfig - List new options'
+ @echo ' oldnoconfig - Same as silentoldconfig but set new symbols
to n (unset)'
+
+######################################################################
+
qemu-img.o: qemu-img-cmds.h
qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
diff --git a/Makefile.target b/Makefile.target
index af6ac7e..adcc534 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -2,7 +2,7 @@
include ../config-host.mak
include config-target.mak
-include config-devices.mak
+include ../$(CONFIG_DEVICES_FILE)
include $(SRC_PATH)/rules.mak
$(call set-vpath, $(SRC_PATH))
diff --git a/configure b/configure
index 18fa608..cd01f05 100755
--- a/configure
+++ b/configure
@@ -4506,6 +4506,9 @@ if [ "$dtc_internal" = "yes" ]; then
echo "config-host.h: subdir-dtc" >> $config_host_mak
fi
+# Add the default device configuration file
+echo "CONFIG_DEVICES_FILE=config-all-devices.mak" >> $config_host_mak
+
# build tree in object directory in case the source is not in the current
directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos
tests/qapi-schema tests/tcg/xtensa"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
--
1.8.1.2
- [Qemu-devel] [v2 00/71] Integrating Kconfig to Qemu, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 04/71] scripts/kconfig: kconfig-frontends submodule added, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 01/71] rules.mak: New logical functions, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 02/71] Makefile.target: CONFIG_NO_* variables removed, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 03/71] default-configs/: CONFIG_GDBSTUB_XML removed, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 06/71] hw/arm/Makefile.objs: CONFIG_* created for each board, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 09/71] hw/microblaze/Makefile.objs: Create configs for petalogix boards, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 08/71] hw/m68k/Makefile.objs: Conditionally build boards, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 10/71] hw/mips/Makefile.objs: Create CONFIG_* for mips boards, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 11/71] hw/ppc/Makefile.objs: Build all boards conditinally, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 05/71] Makefile: Clone kconfig git submodule in Makefile,
Ákos Kovács <=
- [Qemu-devel] [v2 13/71] hw/sparc/Makefile.objs: CONFIG_* for sun4m and leon3 created, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 12/71] hw/sh4/Makefile.objs: Build sh4 boards conditionally, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 14/71] hw/lm32/Makefile.objs: Conditionally build lm32 and milkmyst, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 15/71] hw/s390x/Makefile.objs: Create CONFIG_S390_VIRTIO and CONFIG_S390_CCW, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 16/71] hw/s390x/Kconfig: Add s390x Kconfig, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 17/71] hw/xtensa/Makefile.objs: Build xtensa_sim and xtensa_lx60 conditionally, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 20/71] hw/arm/Kconfig: Add ARM Kconfig, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 18/71] hw/intc/Makefile.objs: Make CONFIG_ARMV7_NVIC, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 19/71] hw/9pfs/Kconfig: Add 9pfs Kconfig, Ákos Kovács, 2013/09/26
- [Qemu-devel] [v2 22/71] hw/block/Kconfig: Add Kconfig file, Ákos Kovács, 2013/09/26