Add index + slightly change makefile

This commit is contained in:
Nikifor Kuznetsov 2023-06-09 19:26:09 +03:00
parent 6b2c745440
commit 7e92ae0076
Signed by: thematdev
GPG Key ID: D12878639B090D90
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

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="ru">
<head>
</head>
<body>
Статьи:
<br>
<a href="/page/linear_nt">Линейные алгоритмы в теории чисел</a>
<br>
<a href="/page/quadratic_forms">Квадратичные вычеты и корни по простому модулю</a>
</body>
</html>