From c772b8b1ec4c835c20630471a9e1208eb98adc55 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 25 Oct 2021 14:48:36 +0200 Subject: generate LaTeX tables summary from ext and input it in pdf using LC_NUMERIC=fr_FR.UTF-8 we get space separated thousands, but the separator is an unicode charracter so we must declare it in the LaTeX header. The full tables will be generated later --- exp/Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'exp') diff --git a/exp/Makefile b/exp/Makefile index b7511fd..673b1b0 100644 --- a/exp/Makefile +++ b/exp/Makefile @@ -47,17 +47,18 @@ export REPO_PATH ?= repo export GIT_PATH ?= $(abspath git) GITC := git -C $(REPO_PATH) +SPACE := $() $() DNADIRS := $(DNA_4K) $(DNA_8K) DNAEXPORT := $(DNADIRS:%=%_export) DATADIRS := $(DNADIRS) $(DNAEXPORT) $(DIFFS) $(NOPACK) $(BORG) $(TARGZ) $(REAL) SIZEFILES := $(DATADIRS:%=%.size) +SUMMARY := summary.$(RANGE).$(MAX_VERSION) .PHONY: all exp -all exp: summary.csv $(SIZEFILES) +all exp: $(SUMMARY).csv $(SUMMARY).tex $(SIZEFILES) @echo "=============== SUMMARY ===============" - @head -n 1 $< | while IFS="," read -r $(DATADIRS); do \ - printf "$(DATADIRS:%=\%13s)\n" $(DATADIRS:%=$$%); \ - done + @IFS="," read -r $(DATADIRS) < $<; \ + printf "$(DATADIRS:%=\%13s)\n" $(DATADIRS:%=$$%) @tail -n +2 $< | while IFS="," read -r $(DATADIRS); do \ printf "$(DATADIRS:%=\%'13d)\n" $(DATADIRS:%=$$%); \ done @@ -67,7 +68,19 @@ all exp: summary.csv $(SIZEFILES) done @echo -summary.csv: $(SIZEFILES) +summary.%.tex: LC_NUMERIC=fr_FR.UTF-8 +summary.%.tex: summary.%.csv + rm -f $@ + tail -n +2 $< | while IFS="," read -r $(DATADIRS); do \ + printf "$(subst $(SPACE), & ,$(DATADIRS:%=\%'d)) " $(DATADIRS:%=$$%) >> $@;\ + echo '\\' >> $@; \ + done + echo '\hline' >> $@ + for i in $(SIZEFILES); do cat $$i | paste -sd+ | bc; done | xargs printf "$(subst $(SPACE), & ,$(DATADIRS:%=\%'d)) " >> $@; \ + echo '\\' >> $@ + + +summary.%.csv: $(SIZEFILES) echo $(DATADIRS) | tr ' ' ',' > $@ paste -d "," $^ >> $@ @@ -162,13 +175,13 @@ repo git &: .PHONY: clean clean: mostlyclean rm -rf $(REPO_PATH) $(GIT_PATH) - rm -f commits + rm -f summary.*.csv commits mostlyclean: resultsclean rm -rf $(DATADIRS) $(DATADIRS:%=%.versions) rm -f run $(DATADIRS:%=%.results) $(DNA_PARAMS) commits.* resultsclean: - rm -f summary.csv $(SIZEFILES) + rm -f $(SIZEFILES) .FORCE: ; -- cgit v1.2.3