DISTDIR ?= $(shell pwd) TEMPLATE_DIR ?= $(DISTDIR)/templates SCRIPT_DIR ?= $(DISTDIR)/scripts BUILDDIR ?= $(DISTDIR)/build DESTDIR ?= /var/www/wikipages export PAGE_TARGETS := $(patsubst pages/%,$(BUILDDIR)/page/%,$(wildcard pages/*)) all: $(PAGE_TARGETS) $(BUILDDIR)/index.html $(BUILDDIR)/static $(BUILDDIR)/page/%: @$(MAKE) -C pages/$* $(BUILDDIR)/static: @mkdir -p $(BUILDDIR) cp -r static $(BUILDDIR) $(BUILDDIR)/index.html: cp index.html $(BUILDDIR) clean: rm -rfI $(BUILDDIR)/ install: @mkdir -p $(DESTDIR) cp -r -T $(BUILDDIR)/ $(DESTDIR)/ uninstall: rm -rfI $(DESTDIR)/ .PHONY: all clean install uninstall