make network map depending on what is installed

This commit is contained in:
Malin Freeborn 2025-03-31 22:25:51 +02:00
parent b872a25cc0
commit 2624425727
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

View File

@ -17,6 +17,8 @@ check: ## Check you have all dependencies
########## Network Map ##########
graph_program != type graph-easy > /dev/null && printf graph-easy || printf dot
graph_cmd = graph-easy --boxart
queries = queries authqueries
@ -36,8 +38,18 @@ $(query_formats): .dbs/%.txt: | .dbs/
$(dotquery_formats): .dbs/%.dot: | .dbs/
echo '{{name}} -> {{$(basename $(@F))}} [ label="$(basename $(@F))" ];' > $@
ifeq ($(graph_program),dot)
map_file = network.png
else
map_file = network.txt
endif
ignored += $(map_file)
.PHONY: map
map: .dbs/network.txt ## Show a network map
map: $(map_file) ## Generate a network map
network.txt: .dbs/network.txt
$(graph_cmd) < $<
.dbs/network.txt: network.rec $(query_formats)
@ -53,10 +65,8 @@ map: .dbs/network.txt ## Show a network map
)
echo '}' >> $@
network.png: .dbs/network.dot $(ignore_file) $(ignore_file)
dot < $< -T png > $@
ignored += network.png
network.png: .dbs/network.dot $(ignore_file)
dot -T png < $< > $@
##########