diff options
| author | Michael Forney <mforney@mforney.org> | 2016-12-29 21:15:25 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-12-29 23:29:18 -0800 |
| commit | 8fd1326a9ae8bbdd23de9ec772fd18831d134bd7 (patch) | |
| tree | 95bbcf17380572683fc60f1563e65a8f68a3a8f7 /pkg | |
| parent | 3089cd112c5489abd6a5da715395da28db5fcc4c (diff) | |
scc: Fix multiple archs
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/scc/.gitignore | 2 | ||||
| -rw-r--r-- | pkg/scc/gen.rc | 43 |
2 files changed, 23 insertions, 22 deletions
diff --git a/pkg/scc/.gitignore b/pkg/scc/.gitignore new file mode 100644 index 00000000..560e0ccd --- /dev/null +++ b/pkg/scc/.gitignore @@ -0,0 +1,2 @@ +/amd64-sysv.ninja +/qbe.ninja diff --git a/pkg/scc/gen.rc b/pkg/scc/gen.rc index f1aa8853..c698d9c5 100644 --- a/pkg/scc/gen.rc +++ b/pkg/scc/gen.rc @@ -12,37 +12,36 @@ lib libcc.a lib/^(debug.c die.c newitem.c xcalloc.c xmalloc.c xrealloc.c xstrdup build '$outdir'/lib/error.h awk '$srcdir'/cc2/cc2.h '|' '$srcdir'/cc2/generror.awk ; with\ expr '-f $srcdir/cc2/generror.awk' - set baseoutdir '$outdir' -set basecflags '$cflags' hdrs=() for(arch in $archs) { - set outdir '$baseoutdir'/$arch - set cflags '$basecflags -D ARCH=''"'$arch^'"''' - - exe cc1-$arch cc1/^(\ - types.c decl.c lex.c error.c symbol.c main.c expr.c\ - code.c stmt.c cpp.c fold.c init.c arch/$arch/arch.c\ - ) '$baseoutdir'/libcc.a - file libexec/scc/cc1-$arch '$outdir'/cc1-$arch 755 - - exe cc2-$arch -d '$baseoutdir'/lib/error.h cc2/^(\ - main.c parser.c peep.c symbol.c node.c code.c optm.c\ - arch/$arch/^(code.c cgen.c types.c optm.c)\ - ) '$baseoutdir'/libcc.a - file libexec/scc/cc2-$arch '$outdir'/cc2-$arch 755 - - if(~ $arch $archs(1)) { - exe scc driver/posix/scc.c '$baseoutdir'/libcc.a - file bin/scc '$outdir'/scc 755 - } + { + set outdir '$outdir'/$arch + cflags -D 'ARCH=''"'^$arch^'"''' + + exe cc1-$arch cc1/^(\ + types.c decl.c lex.c error.c symbol.c main.c expr.c\ + code.c stmt.c cpp.c fold.c init.c arch/$arch/arch.c\ + ) '$baseoutdir'/libcc.a + file libexec/scc/cc1-$arch '$outdir'/cc1-$arch 755 + + exe cc2-$arch -d '$baseoutdir'/lib/error.h cc2/^(\ + main.c parser.c peep.c symbol.c node.c code.c optm.c\ + arch/$arch/^(code.c cgen.c types.c optm.c)\ + ) '$baseoutdir'/libcc.a + file libexec/scc/cc2-$arch '$outdir'/cc2-$arch 755 + } >$arch.ninja ; subninja $arch.ninja hdrs=($hdrs $arch/^(assert.h ctype.h errno.h signal.h stdint.h stdio.h stdlib.h string.h)) } + +cflags -D 'ARCH=''"'^$archs(1)^'"''' +exe scc driver/posix/scc.c libcc.a +file bin/scc '$outdir'/scc 755 + if(~ amd64-sysv $archs) hdrs=($hdrs amd64-sysv/stdarg.h) for(hdr in $hdrs) file include/scc/arch/$hdr '$srcdir'/libc/include/$hdr 644 -set outdir '$baseoutdir' fetch git |
