Просмотр исходного кода

- moved modules list from config.mak to modules.lst and added modules list
reconfigure targets: make modules-cfg ... (this allows changing the modules
list without triggering a complete recompile)
- added make cfg-defs which would change only the build options, without
modifying the modules list

Andrei Pelinescu-Onciul 17 лет назад
Родитель
Сommit
0bd6adc6bc
4 измененных файлов с 69 добавлено и 27 удалено
  1. 24 5
      INSTALL
  2. 40 18
      Makefile
  3. 1 1
      Makefile.cfg
  4. 4 3
      Makefile.targets

+ 24 - 5
INSTALL

@@ -258,8 +258,19 @@ make modules=modules/print modules
 make cfg modules=modules/print mode=debug PROFILE=-pg
 make cfg modules=modules/print mode=debug PROFILE=-pg
 make all
 make all
 
 
+- change & save the  modules list without rebuilding the whole config
+ (so that already compiled modules won't be re-compiled by 
+  make all/make modules):
+
+make modules-cfg include_modules="mysql postgress"
+
+- change only the compile/build options, without changing the modules list:
+
+make cfg-defs CPU=ultrasparc PROFILE=-pg
+
 - compile by default all the usual modules + mysql and postgres, optimized 
 - compile by default all the usual modules + mysql and postgres, optimized 
-for pentium-m and for space
+for pentium-m and for space (saves both the build options and the module 
+ list)
 
 
 make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os
 make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os
 make all
 make all
@@ -309,7 +320,7 @@ Make targets:
 
 
 Configure:
 Configure:
 
 
-make cfg or make config (force config regeneration and store it in config.mak)
+make cfg or make config (force config and module list regeneration)
 
 
 Example: make cfg include_modules=mysql mode=debug  (all future make 
 Example: make cfg include_modules=mysql mode=debug  (all future make 
 invocations will include the mysql module and will build in debug mode)
 invocations will include the mysql module and will build in debug mode)
@@ -318,16 +329,24 @@ Note: if config.mak doesn't exist (e.g. initial checkout or after a make
 proper) or if Makefile.defs was changed, the config will be re-generated
 proper) or if Makefile.defs was changed, the config will be re-generated
 automatically by the first make command. For example:
 automatically by the first make command. For example:
  make cfg  include_modules=mysql; make all is equivalent to 
  make cfg  include_modules=mysql; make all is equivalent to 
