diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-10-25 14:48:36 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-10-25 14:48:36 +0200 |
commit | c772b8b1ec4c835c20630471a9e1208eb98adc55 (patch) | |
tree | 55b7ed575179f9339a65d5aab3b20f4dc146ce0d /exp | |
parent | 71b9fc3fad0d7b8e551bb925e340c53a06e3afe8 (diff) | |
download | dna-backup-c772b8b1ec4c835c20630471a9e1208eb98adc55.tar.gz dna-backup-c772b8b1ec4c835c20630471a9e1208eb98adc55.zip |
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
Diffstat (limited to 'exp')
-rw-r--r-- | exp/Makefile | 27 |
1 files changed, 20 insertions, 7 deletions
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: ; |