diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-01 12:20:06 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-01 12:20:06 +0100 |
commit | ec1738589a3aa1dd59e476de09ae2721d51b3e6e (patch) | |
tree | 12ce1195b2eee732487a4e89519c4cffb086f8eb | |
parent | 35107038f7c726f5ef8d7ab014ad45c73970e65d (diff) |
Make variable names more regular
-rw-r--r-- | clean.mk | 6 | ||||
-rw-r--r-- | dist.mk | 12 | ||||
-rw-r--r-- | jars.mk | 4 | ||||
-rw-r--r-- | lib.mk | 37 | ||||
-rw-r--r-- | libraries.mk | 8 | ||||
-rw-r--r-- | programs.mk | 8 | ||||
-rw-r--r-- | templates.mk | 4 | ||||
-rw-r--r-- | tests.mk | 6 |
8 files changed, 43 insertions, 42 deletions
@@ -1,10 +1,10 @@ -clean_files := +clean-files := clean: - $(suppress) rm -fv -- $(clean_files) + $(suppress) rm -fv -- $(clean-files) dryclean: - @for i in $(clean_files); do if [ -e $$i ]; then echo $$i; fi; done | sort + @for i in $(clean-files); do if [ -e $$i ]; then echo $$i; fi; done | sort print-top-help += \ echo " clean: Delete generated files"; \ @@ -1,15 +1,15 @@ ifdef PACKAGE_NAME -dist_name = $(PACKAGE_NAME)-$(PACKAGE_VERSION) +dist-name = $(PACKAGE_NAME)-$(PACKAGE_VERSION) -dist_files := +dist-files := -dist: $(dist_name).tar.bz2 +dist: $(dist-name).tar.bz2 -$(dist_name).tar.bz2: $(dist_files) - $(suppress) tar cvfj $@ $(dist_files) --transform 's,^,$(dist_name)/,' +$(dist-name).tar.bz2: $(dist-files) + $(suppress) tar cvfj $@ $(dist-files) --transform 's,^,$(dist-name)/,' -clean_files += $(dist_name).tar.bz2 +clean-files += $(dist-name).tar.bz2 print-top-help += echo " dist: Generate a source distribution"; @@ -22,8 +22,8 @@ define build-jar = install: $$($(1)_INSTALL_PATH) - jars_list += $$($(1)_PATH) + jars-list += $$($(1)_PATH) - clean_files += $$($(1)_PATH) + clean-files += $$($(1)_PATH) endef @@ -6,9 +6,10 @@ default: all # Initialise some variables. -bin_SCRIPTS := -noinst_SCRIPTS := +bin-scripts := +noinst-scripts := man-pages := +install-tests := OS = $(shell uname -s) @@ -64,24 +65,24 @@ define include-sub-makefile = include $(1) endef -$(foreach mf, $(SUBS), $(eval $(call include-sub-makefile, $(mf)))) +$(foreach mf, $(makefiles), $(eval $(call include-sub-makefile, $(mf)))) # Instantiate stuff. -$(foreach lib, $(LIBS), $(eval $(call build-library,$(lib)))) -$(foreach prog, $(PROGRAMS), $(eval $(call build-program,$(prog)))) -$(foreach jar, $(JARS), $(eval $(call build-jar,$(jar)))) -$(foreach script, $(bin_SCRIPTS), $(eval $(call install-program-in,$(script),$(bindir)))) -$(foreach script, $(bin_SCRIPTS), $(eval programs_list += $(script))) -$(foreach script, $(noinst_SCRIPTS), $(eval programs_list += $(script))) -$(foreach template, $(template_files), $(eval $(call instantiate-template,$(template)))) -$(foreach test, $(INSTALL_TESTS), $(eval $(call run-install-test,$(test)))) +$(foreach lib, $(libraries), $(eval $(call build-library,$(lib)))) +$(foreach prog, $(programs), $(eval $(call build-program,$(prog)))) +$(foreach jar, $(jars), $(eval $(call build-jar,$(jar)))) +$(foreach script, $(bin-scripts), $(eval $(call install-program-in,$(script),$(bindir)))) +$(foreach script, $(bin-scripts), $(eval programs-list += $(script))) +$(foreach script, $(noinst-scripts), $(eval programs-list += $(script))) +$(foreach template, $(template-files), $(eval $(call instantiate-template,$(template)))) +$(foreach test, $(install-tests), $(eval $(call run-install-test,$(test)))) $(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file)))))) .PHONY: default all man help -all: $(programs_list) $(libs_list) $(jars_list) $(man-pages) +all: $(programs-list) $(libs-list) $(jars-list) $(man-pages) man: $(man-pages) @@ -94,23 +95,23 @@ ifdef man-pages @echo " man: Generate manual pages" endif @$(print-top-help) -ifdef programs_list +ifdef programs-list @echo "" @echo "The following programs can be built:" @echo "" - @for i in $(programs_list); do echo " $$i"; done + @for i in $(programs-list); do echo " $$i"; done endif -ifdef libs_list +ifdef libs-list @echo "" @echo "The following libraries can be built:" @echo "" - @for i in $(libs_list); do echo " $$i"; done + @for i in $(libs-list); do echo " $$i"; done endif -ifdef jars_list +ifdef jars-list @echo "" @echo "The following JARs can be built:" @echo "" - @for i in $(jars_list); do echo " $$i"; done + @for i in $(jars-list); do echo " $$i"; done endif @echo "" @echo "The following variables control the build:" diff --git a/libraries.mk b/libraries.mk index 461a3e9a6..a6965325a 100644 --- a/libraries.mk +++ b/libraries.mk @@ -1,4 +1,4 @@ -libs_list := +libs-list := ifeq ($(OS), Darwin) SO_EXT = dylib @@ -110,7 +110,7 @@ define build-library = $(1)_DEPS := $$(foreach fn, $$($(1)_OBJS), $$(call filename-to-dep, $$(fn))) -include $$($(1)_DEPS) - libs_list += $$($(1)_PATH) - clean_files += $$(_d)/*.a $$(_d)/*.$(SO_EXT) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS) - dist_files += $$(_srcs) + libs-list += $$($(1)_PATH) + clean-files += $$(_d)/*.a $$(_d)/*.$(SO_EXT) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS) + dist-files += $$(_srcs) endef diff --git a/programs.mk b/programs.mk index 0478e16d0..30539d129 100644 --- a/programs.mk +++ b/programs.mk @@ -1,4 +1,4 @@ -programs_list := +programs-list := # Build a program with symbolic name $(1). The program is defined by # various variables prefixed by ‘$(1)_’: @@ -56,7 +56,7 @@ define build-program = $(1)_DEPS := $$(foreach fn, $$($(1)_OBJS), $$(call filename-to-dep, $$(fn))) -include $$($(1)_DEPS) - programs_list += $$($(1)_PATH) - clean_files += $$($(1)_PATH) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS) - dist_files += $$(_srcs) + programs-list += $$($(1)_PATH) + clean-files += $$($(1)_PATH) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS) + dist-files += $$(_srcs) endef diff --git a/templates.mk b/templates.mk index 82f9d6025..6d7b1034c 100644 --- a/templates.mk +++ b/templates.mk @@ -1,10 +1,10 @@ -template_files := +template-files := # Create the file $(1) from $(1).in by running config.status (which # substitutes all ‘@var@’ variables set by the configure script). define instantiate-template = - clean_files += $(1) + clean-files += $(1) endef @@ -6,15 +6,15 @@ define run-install-test = # Run the test in its own directory to mimick Automake behaviour. $1.run: $1 $(_PREV_TEST) - _installcheck_list += $1 + _installcheck-list += $1 endef installcheck: install - @total=0; failed=0; for i in $(_installcheck_list); do \ + @total=0; failed=0; for i in $(_installcheck-list); do \ total=$$((total + 1)); \ echo "running test $$i"; \ - if (cd $$(dirname $$i) && $(TESTS_ENVIRONMENT) $$(basename $$i)); then \ + if (cd $$(dirname $$i) && $(tests-environment) $$(basename $$i)); then \ echo "PASS: $$i"; \ else \ echo "FAIL: $$i"; \ |