|
@@ -50,6 +50,11 @@
|
|
|
# 2008-06-25 make cfg support (use a pre-built cfg.: config.mak) (andrei)
|
|
|
# 2008-06-28 added clean-all, proper-all, install-modules-man and error
|
|
|
# checks for install-utils & doc (andrei)
|
|
|
+# 2008-07-01 split module list from config.mak into modules.lst so that
|
|
|
+# the modules list can be changed without rebuilding the whole
|
|
|
+# ser (andrei)
|
|
|
+# added cfg-defs, new target that only rebuilds config.mak
|
|
|
+#
|
|
|
|
|
|
auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
|
|
|
auto_gen_others=cfg.tab.h # auto generated, non-c
|
|
@@ -197,7 +202,7 @@ ALLDEP=config.mak Makefile Makefile.sources Makefile.rules
|
|
|
|
|
|
|
|
|
# try saved cfg, unless we are in the process of building it
|
|
|
-ifeq (,$(filter config.mak config cfg,$(MAKECMDGOALS)))
|
|
|
+ifeq (,$(filter config.mak config cfg cfg-defs,$(MAKECMDGOALS)))
|
|
|
include config.mak
|
|
|
ifeq ($(makefile_defs),1)
|
|
|
$(info config.mak loaded)
|
|
@@ -205,7 +210,7 @@ $(info config.mak loaded)
|
|
|
config_mak=1
|
|
|
endif
|
|
|
else
|
|
|
-ifneq (,$(filter cfg config,$(word 1,$(MAKECMDGOALS))))
|
|
|
+ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
|
|
|
# needed here to avoid starting a config submake
|
|
|
# (e.g. rm -f config.mak; make config.mak), which would either require
|
|
|
# double Makefile.defs defines execution (suboptimal), would loose
|
|
@@ -215,6 +220,8 @@ $(shell rm -rf config.mak)
|
|
|
endif
|
|
|
endif
|
|
|
|
|
|
+include modules.lst
|
|
|
+
|
|
|
main_makefile=1
|
|
|
include Makefile.defs
|
|
|
|
|
@@ -317,10 +324,19 @@ else
|
|
|
config.mak: Makefile.defs
|
|
|
@echo making config...
|
|
|
@echo "# this file is autogenerated by make cfg" >$@
|
|
|
- @echo "# `date`" >>$@
|
|
|
@$(call mapf2,cfg_save_var,saved_fixed_vars,$(@))
|
|
|
@$(call mapf2,cfg_save_var2,saved_chg_vars,$(@))
|
|
|
@echo "override makefile_defs:=1" >>$@
|
|
|
+ @echo "DEFS:=\$$(filter-out \$$(DEFS_RM) \$$(extra_defs),\$$(DEFS))" \
|
|
|
+ "\$$(extra_defs)" >>$@
|
|
|
+ @echo "CFLAGS:=\$$(filter-out \$$(CFLAGS_RM) \$$(CC_EXTRA_OPTS)," \
|
|
|
+ "\$$(CFLAGS)) \$$(CC_EXTRA_OPTS)" >>$@
|
|
|
+
|
|
|
+endif # ifeq ($(config_mak),1)
|
|
|
+
|
|
|
+modules.lst:
|
|
|
+ @echo saving modules list...
|
|
|
+ @echo "# this file is autogenerated by make modules-cfg" >$@
|
|
|
@$(call cfg_save_var2,group_include,$@)
|
|
|
@$(call cfg_save_var2,include_modules,$@)
|
|
|
@$(call cfg_save_var2,static_modules,$@)
|
|
@@ -330,18 +346,16 @@ config.mak: Makefile.defs
|
|
|
@$(call cfg_save_var2,modules_noinc,$@)
|
|
|
@$(call cfg_save_var2,modules,$@)
|
|
|
@echo "modules_configured:=1" >>$@
|
|
|
- @echo "DEFS:=\$$(filter-out \$$(DEFS_RM) \$$(extra_defs),\$$(DEFS))" \
|
|
|
- "\$$(extra_defs)" >>$@
|
|
|
- @echo "CFLAGS:=\$$(filter-out \$$(CFLAGS_RM) \$$(CC_EXTRA_OPTS)," \
|
|
|
- "\$$(CFLAGS)) \$$(CC_EXTRA_OPTS)" >>$@
|
|
|
|
|
|
-endif # ifeq ($(config_mak),1)
|
|
|
+.PHONY: cfg config cfg-defs
|
|
|
+cfg-defs: config.mak
|
|
|
|
|
|
-.PHONY: cfg config
|
|
|
-cfg config: config.mak
|
|
|
+cfg config: cfg-defs modules-cfg
|
|
|
|
|
|
-#rm -f config.mak
|
|
|
-#$(MAKE) config.mak exported_vars=0
|
|
|
+.PHONY: modules-cfg modules-list modules-lst
|
|
|
+modules-cfg modules-list modules-lst:
|
|
|
+ rm -rf modules.lst
|
|
|
+ $(MAKE) modules.lst
|
|
|
|
|
|
.PHONY: all
|
|
|
all: $(NAME) modules
|
|
@@ -356,7 +370,7 @@ print-modules:
|
|
|
echo The following modules will be made: $(modules_basenames) ; \
|
|
|
|
|
|
.PHONY: modules
|
|
|
-modules:
|
|
|
+modules: modules.lst
|
|
|
@for r in $(modules) "" ; do \
|
|
|
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
|
|
|
echo "" ; \
|
|
@@ -420,6 +434,7 @@ tar:
|
|
|
--exclude=libiname.lst \
|
|
|
--exclude=makecfg.lst \
|
|
|
--exclude=config.mak \
|
|
|
+ --exclude=modules.lst \
|
|
|
--exclude=*.[do] \
|
|
|
--exclude=*.so \
|
|
|
--exclude=*.il \
|
|
@@ -475,7 +490,7 @@ sunpkg:
|
|
|
rm -rf tmp/ser_sun_pkg
|
|
|
|
|
|
.PHONY: modules-doc
|
|
|
-modules-doc:
|
|
|
+modules-doc: modules.lst
|
|
|
-@for r in $(modules) "" ; do \
|
|
|
if [ -n "$$r" ]; then \
|
|
|
echo "" ; \
|
|
@@ -488,7 +503,7 @@ modules-doc:
|
|
|
modules-readme: README
|
|
|
|
|
|
.PHONY: README
|
|
|
-README:
|
|
|
+README: modules.lst
|
|
|
-@for r in $(modules) "" ; do \
|
|
|
if [ -n "$$r" ]; then \
|
|
|
echo "" ; \
|
|
@@ -505,7 +520,7 @@ README:
|
|
|
modules-man: man
|
|
|
|
|
|
.PHONY: man
|
|
|
-man:
|
|
|
+man: modules.lst
|
|
|
-@for r in $(modules) "" ; do \
|
|
|
if [ -n "$$r" ]; then \
|
|
|
echo "" ; \
|
|
@@ -609,7 +624,7 @@ install-share: $(share_prefix)/$(share_dir)
|
|
|
fi ; \
|
|
|
done; true
|
|
|
|
|
|
-install-modules: $(modules_prefix)/$(modules_dir)
|
|
|
+install-modules: modules.lst $(modules_prefix)/$(modules_dir)
|
|
|
@for r in $(modules) "" ; do \
|
|
|
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
|
|
|
echo "" ; \
|
|
@@ -676,7 +691,7 @@ install-doc: $(doc_prefix)/$(doc_dir) install-modules-doc
|
|
|
$(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
|
|
|
|
|
|
|
|
|
-install-modules-doc: $(doc_prefix)/$(doc_dir)
|
|
|
+install-modules-doc: modules.lst $(doc_prefix)/$(doc_dir)
|
|
|
@for r in $(modules_basenames) "" ; do \
|
|
|
if [ -n "$$r" ]; then \
|
|
|
if [ -f modules/"$$r"/README ]; then \
|
|
@@ -738,8 +753,12 @@ clean: clean_libs
|
|
|
clean-all: modules=$(modules_all)
|
|
|
clean-all: clean
|
|
|
|
|
|
+# on make proper clean also the build config (w/o module list)
|
|
|
proper realclean distclean: clean_cfg
|
|
|
|
|
|
+# on maintainer clean, remove also the configured module list
|
|
|
+maintainer-clean: clean_modules_cfg
|
|
|
+
|
|
|
.PHONY: proper-all realclean-all distclean-all
|
|
|
proper-all realclean-all distclean-all: modules=$(modules_all)
|
|
|
proper-all realclean-all distclean-all: proper
|
|
@@ -749,3 +768,6 @@ proper-all realclean-all distclean-all: proper
|
|
|
clean_cfg:
|
|
|
rm -f config.mak
|
|
|
|
|
|
+.PHONY: clean_modules_cfg clean-modules-cfg
|
|
|
+clean_modules_cfg clean-modules-cfg:
|
|
|
+ rm -f modules.lst
|