Generate convert.py and improve Makefile.
This commit is contained in:
parent
585105b31b
commit
7642838bca
9
Makefile
9
Makefile
@ -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, \" \"); \
|
||||||
|
|||||||
@ -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, \" \"); \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user