From: Michael D. Lowis Date: Thu, 31 Jan 2019 04:30:24 +0000 (-0500) Subject: refactored header generation X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=71326bbea3a2fb5061150593fb96efc2269ff156;p=proto%2Facc.git refactored header generation --- diff --git a/acc b/acc index d632baf..c541c89 100755 --- a/acc +++ b/acc @@ -23,14 +23,15 @@ done # generate the autolib include file gendir="/tmp/$USER" genfile="autolib.h" +genmacro="#define AUTOLIB(n) static int __autolib_##n = 1" if [[ ! -f "$gendir/$genfile" ]]; then mkdir -p "$gendir" - printf '%s' "#define AUTOLIB(n) int __autolib_##n = 1" > "/tmp/$USER/autobuild.h" + printf '%s' "$genmacro" > "$gendir/$genfile" fi # execute the compiler if $compile; then - echo cc -include "$gendir/$genfile" "$@" + cc -include "$gendir/$genfile" "$@" else echo cc "$@" fi