From 9c9ba823343f5057fd8022192ca38f930808666f Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 19 May 2023 17:13:46 +0200 Subject: [PATCH] feat: render dags as png images with makefile2graph --- common/render-dag.make | 14 ++++++++++++++ flake.nix | 14 +++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 common/render-dag.make diff --git a/common/render-dag.make b/common/render-dag.make new file mode 100644 index 0000000..623f07f --- /dev/null +++ b/common/render-dag.make @@ -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 diff --git a/flake.nix b/flake.nix index f994536..4b56a91 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; + }; + }); }