[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/3] mini-os: support "make config" for out-of-tree users



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@xxxxxxxx>
---
 .gitignore | 1 +
 Config.mk  | 4 +++-
 Makefile   | 5 +++++
 minios.mk  | 1 -
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index e55133d..d57c2bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ arch/x86/minios-x86*.lds
 include/list.h
 mini-os
 mini-os.gz
+minios-config.mk
diff --git a/Config.mk b/Config.mk
index aa36761..0e405bf 100644
--- 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
diff --git a/Makefile b/Makefile
index 43dcbd6..8e8e56e 100644
--- 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:
diff --git a/minios.mk b/minios.mk
index 9ff6bf7..ef4d2f9 100644
--- 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 +=
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.