From 98340e2ddf76a50b7341444a161362b1d01beb22 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Wed, 27 Mar 2024 17:10:05 +0000 Subject: add watch to makefile --- flake.nix | 2 +- thesis/.gitignore | 1 + thesis/Makefile | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 0e004b6..2a82889 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ pkgs.just # command runner pkgs.biber # bibliography backend - pkgs.gnuplot + pkgs.inotify-tools pkgs.livebook # datavis # god is dead diff --git a/thesis/.gitignore b/thesis/.gitignore index de0fdb7..4e69c31 100644 --- a/thesis/.gitignore +++ b/thesis/.gitignore @@ -1,2 +1,3 @@ main.pdf assets/*.png +main.out diff --git a/thesis/Makefile b/thesis/Makefile index 3725d61..f81b59b 100644 --- a/thesis/Makefile +++ b/thesis/Makefile @@ -1,4 +1,4 @@ -graphs := assets/insert.png assets/contains.png +graphs := $(patsubst %.json,%.png,$(wildcard assets/*.json)) default: main.pdf @@ -6,9 +6,15 @@ main.pdf: $(graphs) $(shell find . -iname '*.tex') biblio.bib latexmk -pdf $(graphs): assets/%.png: assets/${subst png,json,%}.json - vl2png ${subst png,json,$@} $@ + vl2png -s 2 ${subst png,json,$@} $@ -.PHONY: clean +.PHONY: clean watch clean: latexmk -c rm -f assets/*.png + +watch: + while true; do \ + $(MAKE) $(WATCHMAKE); \ + inotifywait -qre close_write .; \ + done -- cgit v1.2.3