Add index + slightly change makefile

This commit is contained in:
2023-06-09 19:26:09 +03:00
parent 6b2c745440
commit 7e92ae0076
2 changed files with 33 additions and 6 deletions

View File

@@ -2,18 +2,32 @@ DISTDIR ?= $(shell pwd)
TEMPLATE_DIR ?= $(DISTDIR)/templates
SCRIPT_DIR ?= $(DISTDIR)/scripts
BUILDDIR ?= $(DISTDIR)/build
DESTDIR ?= /var/www/wikipages
export
PAGES := $(wildcard pages/*)
PAGE_TARGETS := $(patsubst pages/%,$(BUILDDIR)/page/%,$(wildcard pages/*))
all: $(PAGES) static
all: $(PAGE_TARGETS) $(BUILDDIR)/index.html static
$(PAGES):
$(MAKE) -C $@
$(BUILDDIR)/page/%:
@$(MAKE) -C pages/$*
static:
$(BUILDDIR)/static:
@mkdir -p $(BUILDDIR)
cp -r static $(BUILDDIR)
.PHONY: all $(PAGES) static
$(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