mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
Makefile: update for extended functionality
This can handle new and multiple markdown files.
This commit is contained in:
parent
bc36fb74c3
commit
e27a4e8f0e
1 changed files with 17 additions and 8 deletions
25
Makefile
25
Makefile
|
@ -1,16 +1,25 @@
|
|||
GENERATE = *.capsman *.local
|
||||
# Makefile to generate data:
|
||||
# template scripts -> final scripts
|
||||
# markdown files -> html files
|
||||
|
||||
all: $(GENERATE) README.html
|
||||
TEMPLATE = $(wildcard *.template)
|
||||
CAPSMAN = $(TEMPLATE:.template=.capsman)
|
||||
LOCAL = $(TEMPLATE:.template=.local)
|
||||
|
||||
README.html: README.md
|
||||
markdown README.md > README.html
|
||||
MARKDOWN = $(wildcard *.md)
|
||||
HTML = $(MARKDOWN:.md=.html)
|
||||
|
||||
%.local: *.template Makefile
|
||||
all: $(CAPSMAN) $(LOCAL) $(HTML)
|
||||
|
||||
%.html: %.md Makefile
|
||||
markdown $< > $@
|
||||
|
||||
%.local: %.template Makefile
|
||||
sed -e '/\/ caps-man/d' -e 's|%PATH%|interface wireless|' -e 's|%TEMPL%|$(suffix $@)|' \
|
||||
-e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \
|
||||
< $(basename $@).template > $@
|
||||
< $< > $@
|
||||
|
||||
%.capsman: *.template Makefile
|
||||
%.capsman: %.template Makefile
|
||||
sed -e '/\/ interface wireless/d' -e 's/%PATH%/caps-man/' -e 's/%TEMPL%/$(suffix $@)/' \
|
||||
-e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \
|
||||
< $(basename $@).template > $@
|
||||
< $< > $@
|
||||
|
|
Loading…
Reference in a new issue