autogenerate map from network info
This commit is contained in:
29
Makefile
29
Makefile
@@ -5,13 +5,29 @@ help: ## Print the help message
|
||||
sort | \
|
||||
column -s ':' -t
|
||||
|
||||
map.txt: map.ge ## Making map.txt
|
||||
grep -v '# unimportant' $< | graph-easy --boxart > $@
|
||||
cat $@
|
||||
########## Network Map ##########
|
||||
|
||||
full_map.txt: map.ge ## Generating full_map.txt with graph-easy
|
||||
graph-easy --boxart < $< > $@
|
||||
cat $@
|
||||
graph_cmd = graph-easy --boxart
|
||||
|
||||
queries = queries authqueries
|
||||
|
||||
query_formats = $(patsubst %, .dbs/%.txt, $(queries))
|
||||
|
||||
.dbs/:
|
||||
mkdir $@
|
||||
|
||||
$(query_formats): .dbs/%.txt: | .dbs/
|
||||
echo "[ {{name}} ] -- $(basename $(@F)) --> [ {{$(basename $(@F))}} ]" > $@
|
||||
|
||||
.PHONY: map
|
||||
map: .dbs/network.txt ## Show a network map
|
||||
$(graph_cmd) < $<
|
||||
|
||||
.dbs/network.txt: network.rec $(query_formats)
|
||||
$(RM) .dbs/network.txt
|
||||
$(foreach relation, $(queries), \
|
||||
recsel $< -t lxc -e "$(relation) != ''" -p name,$(relation) | recfmt -f .dbs/$(relation).txt >> $@ ;\
|
||||
)
|
||||
|
||||
########## Man Pages ##########
|
||||
|
||||
@@ -56,3 +72,4 @@ pages: $(kralmans) $(krovmans) $(setupmans) $(splintmans)
|
||||
|
||||
clean:
|
||||
$(RM) $(kralmans) $(krovmans)
|
||||
$(RM) -r .dbs
|
||||
|
Reference in New Issue
Block a user