Generate convert.py and improve Makefile.

This commit is contained in:
Oleksandr Kozachuk 2023-09-09 13:22:16 +02:00
parent 585105b31b
commit 7642838bca
3 changed files with 13 additions and 6 deletions

View File

@ -15,20 +15,23 @@ MD_FILES = $(SOURCES:%=$(OUT_DIR)/%.md)
HTML_FILES = $(MD_FILES:.md=.html) HTML_FILES = $(MD_FILES:.md=.html)
# Default target # Default target
all: Makefile $(HTML_FILES) $(OUT_DIR)/learning.html all: Makefile convert.py $(HTML_FILES) $(OUT_DIR)/learning.html
Makefile: $(SRC_DIR)/0026.txt Makefile: $(SRC_DIR)/0026.txt
cmm print -f $< -S | sed "s/ `printf ' /\t/g'`" >$@ cmm print -f $< -S | sed "s/ `printf ' /\t/g'`" >$@
convert.py: $(SRC_DIR)/0003.txt Makefile
cmm print -f $< -S >$@
# Rule to create a markdown file from a source file # Rule to create a markdown file from a source file
$(OUT_DIR)/%.md: $(SRC_DIR)/%.txt $(OUT_DIR)/%.md: $(SRC_DIR)/%.txt
cmm print -f $< -a > $@ cmm print -f $< -a > $@
# Rule to create an HTML file from a markdown file # Rule to create an HTML file from a markdown file
$(OUT_DIR)/%.html: $(OUT_DIR)/%.md $(OUT_DIR)/%.html: $(OUT_DIR)/%.md convert.py
python convert.py $< python convert.py $<
$(OUT_DIR)/learning.html: $(SRC_DIR)/0015.txt $(OUT_DIR)/learning.html: $(SRC_DIR)/0015.txt $(SRC_FILES) Makefile
cmm print -f $< -S | \ cmm print -f $< -S | \
awk "/LINKS_LINE/ { \ awk "/LINKS_LINE/ { \
split(\"$(SOURCES)\", sources, \" \"); \ split(\"$(SOURCES)\", sources, \" \"); \

1
db/.next Normal file
View File

@ -0,0 +1 @@
29

View File

@ -22,20 +22,23 @@ MD_FILES = $(SOURCES:%=$(OUT_DIR)/%.md)
HTML_FILES = $(MD_FILES:.md=.html) HTML_FILES = $(MD_FILES:.md=.html)
# Default target # Default target
all: Makefile $(HTML_FILES) $(OUT_DIR)/learning.html all: Makefile convert.py $(HTML_FILES) $(OUT_DIR)/learning.html
Makefile: $(SRC_DIR)/0026.txt Makefile: $(SRC_DIR)/0026.txt
cmm print -f $< -S | sed "s/ `printf ' /\t/g'`" >$@ cmm print -f $< -S | sed "s/ `printf ' /\t/g'`" >$@
convert.py: $(SRC_DIR)/0003.txt Makefile
cmm print -f $< -S >$@
# Rule to create a markdown file from a source file # Rule to create a markdown file from a source file
$(OUT_DIR)/%.md: $(SRC_DIR)/%.txt $(OUT_DIR)/%.md: $(SRC_DIR)/%.txt
cmm print -f $< -a > $@ cmm print -f $< -a > $@
# Rule to create an HTML file from a markdown file # Rule to create an HTML file from a markdown file
$(OUT_DIR)/%.html: $(OUT_DIR)/%.md $(OUT_DIR)/%.html: $(OUT_DIR)/%.md convert.py
python convert.py $< python convert.py $<
$(OUT_DIR)/learning.html: $(SRC_DIR)/0015.txt $(OUT_DIR)/learning.html: $(SRC_DIR)/0015.txt $(SRC_FILES) Makefile
cmm print -f $< -S | \ cmm print -f $< -S | \
awk "/LINKS_LINE/ { \ awk "/LINKS_LINE/ { \
split(\"$(SOURCES)\", sources, \" \"); \ split(\"$(SOURCES)\", sources, \" \"); \