From dd71f019de0314f7b3f2ae1e0aa920e49e9f2759 Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Tue, 24 Jun 2025 18:37:57 +0400 Subject: refactor: everything chaged --- GNUmakefile | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 26ca3e9..0d49d96 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,17 +1,25 @@ -MARKDOWN = $(shell find . -name '*.md') -HTML = $(patsubst ./%.md, %.html, $(MARKDOWN)) +MD = $(shell find content/ -name '*.md') +PROPERMD = $(shell scripts/filter_proper_md $(MD)) +HTML = $(patsubst content/%.md, public/%.html, $(PROPERMD)) +STATICASSETS = $(shell find static -type f) +PUBLICASSETS = $(patsubst static/%, public/%, $(STATICASSETS)) -all: $(HTML) +# Calling make is used for making sure that index pages are build first +all: + $(MAKE) -f index_pages.mk + $(MAKE) pages -%.html: %.md build-page - sh build-page $< > $@ +pages: $(HTML) $(PUBLICASSETS) -output/: $(HTML) - echo $? | xargs -n 1 dirname | xargs -I _ mkdir -p $@_ - echo $? | xargs -n 1 | xargs -I _ cp _ $@_ - cp favicon.ico style.css $@ +public/%.html: content/%.md + mkdir -p $$(dirname $@) + scripts/build_page $< > $@ + +$(PUBLICASSETS): public/%: static/% + mkdir -p $$(dirname $@) + cp $< $@ clean: - rm -rf $(HTML) output/ + rm -rf public -.PHONY: all clean +.PHONY: all clean pages -- cgit v1.2.3