From 293f5a93b77d92fd65db7f3d0df654f102e46cfb Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 11 Dec 2016 16:04:20 -0800 Subject: 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 --- pkg/scc/gen.rc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ pkg/scc/rev | 1 + pkg/scc/src | 1 + 3 files changed, 50 insertions(+) create mode 100644 pkg/scc/gen.rc create mode 100644 pkg/scc/rev create mode 160000 pkg/scc/src (limited to 'pkg/scc') 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 index 00000000..8881c434 --- /dev/null +++ b/pkg/scc/src @@ -0,0 +1 @@ +Subproject commit 8881c4347b881996dc3070faf7259d460fb22f38 -- cgit v1.2.3