diff options
| author | Michael Forney <mforney@mforney.org> | 2016-12-10 02:28:10 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-12-10 12:05:02 -0800 |
| commit | b5f11c6c2b89d9cbbff8a81ae666b78ab148aaf0 (patch) | |
| tree | d1afc57977bca6191ba7fb14c93d462b810beb79 | |
| parent | f5b8ae3d94ccc876fd8aa75a8837cae7feccd9da (diff) | |
Add scc git
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | lang/gen.rc | 1 | ||||
| -rw-r--r-- | lang/scc/gen.rc | 48 | ||||
| -rw-r--r-- | lang/scc/rev | 1 | ||||
| m--------- | lang/scc/src | 0 |
5 files changed, 53 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules index 3844ec64..f912de1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -190,6 +190,9 @@ [submodule "lang/mc/src"] path = lang/mc/src url = https://github.com/oridb/mc +[submodule "lang/scc/src"] + path = lang/scc/src + url = git://git.suckless.org/scc [submodule "media/alsa-lib/src"] path = media/alsa-lib/src url = git://git.alsa-project.org/alsa-lib.git diff --git a/lang/gen.rc b/lang/gen.rc index 3572e4ce..de857541 100644 --- a/lang/gen.rc +++ b/lang/gen.rc @@ -1,3 +1,4 @@ subgen lua subgen mc subgen python +subgen scc diff --git a/lang/scc/gen.rc b/lang/scc/gen.rc new file mode 100644 index 00000000..02d6d32a --- /dev/null +++ b/lang/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/lang/scc/rev b/lang/scc/rev new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/lang/scc/rev @@ -0,0 +1 @@ +1 diff --git a/lang/scc/src b/lang/scc/src new file mode 160000 +Subproject 8881c4347b881996dc3070faf7259d460fb22f3 |
