feat: render dags as png images with makefile2graph

main
Ricard Illa 2023-05-19 17:13:46 +02:00
parent f6b37d602a
commit 9c9ba82334
2 changed files with 21 additions and 7 deletions

14
common/render-dag.make Normal file
View File

@ -0,0 +1,14 @@
.PHONY: all clean
all: rendered-dag.png clean
rendered-dag.png: rendered-dag.dot
dot -Tpng $< -o $@
rendered-dag.dot: Makefile
make -Bnd -f $< | make2graph > $@
clean:
rm -f rendered-dag.dot
# vi: ft=make

View File

@ -4,11 +4,11 @@
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = [ pkgs.gnumake ];
};
});
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = [ pkgs.gnumake pkgs.makefile2graph pkgs.graphviz ];
};
});
}