mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-05 19:47:48 +00:00
DM: VMcfg: Kconfig & Makefile for VM Configuration
VMcfg use Kconfig mechanism to generate a header file devicemodel/include/vmcfg_config.h, which contains many macro symbols for conditionally compiling. This feature is disabled by default, to enable it, You can switch to devicemodel/vmcfg/ and run 'make' with these options: 'make menuconfig' run 'make menuconfig' at ./devicemodel/vmcfg/, and configure manually. When you finished, save your changes to ./devicemode/vmcfg/.config 'make oldconfig' Overwrite ./devicemodel/vmcfg/.config with your config file, then run 'make oldconfig' at ./devicemodel/vmcfg 'make *_defconfig' E.g, there is ./devicemodel/vmcfg/config/mrb_defconfig, you can run 'make mrb_defconfig' at ./devicemodel/vmcfg/ Tracked-On: #1528 Acked-by: Yin Fengwei <fengwei.yin@intel.com> Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
parent
4ce80e5ccc
commit
646cc8c4b2
@ -136,6 +136,7 @@ SRCS += arch/x86/pm.c
|
||||
OBJS := $(patsubst %.c,$(DM_OBJDIR)/%.o,$(SRCS))
|
||||
|
||||
HEADERS := $(shell find $(BASEDIR) -name '*.h')
|
||||
HEADERS += $(BASEDIR)/include/vmcfg_config.h
|
||||
DISTCLEAN_OBJS := $(shell find $(BASEDIR) -name '*.o')
|
||||
|
||||
PROGRAM := acrn-dm
|
||||
@ -145,9 +146,12 @@ SAMPLES_MRB := $(wildcard samples/apl-mrb/*)
|
||||
|
||||
BIOS_BIN := $(wildcard bios/*)
|
||||
|
||||
all: include/version.h $(PROGRAM)
|
||||
all: include/version.h vmcfg_header $(PROGRAM)
|
||||
@echo -n ""
|
||||
|
||||
vmcfg_header:
|
||||
make -C $(BASEDIR)/vmcfg $(BASEDIR)/include/vmcfg_config.h BASEDIR=$(BASEDIR)
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(CC) -o $(DM_OBJDIR)/$@ $(CFLAGS) $(LDFLAGS) $^ $(LIBS)
|
||||
|
||||
|
5
devicemodel/vmcfg/Kconfig
Normal file
5
devicemodel/vmcfg/Kconfig
Normal file
@ -0,0 +1,5 @@
|
||||
mainmenu "VM Configuration"
|
||||
|
||||
config VM_CFG
|
||||
bool "Enable build-in VM configuration"
|
||||
default n
|
3
devicemodel/vmcfg/Makefile
Normal file
3
devicemodel/vmcfg/Makefile
Normal file
@ -0,0 +1,3 @@
|
||||
BASEDIR ?= ..
|
||||
|
||||
include $(BASEDIR)/vmcfg/scripts/kconfig/kconfig.mk
|
20
devicemodel/vmcfg/scripts/kconfig/kconfig.mk
Normal file
20
devicemodel/vmcfg/scripts/kconfig/kconfig.mk
Normal file
@ -0,0 +1,20 @@
|
||||
$(eval $(call check_dep_exec,menuconfig,MENUCONFIG_DEPS))
|
||||
|
||||
export KCONFIG_CONFIG := $(BASEDIR)/vmcfg/.config
|
||||
|
||||
.PHONY: oldconfig
|
||||
oldconfig:
|
||||
@python3 $(BASEDIR)/../scripts/kconfig/silentoldconfig.py Kconfig $(KCONFIG_CONFIG)
|
||||
|
||||
%_defconfig:
|
||||
@python3 $(BASEDIR)/../scripts/kconfig/defconfig.py Kconfig $(BASEDIR)/vmcfg/config/$@ $(KCONFIG_CONFIG)
|
||||
|
||||
$(KCONFIG_CONFIG): oldconfig
|
||||
|
||||
$(BASEDIR)/include/vmcfg_config.h: $(KCONFIG_CONFIG)
|
||||
echo @mkdir -p $(dir $@)
|
||||
@mkdir -p $(dir $@)
|
||||
@python3 $(BASEDIR)/../scripts/kconfig/generate_header.py Kconfig $< $@
|
||||
|
||||
menuconfig: $(MENUCONFIG_DEPS) $(HV_OBJDIR)/$(HV_CONFIG)
|
||||
@python3 $(shell which menuconfig) Kconfig
|
Loading…
Reference in New Issue
Block a user