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_FILE = $(L4DIR_ABS)/mk/Kconfig
42 KCONFIG_OBJ_DIR = $(OBJ_BASE)/tool/kconfig
44 kconfig_call = $(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 $(OBJ_BASE)/include/l4
86 $(VERBOSE)install -d $@
89 menuconfig config: $(KCONFIG_FILE) $(DIRS_FOR_CONFIG)
90 $(VERBOSE)$(kconfig_call) menuconfig silentoldconfig
91 $(VERBOSE)test ! -r $(DROPSCONF_CONFIG) -o \
92 ! $(DROPSCONF_CONFIG) -nt $(DROPSCONF_CONFIG_MK) || \
93 $(MAKE) $(DROPSCONF_CONFIG_MK)
95 oldconfig xconfig gconfig nconfig randconfig allyesconfig allnoconfig: $(DIRS_FOR_CONFIG)
96 $(VERBOSE)$(kconfig_call) $@ silentoldconfig
97 @$(MAKE) $(DROPSCONF_CONFIG_MK)
99 $(DROPSCONF_CONFIG): $(DIRS_FOR_CONFIG)
100 $(VERBOSE)$(kconfig_call) silentoldconfig
103 #$(DROPSCONF_CONFIG_H): $(DROPSCONF_CONFIG)
105 #$(DROPSCONF_CONFIG_H) $(DROPSCONF_CONFIG): $(DROPSCONF_CONFIG_IN)
107 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG))
108 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
109 # $(VERBOSE)if tty >/dev/null; then \
110 # $(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD); \
112 # true | $(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD) \
113 # $(if $(VERBOSE),>/dev/null,) || \
114 # ( echo -e "\nError: Unattended mode -- Some defaults for config options are missing." ; \
118 $(DROPSCONF_CONFIG_MK): $(DROPSCONF_CONFIG)
119 $(VERBOSE)sed -e "s/\(^[^= ]*=\)'\([^']*\)'/\1\2/" \
120 <$(DROPSCONF_CONFIG) >$@
121 $(VERBOSE)$(MAKE) DROPSCONF_CONFIG_MK_POST_HOOK
123 DROPSCONF_CONFIG_MK_POST_HOOK::
125 #config:: $(DROPSCONF_LXDIALOG)
126 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
127 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL)
128 # $(VERBOSE)test ! -r $(DROPSCONF_CONFIG) -o \
129 # ! $(DROPSCONF_CONFIG) -nt $(DROPSCONF_CONFIG_MK) || \
130 # $(MAKE) $(DROPSCONF_CONFIG_MK)
133 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
134 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_TXT)
135 # @$(MAKE) $(DROPSCONF_CONFIG_MK)
138 # $(VERBOSE)install -d $(dir $(DROPSCONF_CONFIG_H))
139 # $(VERBOSE)$(DROPSCONF_VARDEFS) $(DROPSCONF_TOOL_OLD)
140 # @$(MAKE) $(DROPSCONF_CONFIG_MK)
142 #$(DROPSCONF_LXDIALOG):
143 # $(VERBOSE)install -d $(@D)
144 # $(VERBOSE)PWD=$(call absfilename,$(L4DIR)/tool/config) $(MAKE) -C $(L4DIR)/tool/config
149 $(VERBOSE)$(RM) $(DROPSCONF_CONFIG) $(DROPSCONF_CONFIG_H) \
150 $(DROPSCONF_CONFIG_MK) .menuconfig.log \
151 $(DROPSCONF_CONFIG).old
155 @echo "Configuration targets:"
156 @echo " config - run the menu-driven configuration tool"
157 @echo " gconfig - run a graphical configuration tool"
158 @echo " xconfig - run a graphical configuration tool"
159 @echo " oldconfig - (re)create the configuration header based on a prior"
160 @echo " configuration or default values"
162 # special switch not to include DROPSCONF_CONFIG_MK
163 ifeq ($(DROPSCONF_DONTINC_MK),)
164 # do not prebuild the config file on "make config"
165 ifeq ($(filter config oldconfig txtconfig help scrub clean cleanall $(DROPSCONF_CONFIG_MK),$(MAKECMDGOALS)),)
166 $(info INCLUDING $(DROPSCONF_CONFIG_MK) config.inc)
167 -include $(DROPSCONF_CONFIG_MK)
171 # end of DROPSCONF defined
173 config txtconfig oldconfig::
176 .PHONY: config oldconfig txtconfig