#-*- makefile -*- # # file: Makefile.site (split from Makefile) # project: homepage # purpose: Makefile for the whole site # created: pasha jul 22 2000 # modified: pasha may 1 2008 # modification: split to Makefile.site and Makefile # MAKEFILE := $(TOP_BUILD)/Makefile.site# this Makefile ################ needed for $(RULES_MAKEFILE)'s ############# export SRC := $(subst $(TOP_BUILD),$(TOP_SRC),$(CURDIR)) export TARGET := $(subst $(TOP_SRC),$(TOP_TARGET),$(SRC)) ############################################################# -include ./specials BUILD_LIST_TARGETS := $(wildcard ./build_list_targets) ifeq ($(BUILD_LIST_TARGETS), ) BUILD_LIST_TARGETS := $(TOP_BUILD)/build_list_targets endif TARGETS := $(strip $(shell $(BUILD_LIST_TARGETS) \ --src=$(SRC) --target=$(TARGET) --rules=$(RULES_MAKEFILE))) # default target - build the whole site # note that here and below we run make with -r option to supress built-oin rules # (to avoid make to try to run lex on files like math/bib/y/yu.l and such) site: ifeq ($(TARGETS), ) @echo Makefile: no targets. bye. @exit 1 endif $(MAKE) -r -f $(RULES_MAKEFILE) $(TARGETS) # build a separate file (assuming it is not in special dir) $(TOP_TARGET)/%: FORCE $(MAKE) -r -f $(RULES_MAKEFILE) $@ # even if $(SPECIAL_DIRS) is empty, the following will do no harm $(SPECIAL_DIRS): $(MAKE) -r -C $@ -f $(MAKEFILE) clean: ifeq ($(TARGETS), ) @echo @echo "\$$(TARGETS) is empty! to prevent nuking all target tree, bailing out." @exit 1 endif $(TOP_BUILD)/clean_target_tree --src=$(SRC) --target=$(TARGET) $(TARGETS) site: clean $(SPECIAL_DIRS) .PHONY: site clean FORCE $(SPECIAL_DIRS) # end of Makefile.site