|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC 03/29] build: hookup initial Kconfig usage
Wire in the Kconfig build and makefile rules to be able to generate
valid configuration files to be used by the build process.
Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
.gitignore | 8 ++++++++
xen/Kconfig | 26 ++++++++++++++++++++++++++
xen/Makefile | 14 ++++++++++++++
xen/Makefile.linux | 21 ++++++++++-----------
xen/arch/arm/Kconfig | 27 +++++++++++++++++++++++++++
xen/arch/arm/Makefile.kconfig | 8 ++++++++
xen/arch/arm/defconfig | 0
xen/arch/x86/Kconfig | 28 ++++++++++++++++++++++++++++
xen/arch/x86/Makefile.kconfig | 26 ++++++++++++++++++++++++++
xen/arch/x86/i386_defconfig | 1 +
xen/arch/x86/x86_64_defconfig | 0
xen/common/Kconfig | 4 ++++
xen/drivers/Kconfig | 3 +++
13 files changed, 155 insertions(+), 11 deletions(-)
create mode 100644 xen/Kconfig
create mode 100644 xen/arch/arm/Kconfig
create mode 100644 xen/arch/arm/Makefile.kconfig
create mode 100644 xen/arch/arm/defconfig
create mode 100644 xen/arch/x86/Kconfig
create mode 100644 xen/arch/x86/Makefile.kconfig
create mode 100644 xen/arch/x86/i386_defconfig
create mode 100644 xen/arch/x86/x86_64_defconfig
create mode 100644 xen/common/Kconfig
create mode 100644 xen/drivers/Kconfig
diff --git a/.gitignore b/.gitignore
index 9ead7c4..a78494d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -218,6 +218,11 @@ tools/xentrace/tbctl
tools/xentrace/xenctx
tools/xentrace/xentrace
xen/.banner
+xen/.config
+xen/.config.old
+xen/defconfig
+xen/**/*.cmd
+xen/**/modules.order
xen/System.map
xen/arch/arm/asm-offsets.s
xen/arch/arm/xen.lds
@@ -240,6 +245,9 @@ xen/include/headers++.chk
xen/include/asm
xen/include/asm-*/asm-offsets.h
xen/include/compat/*
+xen/include/config.h
+xen/include/config/
+xen/include/generated/
xen/include/public/public
xen/include/xen/*.new
xen/include/xen/acm_policy.h
diff --git a/xen/Kconfig b/xen/Kconfig
new file mode 100644
index 0000000..7353077
--- /dev/null
+++ b/xen/Kconfig
@@ -0,0 +1,26 @@
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt from the Linux
+# kernel source tree.
+#
+mainmenu "Xen $KERNELVERSION Configuration"
+
+config SRCARCH
+ string
+ option env="SRCARCH"
+
+config ARCH
+ string
+ option env="ARCH"
+
+source "arch/$SRCARCH/Kconfig"
+
+config KERNELVERSION
+ string
+ option env="KERNELVERSION"
+
+config DEFCONFIG_LIST
+ string
+ option defconfig_list
+ default "$ARCH_DEFCONFIG"
+ default "arch/$SRCARCH/defconfig"
diff --git a/xen/Makefile b/xen/Makefile
index c556198..6bb9c27 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -17,12 +17,18 @@ export XEN_ROOT := $(BASEDIR)/..
EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
+# Don't break if the build process wasn't called from the top level
+XEN_TARGET_ARCH ?= $(shell uname -m)
+
.PHONY: default
default: build
.PHONY: dist
dist: install
+.PHONY: build
+build:: include/config/auto.conf
+
.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags
build install uninstall debug clean distclean cscope TAGS tags MAP gtags::
ifneq ($(XEN_TARGET_ARCH),x86_32)
@@ -216,3 +222,11 @@ FORCE:
%/: FORCE
$(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o built_in_bin.o
+
+kconfig := oldsilentconfig oldconfig config menuconfig defconfig \
+ savedefconfig listnewconfig include/config/auto.conf
+.PHONY: $(kconfig)
+$(kconfig):
+ $(MAKE) -f Makefile.linux ARCH=$(XEN_TARGET_ARCH) $@
+
+-include include/config/auto.conf.cmd
diff --git a/xen/Makefile.linux b/xen/Makefile.linux
index c361593..ffb4aef 100644
--- a/xen/Makefile.linux
+++ b/xen/Makefile.linux
@@ -1,8 +1,7 @@
-VERSION = 4
-PATCHLEVEL = 2
+VERSION = $(XEN_VERSION)
+PATCHLEVEL = $(XEN_SUBVERSION)
SUBLEVEL = 0
-EXTRAVERSION =
-NAME = Hurr durr I'ma sheep
+EXTRAVERSION = $(XEN_EXTRAVERSION)
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
@@ -144,7 +143,7 @@ $(filter-out _all sub-make $(CURDIR)/Makefile,
$(MAKECMDGOALS)) _all: sub-make
sub-make: FORCE
$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
- -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
+ -f $(CURDIR)/Makefile.linux $(filter-out _all sub-make,$(MAKECMDGOALS))
# Leave processing to above invocation of make
skip-makefile := 1
@@ -509,7 +508,7 @@ $(filter-out __build_one_by_one, $(MAKECMDGOALS)):
__build_one_by_one
__build_one_by_one:
$(Q)set -e; \
for i in $(MAKECMDGOALS); do \
- $(MAKE) -f $(srctree)/Makefile $$i; \
+ $(MAKE) -f $(srctree)/Makefile.linux $$i; \
done
else
@@ -521,7 +520,7 @@ ifeq ($(config-targets),1)
# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
# KBUILD_DEFCONFIG may point out an alternative default configuration
# used for 'make defconfig'
-include arch/$(SRCARCH)/Makefile
+include arch/$(SRCARCH)/Makefile.kconfig
export KBUILD_DEFCONFIG KBUILD_KCONFIG
config: scripts_basic outputmakefile FORCE
@@ -569,7 +568,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
- $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+ $(Q)$(MAKE) -f $(srctree)/Makefile.linux silentoldconfig
else
# external modules needs include/generated/autoconf.h and
include/config/auto.conf
# but do not care if they are up-to-date. Use auto.conf to trigger the test
@@ -602,7 +601,7 @@ all: vmlinux
ARCH_CPPFLAGS :=
ARCH_AFLAGS :=
ARCH_CFLAGS :=
-include arch/$(SRCARCH)/Makefile
+include arch/$(SRCARCH)/Makefile.kconfig
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
@@ -921,7 +920,7 @@ quiet_cmd_link-vmlinux = LINK $@
# execute if the rest of the kernel build went well.
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_HEADERS_CHECK
- $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
+ $(Q)$(MAKE) -f $(srctree)/Makefile.linux headers_check
endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
@@ -1015,7 +1014,7 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
-$(version_h): $(srctree)/Makefile FORCE
+$(version_h): $(srctree)/Makefile.linux FORCE
$(call filechk,version.h)
$(Q)rm -f $(old_version_h)
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
new file mode 100644
index 0000000..8db5ff9
--- /dev/null
+++ b/xen/arch/arm/Kconfig
@@ -0,0 +1,27 @@
+# Select 32 or 64 bit
+config 64BIT
+ bool "64-bit Xen" if ARCH = "arm64"
+ default ARCH != "arm32"
+ help
+ Say yes to build a 64-bit Xen
+ Say no to build a 32-bit Xen
+
+config ARM_32
+ def_bool y
+ depends on !64BIT
+
+config ARM_64
+ def_bool y
+ depends on 64BIT
+
+config ARM
+ def_bool y
+
+config ARCH_DEFCONFIG
+ string
+ default "arch/arm/arm32_defconfig" if ARM_32
+ default "arch/arm/arm64_defconfig" if ARM_64
+
+source "common/Kconfig"
+
+source "drivers/Kconfig"
diff --git a/xen/arch/arm/Makefile.kconfig b/xen/arch/arm/Makefile.kconfig
new file mode 100644
index 0000000..35a475f
--- /dev/null
+++ b/xen/arch/arm/Makefile.kconfig
@@ -0,0 +1,8 @@
+
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+KBUILD_CFLAGS += -Iinclude/asm-arm/$(ARCH)
+
+define archhelp
+ echo '* xen.gz - Compressed Xen image'
+endef
diff --git a/xen/arch/arm/defconfig b/xen/arch/arm/defconfig
new file mode 100644
index 0000000..e69de29
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
new file mode 100644
index 0000000..5e34f4e
--- /dev/null
+++ b/xen/arch/x86/Kconfig
@@ -0,0 +1,28 @@
+# Select 32 or 64 bit
+config 64BIT
+ bool "64-bit Xen" if ARCH = "x86_64"
+ default ARCH != "i386"
+ ---help---
+ Say yes to build a 64-bit Xen
+ Say no to build a 32-bit Xen
+
+config X86_32
+ def_bool y
+ depends on !64BIT
+
+config X86_64
+ def_bool y
+ depends on 64BIT
+
+config X86
+ def_bool y
+ select HAS_GDBSX
+
+config ARCH_DEFCONFIG
+ string
+ default "arch/x86/i386_defconfig" if X86_32
+ default "arch/x86/x86_64_defconfig" if X86_64
+
+source "common/Kconfig"
+
+source "drivers/Kconfig"
diff --git a/xen/arch/x86/Makefile.kconfig b/xen/arch/x86/Makefile.kconfig
new file mode 100644
index 0000000..cedf921
--- /dev/null
+++ b/xen/arch/x86/Makefile.kconfig
@@ -0,0 +1,26 @@
+
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+KBUILD_CFLAGS += -Iinclude/asm-x86/mach-default
+KBUILD_CFLAGS += -Iinclude/asm-x86/mach-generic
+
+core-y += arch/x86/
+
+drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
+
+all: xen.gz
+
+xen.gz: vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
+
+PHONY += install
+install:
+ $(Q)$(MAKE) $(build)=$(boot) $@
+
+archclean:
+ $(Q)rm -rf $(objtree)/arch/x86
+ $(Q)$(MAKE) $(clean)=$(boot)
+
+define archhelp
+ echo '* xen.gz - Compressed Xen image'
+endef
diff --git a/xen/arch/x86/i386_defconfig b/xen/arch/x86/i386_defconfig
new file mode 100644
index 0000000..2441d5a
--- /dev/null
+++ b/xen/arch/x86/i386_defconfig
@@ -0,0 +1 @@
+# CONFIG_64BIT is not set
diff --git a/xen/arch/x86/x86_64_defconfig b/xen/arch/x86/x86_64_defconfig
new file mode 100644
index 0000000..e69de29
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
new file mode 100644
index 0000000..0251856
--- /dev/null
+++ b/xen/common/Kconfig
@@ -0,0 +1,4 @@
+
+menu "Common Features"
+
+endmenu
diff --git a/xen/drivers/Kconfig b/xen/drivers/Kconfig
new file mode 100644
index 0000000..7bc7b6e
--- /dev/null
+++ b/xen/drivers/Kconfig
@@ -0,0 +1,3 @@
+menu "Device Drivers"
+
+endmenu
--
2.4.9
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |