mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 18:09:28 +00:00
Makefile: clean up and add targets
This commit is contained in:
parent
9592a132b7
commit
2462ec2f04
1 changed files with 16 additions and 9 deletions
25
Makefile
25
Makefile
|
|
@ -2,14 +2,22 @@
|
||||||
# template scripts -> final scripts
|
# template scripts -> final scripts
|
||||||
# markdown files -> html files
|
# markdown files -> html files
|
||||||
|
|
||||||
CAPSMAN = $(wildcard *.capsman.rsc)
|
ALL_RSC := $(wildcard *.rsc */*.rsc)
|
||||||
LOCAL = $(wildcard *.local.rsc)
|
GEN_RSC := $(wildcard *.capsman.rsc *.local.rsc *.wifi.rsc)
|
||||||
WIFI = $(wildcard *.wifi.rsc)
|
|
||||||
|
|
||||||
MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md)
|
MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md)
|
||||||
HTML = $(MARKDOWN:.md=.html) style.css
|
HTML := $(MARKDOWN:.md=.html) style.css
|
||||||
|
|
||||||
all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json
|
.PHONY: all checksums docs rsc clean
|
||||||
|
|
||||||
|
all: checksums docs rsc
|
||||||
|
|
||||||
|
checksums: checksums.json
|
||||||
|
|
||||||
|
checksums.json: contrib/checksums.sh $(ALL_RSC)
|
||||||
|
contrib/checksums.sh > $@
|
||||||
|
|
||||||
|
docs: $(HTML)
|
||||||
|
|
||||||
style.css: contrib/general/style.css
|
style.css: contrib/general/style.css
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
@ -17,6 +25,8 @@ style.css: contrib/general/style.css
|
||||||
%.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html
|
%.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html
|
||||||
contrib/html.sh $< > $@
|
contrib/html.sh $< > $@
|
||||||
|
|
||||||
|
rsc: $(GEN_RSC)
|
||||||
|
|
||||||
%.capsman.rsc: %.template.rsc Makefile
|
%.capsman.rsc: %.template.rsc Makefile
|
||||||
sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \
|
sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \
|
||||||
-e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \
|
-e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \
|
||||||
|
|
@ -35,8 +45,5 @@ style.css: contrib/general/style.css
|
||||||
-e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \
|
-e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \
|
||||||
< $< > $@
|
< $< > $@
|
||||||
|
|
||||||
checksums.json: contrib/checksums.sh *.rsc */*.rsc
|
|
||||||
contrib/checksums.sh > $@
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(HTML) checksums.json
|
rm -f $(HTML) checksums.json
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue