3 # DROPS (Dresden Realtime OPerating System) Component
5 # Makefile-Include for compiling templates (prog.mk, lib.mk)
8 # Makefile-Include for binary, lib, subdir and other directories.
9 # Definitions and rules for the DROPS configuration tool.
13 # config:: - run the menu-driven configuration tool
14 # menuconfig xconfig:: - run the configuration tool
15 # oldconfig:: - (re)create the configuration header
16 # based on a prior configuration
19 # Required Parameters:
24 # Optional Parameters:
26 # DROPSCONF - if nonempty, the configuration tool is run for
27 # target config::. If empty, the configuration tool
29 # DROPSCONF_TITLE - the main title in the configuration tool.
30 # DROPSCONF_DEFCONFIG - default config file
31 # DROPSCONF_CONFIG_IN - configuration defintion file
32 # DROPSCONF_CONFIG - config file
33 # DROPSCONF_CONFIG_H - generated config header file
34 # DROPSCONF_MACRO - macro to indicate inclusion of config header file
35 # DROPSCONF_HELPFILE - options help file
36 # DROPSCONF_TOOL - the menudriven configuration tool
37 # DROPSCONF_TOOL_TXT - the configuration tool
38 # DROPSCONF_TOOL_OLD - helper for recreating the config header file
41 KCONFIG_OBJ_DIR = $(OBJ_BASE)/tool/kconfig
43 kconfig_call = [ -d $@ ] || install -d $(OBJ_BASE)/include/l4; \
44 $(MAKE) -C $(L4DIR)/tool/kconfig O=$(OBJ_BASE) \
45 Kconfig=$(KCONFIG_FILE) \
46 KCONFIG_AUTOHEADER=include/l4/bid_config.h \
47 KCONFIG_CONFIG=.kconfig \
48 KCONFIG_AUTOCONFIG=.kconfig.auto \
49 KCONFIG_TRISTATE=.kconfig.tristate \
51 l4re_srcdir=$(L4DIR_ABS)
55 #DROPSCONF_TITLE ?= DROPS Configuration Tool
56 #DROPSCONF_DEFCONFIG ?= defconfig
57 #DROPSCONF_CONFIG_IN ?= config.in
58 #DROPSCONF_CONFIG ?= $(OBJ_DIR)/.config
59 #DROPSCONF_CONFIG_H ?= $(OBJ_DIR)/config.h
60 #DROPSCONF_CONFIG_MK ?= $(OBJ_DIR)/Makeconf.bid.local
61 DROPSCONF_DONTINC_MK ?=
62 #DROPSCONF_MACRO ?= CONFIG_H_INCLUDED
63 #DROPSCONF_HELPFILE ?= config.help
64 #DROPSCONF_LXDIALOG ?= $(OBJ_BASE)/tool/config/lxdialog/lxdialog
65 #DROPSCONF_TOOL ?= $(firstword $(wildcard \
66 # $(L4DIR)/tool/config/Menuconfig \
67 # $(DROPS_STDDIR)/tool/bin/Menuconfig) \
68 # did_not_find_BID_Menuconfig)
69 #DROPSCONF_TOOL_TXT ?= $(firstword $(wildcard \
70 # $(L4DIR)/tool/config/Configure \
71 # $(DROPS_STDDIR)/tool/bin/Configure) \
72 # did_not_find_BID_Configure)
73 #DROPSCONF_TOOL_OLD ?= $(firstword $(wildcard \
74 # $(L4DIR)/tool/config/Configure \
75 # $(DROPS_STDDIR)/tool/bin/Configure) \
76 # did_not_find_BID_Configure) -d
77 #DROPSCONF_VARDEFS = $(foreach v,TITLE DEFCONFIG CONFIG_IN CONFIG CONFIG_H \
78 # MACRO HELPFILE UNDEF LXDIALOG,DROPSCONF_$v='$(DROPSCONF_$v)')
81 .o: $(DROPSCONF_CONFIG_H)
83 DIRS_FOR_CONFIG = $(KCONFIG_OBJ_DIR) $(OBJ_BASE)/config
85 $(DIRS_FOR_CONFIG): $(KCONFIG_FILE)
86 $(VERBOSE)[ -d $@ ] || install -d $@
88 menuconfig config: $(DIRS_FOR_CONFIG)
89 $(VERBOSE)+$(kconfig_call) menuconfig silentoldconfig
90 $(VERBOSE)test ! -r $(DROPSCONF_CONFIG) -o \
91 ! $(DROPSCONF_CONFIG) -nt $(DROPSCONF_CONFIG_MK) || \
92 $(MAKE) $(DROPSCONF_CONFIG_MK)
94 textconfig: $(DIRS_FOR_CONFIG)
95 $(VERBOSE)+$(kconfig_call) config silentoldconfig
96 @$(MAKE) $(DROPSCONF_CONFIG_MK)
98 oldconfig xconfig gconfig nconfig randconfig allyesconfig allnoconfig: $(DIRS_FOR_CONFIG)
99 $(VERBOSE)+$(kconfig_call) $@ silentoldconfig
100 @$(MAKE) $(DROPSCONF_CONFIG_MK)
102 $(DROPSCONF_CONFIG) silentoldconfig: $(DIRS_FOR_CONFIG)
103 $(VERBOSE)+$(kconfig_call) silentoldconfig
106 #$(DROPSCONF_CONFIG_H): $(DROPSCONF_CONFIG)
108 #$(DROPSCONF_CONFIG_H) $(DROPSCONF_CONFIG): $(DROPSCONF_CONFIG_IN)
110 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG))
111 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
112 # $(VERBOSE)if tty >/dev/null; then \
113 # $(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD); \
115 # true | $(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD) \
116 # $(if $(VERBOSE),>/dev/null,) || \
117 # ( echo -e "\nError: Unattended mode -- Some defaults for config options are missing." ; \
121 $(DROPSCONF_CONFIG_MK): $(DROPSCONF_CONFIG)
122 $(VERBOSE)sed -e "s/\(^[^= ]*=\)'\([^']*\)'/\1\2/" \
123 <$(DROPSCONF_CONFIG) >$@
124 $(VERBOSE)$(MAKE) DROPSCONF_CONFIG_MK_POST_HOOK
126 DROPSCONF_CONFIG_MK_POST_HOOK::
128 #config:: $(DROPSCONF_LXDIALOG)
129 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
130 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL)
131 # $(VERBOSE)test ! -r $(DROPSCONF_CONFIG) -o \
132 # ! $(DROPSCONF_CONFIG) -nt $(DROPSCONF_CONFIG_MK) || \
133 # $(MAKE) $(DROPSCONF_CONFIG_MK)
136 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
137 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_TXT)
138 # @$(MAKE) $(DROPSCONF_CONFIG_MK)
141 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
142 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD)
143 # @$(MAKE) $(DROPSCONF_CONFIG_MK)
145 #$(DROPSCONF_LXDIALOG):
146 # $(VERBOSE)install -d $(@D)
147 # $(VERBOSE)PWD=$(call absfilename,$(L4DIR)/tool/config) $(MAKE) -C $(L4DIR)/tool/config
153 $(VERBOSE)$(RM) $(DROPSCONF_CONFIG) $(DROPSCONF_CONFIG_H) \
154 $(DROPSCONF_CONFIG_MK) .menuconfig.log \
155 $(DROPSCONF_CONFIG).old
160 @echo "Configuration targets:"
161 @echo " config - run the menu-driven configuration tool"
162 @echo " gconfig - run a graphical configuration tool"
163 @echo " xconfig - run a graphical configuration tool"
164 @echo " oldconfig - (re)create the configuration header based on a prior"
165 @echo " configuration or default values"
167 # special switch not to include DROPSCONF_CONFIG_MK
168 ifeq ($(DROPSCONF_DONTINC_MK),)
169 # do not prebuild the config file on "make config"
170 ifeq ($(filter config oldconfig silentoldconfig txtconfig help scrub clean cleanall $(DROPSCONF_CONFIG_MK),$(MAKECMDGOALS)),)
171 $(info INCLUDING $(DROPSCONF_CONFIG_MK) config.inc)
172 -include $(DROPSCONF_CONFIG_MK)
176 # end of DROPSCONF defined
178 config txtconfig oldconfig silentoldconfig::
181 .PHONY: config oldconfig silentoldconfig txtconfig menuconfig \
182 xconfig gconfig nconfig randconfig allyesconfig allnoconfig