- rm config.mak; make include_modules=mysql.
+ rm config.mak modules.lst; make include_modules=mysql.
+
+make cfg-defs  (force config regeneration, but don't touch the module list)
+
+Example: make cfg-defs CPU=ultrasparc CC_EXTRA_OPTS=-Os PROFILE=-pg
 
 
+make modules-cfg or
+make modules-list    (saves the module list, without regenerating the 
+                       build config)
+Example: make modules-list include_modules="tls" skip_modules="print"
 
 
 Clean:
 Clean:
 
 
 make clean   (clean the modules too)
 make clean   (clean the modules too)
 make proper  (clean also the dependencies and the config)
 make proper  (clean also the dependencies and the config)
 make distclean (the same as proper)
 make distclean (the same as proper)
-make mantainer-clean (clean everything, including make's config, auto 
- generated files, tags, *.dbg a.s.o)
+make mantainer-clean (clean everything, including make's config, saved 
+  module list, auto generated files, tags, *.dbg a.s.o)
 make clean-all (clean all the modules in modules/*)
 make clean-all (clean all the modules in modules/*)
 make proper-all (like make proper but for all the  modules in modules/*)
 make proper-all (like make proper but for all the  modules in modules/*)
 
 

+ 40 - 18
Makefile

@@ -50,6 +50,11 @@
 #  2008-06-25  make cfg support (use a pre-built cfg.: config.mak) (andrei)
 #  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 
 #  2008-06-28  added clean-all, proper-all, install-modules-man and error 
 #               checks for install-utils & doc (andrei)
 #               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=lex.yy.c cfg.tab.c #lexx, yacc etc
 auto_gen_others=cfg.tab.h  # auto generated, non-c
 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
 # 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
 include config.mak
 ifeq ($(makefile_defs),1)
 ifeq ($(makefile_defs),1)
 $(info config.mak loaded)
 $(info config.mak loaded)
@@ -205,7 +210,7 @@ $(info config.mak loaded)
 config_mak=1
 config_mak=1
 endif
 endif
 else
 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 
 # needed here to avoid starting a config submake 
 # (e.g. rm -f config.mak; make config.mak), which would either require 
 # (e.g. rm -f config.mak; make config.mak), which would either require 
 # double Makefile.defs defines execution (suboptimal), would loose
 # double Makefile.defs defines execution (suboptimal), would loose
@@ -215,6 +220,8 @@ $(shell rm -rf config.mak)
 endif
 endif
 endif
 endif
 
 
+include modules.lst
+
 main_makefile=1
 main_makefile=1
 include Makefile.defs
 include Makefile.defs
 
 
@@ -317,10 +324,19 @@ else
 config.mak: Makefile.defs
 config.mak: Makefile.defs
 	@echo making config...
 	@echo making config...
 	@echo "# this file is autogenerated by make cfg" >$@
 	@echo "# this file is autogenerated by make cfg" >$@
-	@echo "# `date`" >>$@
 	@$(call mapf2,cfg_save_var,saved_fixed_vars,$(@))
 	@$(call mapf2,cfg_save_var,saved_fixed_vars,$(@))
 	@$(call mapf2,cfg_save_var2,saved_chg_vars,$(@))
 	@$(call mapf2,cfg_save_var2,saved_chg_vars,$(@))
 	@echo "override makefile_defs:=1" >>$@
 	@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,group_include,$@)
 	@$(call cfg_save_var2,include_modules,$@)
 	@$(call cfg_save_var2,include_modules,$@)
 	@$(call cfg_save_var2,static_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_noinc,$@)
 	@$(call cfg_save_var2,modules,$@)
 	@$(call cfg_save_var2,modules,$@)
 	@echo "modules_configured:=1" >>$@
 	@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
 .PHONY: all
 all: $(NAME) modules
 all: $(NAME) modules
@@ -356,7 +370,7 @@ print-modules:
 	echo The following modules will be made: $(modules_basenames) ; \
 	echo The following modules will be made: $(modules_basenames) ; \
 
 
 .PHONY: modules
 .PHONY: modules
-modules:
+modules: modules.lst
 	@for r in $(modules) "" ; do \
 	@for r in $(modules) "" ; do \
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 			echo  "" ; \
 			echo  "" ; \
@@ -420,6 +434,7 @@ tar:
 		--exclude=libiname.lst \
 		--exclude=libiname.lst \
 		--exclude=makecfg.lst \
 		--exclude=makecfg.lst \
 		--exclude=config.mak \
 		--exclude=config.mak \
+		--exclude=modules.lst \
 		--exclude=*.[do] \
 		--exclude=*.[do] \
 		--exclude=*.so \
 		--exclude=*.so \
 		--exclude=*.il \
 		--exclude=*.il \
@@ -475,7 +490,7 @@ sunpkg:
 	rm -rf tmp/ser_sun_pkg
 	rm -rf tmp/ser_sun_pkg
 
 
 .PHONY: modules-doc
 .PHONY: modules-doc
-modules-doc:
+modules-doc: modules.lst
 	-@for r in $(modules) "" ; do \
 	-@for r in $(modules) "" ; do \
 		if [ -n "$$r" ]; then \
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
@@ -488,7 +503,7 @@ modules-doc:
 modules-readme: README
 modules-readme: README
 
 
 .PHONY: README
 .PHONY: README
-README:
+README: modules.lst
 	-@for r in $(modules) "" ; do \
 	-@for r in $(modules) "" ; do \
 		if [ -n "$$r" ]; then \
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
@@ -505,7 +520,7 @@ README:
 modules-man: man
 modules-man: man
 
 
 .PHONY: man
 .PHONY: man
-man:
+man: modules.lst
 	-@for r in $(modules) "" ; do \
 	-@for r in $(modules) "" ; do \
 		if [ -n "$$r" ]; then \
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
@@ -609,7 +624,7 @@ install-share: $(share_prefix)/$(share_dir)
 		fi ; \
 		fi ; \
 	done; true
 	done; true
 
 
-install-modules: $(modules_prefix)/$(modules_dir)
+install-modules: modules.lst $(modules_prefix)/$(modules_dir)
 	@for r in $(modules) "" ; do \
 	@for r in $(modules) "" ; do \
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
 			echo  "" ; \
 			echo  "" ; \
@@ -676,7 +691,7 @@ install-doc: $(doc_prefix)/$(doc_dir) install-modules-doc
 	$(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
 	$(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 \
 	@for r in $(modules_basenames) "" ; do \
 		if [ -n "$$r" ]; then \
 		if [ -n "$$r" ]; then \
 			if [ -f modules/"$$r"/README ]; then \
 			if [ -f modules/"$$r"/README ]; then \
@@ -738,8 +753,12 @@ clean:	clean_libs
 clean-all: modules=$(modules_all)
 clean-all: modules=$(modules_all)
 clean-all: clean
 clean-all: clean
 
 
+# on make proper clean also the build config (w/o module list)
 proper realclean distclean: clean_cfg 
 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
 .PHONY: proper-all realclean-all distclean-all
 proper-all realclean-all distclean-all: modules=$(modules_all)
 proper-all realclean-all distclean-all: modules=$(modules_all)
 proper-all realclean-all distclean-all: proper
 proper-all realclean-all distclean-all: proper
@@ -749,3 +768,6 @@ proper-all realclean-all distclean-all: proper
 clean_cfg:
 clean_cfg:
 	rm -f config.mak
 	rm -f config.mak
 
 
+.PHONY: clean_modules_cfg clean-modules-cfg
+clean_modules_cfg clean-modules-cfg:
+	rm -f modules.lst

+ 1 - 1
Makefile.cfg

@@ -16,5 +16,5 @@ $(COREPATH)/config.mak: makefile_defs=0
 $(COREPATH)/config.mak: exported_vars=0
 $(COREPATH)/config.mak: exported_vars=0
 
 
 $(COREPATH)/config.mak: $(COREPATH)/Makefile.defs
 $(COREPATH)/config.mak: $(COREPATH)/Makefile.defs
-	$(MAKE) -wC $(COREPATH) cfg
+	$(MAKE) -wC $(COREPATH) cfg-defs
 
 

+ 4 - 3
Makefile.targets

@@ -14,13 +14,14 @@
 #
 #
 
 
 clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
 clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
-				clean-all proper-all distclean-all realclean-all
+				clean-all proper-all distclean-all realclean-all \
+				clean_cfg clean_modules_cfg clean-modules-cfg
 doc_targets:=	modules-doc modules-readme README modules-man man \
 doc_targets:=	modules-doc modules-readme README modules-man man \
 		install-doc install-modules-doc install-man install-ser-man \
 		install-doc install-modules-doc install-man install-ser-man \
 		install-modules-man
 		install-modules-man
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
-aux_targets:=	TAGS tar dist cfg config config.mak print-modules dbg \
-		dbinstall librpath.lst makecfg.lst
+aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
+		dbg dbinstall librpath.lst makecfg.lst modules.lst
 # other targets that don't produce code in the current directory ("external")
 # other targets that don't produce code in the current directory ("external")
 ext_targets:=	modules libs utils \
 ext_targets:=	modules libs utils \
 		install-cfg install-modules install-utils  install-modules-all \
 		install-cfg install-modules install-utils  install-modules-all \