moin_utils/Makefile

37 lines
849 B
Makefile

PYTHON = python3
DIR = $(CURDIR)
WIKIOUTDIR = $(DIR)/wiki
MDOUTDIR = $(DIR)/md
OLDDIR = $(DIR)/oldwiki
.PHONY: default clean clean_md clean_wiki \
export initial_cleanup final_cleanup \
convert all
default:
echo "Moin export and convert -- read Makefile for more details"
clean: clean_md clean_wiki
clean_md:
rm -rf $(MDOUTDIR)
clean_wiki:
rm -rf $(WIKIOUTDIR)
export: moin_export.py
mkdir $(WIKIOUTDIR) &> /dev/null || true
$(PYTHON) moin_export.py $(OLDDIR) $(WIKIOUTDIR)
initial_cleanup: wiki_cleanup.py
$(PYTHON) wiki_cleanup.py $(WIKIOUTDIR)
final_cleanup: md_cleanup.py
$(PYTHON) md_cleanup.py $(MDOUTDIR)
convert: convert_markdown.py
mkdir $(MDOUTDIR) &> /dev/null || true
$(PYTHON) convert_markdown.py $(WIKIOUTDIR) $(MDOUTDIR)
all: clean export initial_cleanup convert final_cleanup