From 875d015fc4743a457ca504ccf3ef3a9ae26d0eb3 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 30 Sep 2021 19:29:06 +0200 Subject: simplify exp by not using mktemp --- exp/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'exp/Makefile') diff --git a/exp/Makefile b/exp/Makefile index a8f9675..c2e2e3f 100644 --- a/exp/Makefile +++ b/exp/Makefile @@ -4,16 +4,22 @@ REPO_PATH := repo GIT_PATH := git GITC := git -C $(REPO_PATH) +TEMP := temp + .PHONY: all -all: versions - @echo "total size : `awk '{s+=$$1}END{print s}' $<`" - @echo "version count : `wc -l $<`" +all: versions results + @echo "total size : `head --lines=1 results | cut -f1`" + @echo "version count : `wc -l versions`" versions: results grep [0-9]$$ $< | cut -f1 > $@ -results: commits ../dna-backup - ./exp.sh $< $(REPO_PATH) 1| sort -k2 >$@ +results: | $(TEMP) + du -bad 2 $(TEMP) | sort -k2 > $@ + +$(TEMP): commits ../dna-backup + rm -rf $(TEMP) + ./exp.sh $< $(REPO_PATH) $(TEMP) ../dna-backup: .FORCE @$(MAKE) -C .. --no-print-directory dna-backup @@ -30,7 +36,7 @@ repo git: .PHONY: clean clean: - rm -rf $(REPO_PATH) $(GIT_PATH) + rm -rf $(REPO_PATH) $(GIT_PATH) $(TEMP) rm -f commits results versions .FORCE: ; -- cgit v1.2.3