]> git.mdlowis.com Git - proto/acc.git/commitdiff
refactored header generation
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Jan 2019 04:30:24 +0000 (23:30 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Jan 2019 04:30:24 +0000 (23:30 -0500)
acc

diff --git a/acc b/acc
index d632baf5461494b2d927d158f3d9a12256650f4b..c541c898f575a999b214bc6e6d3afee190123620 100755 (executable)
--- 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