]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: support "make config" for out-of-tree users
authorJuergen Gross <jgross@suse.com>
Tue, 30 Aug 2016 11:51:23 +0000 (13:51 +0200)
committerWei Liu <wei.liu2@citrix.com>
Fri, 2 Sep 2016 08:24:59 +0000 (09:24 +0100)
Mini-OS applications being compiled using Mini-OS headers without
being integrated in the make environment of Mini-OS need a way to set
CONFIG_* defines according to their Mini-OS configuration.

Add a new make target "config" for that purpose creating a Makefile
snipplet $(CONFIG_FILE) (defaults to ./minios-config.mk) containing
the needed information.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
.gitignore
Config.mk
Makefile
minios.mk

index e55133deb72c177990632ade8064839b308f118c..d57c2bddd0a46f7dc2afa4ce6b3668c545fd02df 100644 (file)
@@ -13,3 +13,4 @@ arch/x86/minios-x86*.lds
 include/list.h
 mini-os
 mini-os.gz
+minios-config.mk
index aa367613c348b6f566af46074816070db617e614..0e405bf93885943bc6cab6a0e7285891ecbdaf32 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -51,7 +51,7 @@ endif
 
 libc = $(stubdom)
 
-XEN_INTERFACE_VERSION := 0x00030205
+XEN_INTERFACE_VERSION ?= 0x00030205
 export XEN_INTERFACE_VERSION
 
 # Try to find out the architecture family TARGET_ARCH_FAM.
@@ -193,6 +193,8 @@ DEFINES-$(CONFIG_CONSFRONT) += -DCONFIG_CONSFRONT
 DEFINES-$(CONFIG_XENBUS) += -DCONFIG_XENBUS
 DEFINES-$(CONFIG_BALLOON) += -DCONFIG_BALLOON
 
+DEFINES-y += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
+
 # Override settings for this OS
 PTHREAD_LIBS =
 nosharedlibs=y
index 43dcbd68416603aa448fbb6e34c7c13e8877970c..8e8e56e36a2f53347c434b5dd163e717ee44c29d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -158,6 +158,11 @@ $(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(TARGET_ARCH_DIR)/minios-$(MINI
        $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
        gzip -f -9 -c $@ >$@.gz
 
+.PHONY: config
+CONFIG_FILE ?= $(CURDIR)/minios-config.mk
+config:
+       echo "$(DEFINES-y)" >$(CONFIG_FILE)
+
 .PHONY: clean arch_clean
 
 arch_clean:
index 9ff6bf74e4e7b9d9eb2024ee201085a7c77f0c85..ef4d2f97850c78f77cd8582445c3cc9da8785b3b 100644 (file)
--- a/minios.mk
+++ b/minios.mk
@@ -10,7 +10,6 @@ DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redu
 DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
-DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 
 DEF_ASFLAGS += -D__ASSEMBLY__
 DEF_LDFLAGS +=