Skip to content

Commit

Permalink
minor improvement to scaffolding_for_c/Makefile-wip.nw
Browse files Browse the repository at this point in the history
  • Loading branch information
ctarbide committed May 28, 2024
1 parent ce9dd16 commit 5e708cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
4 changes: 0 additions & 4 deletions pages/2024/2024-03-27_00h04m58_scaffolding_for_c/Makefile-wip
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

SH = sh -eu

SOURCES = \
Makefile-wip.nw wip.nw

TARGETS = \
wip.c wip

Expand All @@ -24,4 +21,3 @@ wip: \

clean:
-rm -f $(TARGETS)

20 changes: 9 additions & 11 deletions pages/2024/2024-03-27_00h04m58_scaffolding_for_c/Makefile-wip.nw
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ set -eu
SH=${SH:-sh -eu}; export SH
<<function cmd_push_to_argv>>
<<function list_set_sources>>
set -- <<Makefile prefix>>.nw
nofake --error -R'generate build.sh' "$@" | ${SH}
<<gen build.sh>>
eval "set --; `list_set_sources`"
nofake --error -R'generate Makefile' "$@" | ${SH} ><<Makefile prefix>>
@

<<gen build.sh>>=
set -- <<Makefile prefix>>.nw
nofake --error -R'generate build.sh' "$@" | ${SH}
@

<<function cmd_push_to_argv>>=
cmd_push_to_argv(){
normalize-args.sh | perl -lpe'$_=qq{set -- \042\$\@\042 ${_};}' |
Expand Down Expand Up @@ -60,16 +64,10 @@ indent_args(){
indent_args "$@"
@

<<output SH= and SOURCES=>>=
eval "set --; ${set_sources}"
printf -- 'SH = %s\n\nSOURCES = \\\n' "${SH}"
<<indent "$@">>
@

<<output TARGETS=>>=
set --
<<targets>>
printf -- '\nTARGETS = \\\n'
printf -- 'TARGETS = \\\n'
<<indent "$@">>
@

Expand All @@ -96,10 +94,10 @@ SH=${SH:-sh -eu}; export SH
<<function indent_args>>
printf -- '\n# automatically generated from <<Makefile prefix>>.nw\n\n'
set_sources=`list_set_sources`
<<output SH= and SOURCES=>>
printf -- 'SH = %s\n\n' "${SH}"
<<output TARGETS=>>
<<output all:>>
printf -- 'clean:\n\t-rm -f $(TARGETS)\n\n'
printf -- 'clean:\n\t-rm -f $(TARGETS)\n'
@

<<generate build.sh>>=
Expand Down

0 comments on commit 5e708cd

Please sign in to comment.