summaryrefslogtreecommitdiff
path: root/pkg/scc
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-12-11 16:04:20 -0800
committerMichael Forney <mforney@mforney.org>2016-12-13 23:10:30 -0800
commit293f5a93b77d92fd65db7f3d0df654f102e46cfb (patch)
tree6ecd1170e3dd793862dd852814dc1b4cd5e44260 /pkg/scc
parent9a506a6834df01a26795cea222b410f206efa9fa (diff)
Move to flat package hierarchy
Note to self: never try to move submodules again To migrate your existing submodules (more or less): set -x set -e mkdir .git/modules/pkg for old in */*/src ; do new="pkg/${old#*/}" if ! [ -f "$old/.git" ] || [ "${old%%/*}" = pkg ] ; then continue fi git -C ".git/modules/$old" config core.worktree "../../../../../$new" rmdir "$new" mv "$old" "$new" sed -e "s,$old,$new," "$new/.git" > "$new/.git.tmp" mv "$new/.git.tmp" "$new/.git" mkdir ".git/modules/${new%/src}" mv ".git/modules/$old" ".git/modules/$new" rm "${old%/src}"/*.ninja mv "${old%/src}"/*.tar.{gz,xz,bz2} "${new%/src}/" rmdir "${old%/src}" || true done sed -e 's,^\[submodule "[^/]*/,[submodule "pkg/,' .git/config > .git/config.tmp mv .git/config.tmp .git/config
Diffstat (limited to 'pkg/scc')
-rw-r--r--pkg/scc/gen.rc48
-rw-r--r--pkg/scc/rev1
m---------pkg/scc/src0
3 files changed, 49 insertions, 0 deletions
diff --git a/pkg/scc/gen.rc b/pkg/scc/gen.rc
new file mode 100644
index 00000000..02d6d32a
--- /dev/null
+++ b/pkg/scc/gen.rc
@@ -0,0 +1,48 @@
+archs=(qbe amd64-sysv)
+std=c99
+cflags\
+ '-std=c99' \
+ -D 'PREFIX=' \
+ -D NDEBUG\
+ -I '$srcdir'/inc/$std\
+ -I '$outdir'/lib
+
+lib libcc.a lib/^(debug.c die.c newitem.c xcalloc.c xmalloc.c xrealloc.c xstrdup.c)
+
+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
+ }
+
+ hdrs=($hdrs $arch/^(assert.h ctype.h errno.h signal.h stdio.h stdlib.h string.h))
+}
+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
diff --git a/pkg/scc/rev b/pkg/scc/rev
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/pkg/scc/rev
@@ -0,0 +1 @@
+1
diff --git a/pkg/scc/src b/pkg/scc/src
new file mode 160000
+Subproject 8881c4347b881996dc3070faf7259d460fb22f3