ktyl.dev/makefile

28 lines
794 B
Makefile
Raw Normal View History

2021-09-13 01:06:53 +02:00
SRC_DIR = src
OUT_DIR = site
ROOT_DIR = $(SRC_DIR)/root
2021-09-14 01:30:16 +02:00
INC_HTML = $(SRC_DIR)/inc_html
INC_CSS = $(SRC_DIR)/inc_css
2021-09-13 01:06:53 +02:00
PAGES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.html")
2021-09-14 01:30:16 +02:00
HTML_INCLUDES = $(shell find $(INC_HTML) -name *.html)
2021-09-13 01:06:53 +02:00
HTML_TARGETS = $(PAGES:$(ROOT_DIR)/%.html=$(OUT_DIR)/%.html)
STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css")
2021-09-14 01:30:16 +02:00
CSS_INCLUDES = $(shell find $(INC_CSS) -name *.css)
2021-09-13 01:06:53 +02:00
CSS_TARGETS = $(STYLES:$(ROOT_DIR)/%.css=$(OUT_DIR)/%.css)
run: $(HTML_TARGETS) $(CSS_TARGETS)
$(OUT_DIR)/%.html: $(ROOT_DIR)/%.html $(HTML_INCLUDES)
mkdir -p $(OUT_DIR)
python ppp/ppp.py $< $(HTML_INCLUDES) > $@
2021-09-13 01:06:53 +02:00
2021-09-14 01:30:16 +02:00
$(OUT_DIR)/%.css: $(ROOT_DIR)/%.css $(CSS_INCLUDES)
mkdir -p $(OUT_DIR)
python ppp/ppp.py $< $(CSS_INCLUDES) > $@
2021-09-13 01:06:53 +02:00
clean:
rm -r $(OUT_DIR)