Des menus dans votre terminal - retour accueil
git clone git://bebou.netlib.re/zenu
Log | Files | Refs |
commit 2e83620543e844bb24ede340536e8b18a379d7e9 parent 36dcfa7025c9549c2123102174c57a1d9fce4d93 Auterice: mc <mc@unistra.fr> Date: Wed, 10 May 2023 07:50:53 +0200 make from=source to=dest when source and dest are directories so a same makefile can handle multiple menus. Diffstat:
M | bin/build | | | 2 | +- |
M | makefile | | | 24 | +++++++++++++----------- |
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/bin/build b/bin/build @@ -46,7 +46,7 @@ in (-h|help|--help) usage {line[i++]=$0} (l=length)>m {m=l} END { for (i=0; i<until ; ++i) printf "%-*s\n", m, line[i] } - ' until=$(cat menus/until.txt) + ' until=$(cat $to/until.txt) ;; (*) >& echo "$cmd isn't a valid command" false diff --git a/makefile b/makefile @@ -1,14 +1,16 @@ -root = menus -menus != find ${root} -type f -not -name '*.*' -face = ${menus:%=%.face} -script = ${menus:%=%.script} -emph = ${menus:%=%.emph} -until = ${root}/until.txt +from = menus +to = ${from} +menus != find ${from} -mindepth 1 -type f -not -name '*.*' +export from to + +face = ${menus:${from}/%=${to}/%.face} +script = ${menus:${from}/%=${to}/%.script} +emph = ${menus:${from}/%=${to}/%.emph} +until = ${to}/until.txt all: ${until} ${script} ${emph} -%.face : % ; bin/build -f $< > $@ -%.script : % ${until} ; bin/build -s $< > $@ -%.emph : % ${until} ; bin/build -e $< > $@ -${until} : ${face} ; wc $? | awk 'n>m{m=n}{n=$$1}END{print m}' > $@ -clean:; rm -rf ${root}/*.* +${to}/%.face : ${from}/% ; bin/build -f $< > $@ +${to}/%.script : ${from}/% ${until} ; bin/build -s $< > $@ +${to}/%.emph : ${from}/% ${until} ; bin/build -e $< > $@ +${until} : ${face} ; wc $? | awk 'n>m{m=n}{n=$$1}END{print m}' > $@