better-enums/doc/Makefile
2025-06-07 03:57:30 +09:00

38 lines
751 B
Makefile

toexample = ../example/$(notdir $(1:.md=.cc))
SOURCE_MARKDOWN := $(wildcard tutorial/*.md) $(wildcard demo/*.md)
SOURCE_CXX := $(foreach md,$(SOURCE_MARKDOWN),$(call toexample,$(md)))
.PHONY : html
html :
python3 docs.py
@echo "See html/index.html"
.PHONY : publish
publish : prepare
cp -r html/* ../doc-publish
cd ../doc-publish && git add . && git commit --amend --reset-author && \
git push -f
.PHONY : prepare
prepare : examples web
.PHONY : web
web : examples
python3 docs.py --web
.PHONY : examples
examples : $(SOURCE_CXX)
define EXAMPLE
$(1) : $(2)
python3 transform.py --o-cxx $(1) $(2)
endef
$(foreach md,$(SOURCE_MARKDOWN), \
$(eval $(call EXAMPLE,$(call toexample,$(md)),$(md))))
.PHONY : clean
clean :
rm -rf html