# $HeadURL$ $LastChangedRevision$ # Functions define check_var_logical ifeq ($$(origin $(1)),undefined) $$(error $(1): not set) else ifeq ($$($(1)),false) else ifeq ($$($(1)),true) else $$(error $$($(1)): invalid value for $(1)) endif endef # $(foreach ...) outputs its list separated by spaces, as normal. The problem # with this is that even if I embed $(NEWLINE) after each string, there is of # course still a space after the newline. If I then change the newline+space # for a newline, then that just leaves one undesired trailing newline at the # end that results in a double empty line, but we can change that as well. # To make things clearer, I don't put a newline in with the $(foreach ...), # instead I put in the *text* 'NEWLINE_PLACEHOLDER', and then substitute that # out as described. define NEWLINE endef define check_var_against_list ifeq ($$(origin $(1)),undefined) $$(error $(1): not set) $(subst NEWLINE_PLACEHOLDER,,$(subst NEWLINE_PLACEHOLDER ,$(NEWLINE),$(foreach POSSIBLE_VAL,$(2),else ifeq '$$($(1))' '$(POSSIBLE_VAL)'NEWLINE_PLACEHOLDER))) else $$(error $$($(1)): invalid value for $(1)) endif endef define check_var_set ifeq ($$(origin $(1)),undefined) $$(error $(1): not set) endif endef # Variables SHELL = /bin/bash $(eval $(call check_var_set,SITE_CONFIG_DIR)) $(eval $(call check_var_set,PCMS_SHARE_PREFIX)) $(eval $(call check_var_set,PCMS_STATE_PREFIX)) OSID = $(shell lsb_release -i -r -s | tr -d '\n' | tr '[A-Z]' '[a-z]') ifndef HOSTNAME HOSTNAME = $(shell uname -n) endif # Make makes facilities; facilities require methods. Therefore # this one rule (which is also first and therefore default) should # be enough. ifeq ($(PCMS_PASS_NUM),1) all: clean: else ifeq ($(PCMS_PASS_NUM),0) all: all.facility touch $@ all.facility: touch $@ clean: clean.facility clean.facility: $(RM) *.facility endif %.copied: msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) error "$@: .copied targets are obsolete (hint: change .copied to .copy)" %.installed: msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) error "$@: .installed targets are obsolete (hint: change .installed to .install)" %.configured: msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) error "$@: .configured targets are obsolete (hint: change .configured to .configure)" # A recipe that deliberately does not create its target, thus ensuring # that anything that depends on it will have its recipe run. force-execution-each-time: # Includes include $(PCMS_STATE_PREFIX)/makefiles/facility-local.mk # Path stripped, so that include searches directories specified with -I options # *in order*, allowing host-specific versions of the makefiles to be provided. include $(notdir $(wildcard $(SITE_CONFIG_DIR)/makefiles/facilities/facility-*.mk)) .SUFFIXES: