autogenerate map from network info

This commit is contained in:
2025-03-22 14:05:10 +01:00
parent 4b9dae9b3a
commit 12644b80da
2 changed files with 23 additions and 45 deletions

View File

@@ -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