new build: get rid of Go with few rc scripts.

This commit is contained in:
Giacomo Tesio 2021-10-27 10:01:28 +02:00
parent 804b13a4dc
commit 0adf1b0431
274 changed files with 4938 additions and 5214 deletions

View File

@ -1,18 +0,0 @@
{
"buildflags": {
"Cflags": [
"-9",
"-g",
"-gdwarf-2",
"-ggdb",
"-mcmodel=small",
"-O0",
"-Wall",
"-Werror",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas"
]
}
}

37
arch/rc/cmd/build Normal file
View File

@ -0,0 +1,37 @@
#!/cmd/rc
# This script run the rc build scripts passed as arguments
# after moving in their directory.
#
# If passed a directory, it will look for a build script named
# `{basename $PWD}.rc.build and run it instead.
#
# If invoked with no arguments it will assume $PWD as argument
#
# NOTE: this script is run both fron Jehanne and from UNIX during
# cross compilation (through the sh wrapper in hacking/bin/build)
# thus it should not explicitly check $status as exit codes
# work differently in UNIX and Jehanne.
args=$*
if (~ $#args 0)
args=$PWD
for (script in $args){
if (test -d $script){
if (~ $script $JEHANNE){
target=jehanne
}
if not {
target=`{basename $script}
}
rundir=$script
script=$target.rc.build
}
if not {
rundir=`{dirname $script}
script=`{basename $script}
}
echo $rundir/$script
@{cd $rundir; . $JEHANNE/arch/rc/lib/build/utils.rc; cat $script|rc -v -e >[2=1]|sed 's/^/ /'}
}

10
arch/rc/cmd/template Normal file
View File

@ -0,0 +1,10 @@
#!/cmd/rc
# sed -n \
# -e '/#{{/{x; /^$/{x;b}; s/''/''''/g; s/\$[$a-zA-Z0-9()#"]\+[\^]\?/''&''/g; s/^\n/echo ''/ ; s/$/''/; p; x; h; b}' \
# -e H \
# -e '/#}}/{s/#}}//; x; s/#{{//; s/#}}//; p; g}' \
# -e '${x; /^$/{b}; /#}}/!{s/''/''''/g; s/\$[$a-zA-Z0-9()#"]\+[\^]\?/''&''/g; s/^\n/echo ''/ ; s/$/''/; p}}' \
# | rc
sed '/^$/{s//echo/; b}; /^#! /{s/#! //g; b}; /^#! /!{s/''/''''/g; s/\$\(#\|"\)\?[$a-zA-Z0-9_]\+\(([$a-zA-Z0-9#_]\+)\)\?[\^]\?/''&''/g; s/^/echo ''/ ; s/$/''/; b}'

131
arch/rc/lib/build/utils.rc Normal file
View File

@ -0,0 +1,131 @@
# Utility functions designed to simplify build scripts.
#
# They react to environment variables
BUILD_INITIALIZED=true
CFLAGS=( \
-9 \
-g \
-gdwarf-2 \
-ggdb \
'-mcmodel=small' \
-O0 \
-Wall \
-Werror \
-Wno-main \
-Wno-missing-braces \
-Wno-parentheses \
-Wno-unknown-pragmas \
)
KLIB_CFLAGS=( \
-DKERNEL \
-c \
'-mcmodel=kernel' \
-O0 \
-fplan9-extensions \
-ffreestanding \
-fstack-protector-all \
-fno-builtin \
-Wall \
-Wno-missing-braces \
-Wno-parentheses \
-Wno-unknown-pragmas \
-Wuninitialized \
-g \
)
STACKCHECK_CFLAGS=( \
-fstack-check \
-fstack-protector-all \
)
CMD_OFLAGS=( \
-static \
-lavl \
-lcomplete \
-lcontrol \
-ldisk \
-lflate \
-lframe \
-lmemdraw \
-lmemlayer \
-lmemdraw \
-ldraw \
-lplumb \
-lregexp \
-lString \
-l9p \
-lauth \
-lauthsrv \
-lndb \
-lip \
-lsec \
-lauth \
-lmp \
-lthread \
-lbio \
-l9p2000 \
-ljehanne \
)
CC=gcc
CC=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$CC
AR=ar
AR=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$AR
RANLIB=ranlib
RANLIB=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$RANLIB
STRIP=strip
STRIP=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$STRIP
LD=ld
LD=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$LD
OBJCOPY=objcopy
OBJCOPY=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$OBJCOPY
OBJDUMP=objdump
OBJDUMP=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$OBJDUMP
READELF=readelf
READELF=$JEHANNE_TOOLCHAIN/cross/posix/bin/$TOOLPREFIX$READELF
fn debuggable {
# echo $*
eval $*
}
fn prependLibraryName {
LIBRARY_NAME=$1
if ( ! ~ 0 $#LIBRARY_NAME ) {
for (i in *.o) {
# rename object files to ease library merge
debuggable mv $i $LIBRARY_NAME-$i
}
}
}
fn compileCommands {
EXT=$1
DESTINATION=$2
shift 2
LIST=$*
if ( ~ 0 $#LIST ) {
LIST=*.$EXT
}
mkdir -p $DESTINATION
for (f in $LIST) {
BINARY=`{basename $f|sed 's/\.'$EXT'//'}
debuggable $CC $f -o $BINARY -O2 '-std=gnu11' $STACKCHECK_CFLAGS $CFLAGS $CMD_OFLAGS
debuggable mv $BINARY $DESTINATION
}
}
fn safemove {
mkdir -p $*($#*)
mv $*
}

View File

@ -1,13 +0,0 @@
{
"all": {
"Projects": [
"/sys/src/lib/klibs.json",
"/sys/src/lib/libs.json",
"/sys/src/cmd/cmds.json",
"/sys/src/kern/amd64/workhorse.json",
"/sys/src/kern/amd64/",
"/hacking/cross/pkgs/",
"qa/"
]
}
}

@ -1 +1 @@
Subproject commit 6b473cd28f7b778557c8758bdb612fadb54c11bc Subproject commit e6908814ef79cae9a30fcc1504328d6da6e33ee8

9
jehanne.rc.build Normal file
View File

@ -0,0 +1,9 @@
#!/cmd/rc
build sys/src/lib/klibs.rc.build
build sys/src/lib/libs.rc.build
build sys/src/cmd/cmd.rc.build
build sys/src/kern/amd64/workhorse.rc.build
build sys/src/kern/amd64/
@{cd hacking/cross/pkgs/ && ./build.sh >[2=1]|sed 's/^/ /'}
build qa/

View File

@ -1,11 +0,0 @@
{
"RegressionTests": {
"Projects": [
"kern/",
"lib/c/",
"lib/thread/",
"lib/newlib",
"gnu/gcc/"
]
}
}

View File

@ -0,0 +1,3 @@
$i:
$A($i)

View File

@ -0,0 +1,18 @@
#! A=(a b c)
#! PTR=A
#! ASIZE=$#A
#! LDS='$'
Variable '$LDS^PTR' contains: $"PTR
Variable '$LDS^$LDS^PTR' contains: $"$PTR
#! for(v in $A) {
- $v
#! }
size of A: $#A
#! for(i in `{seq $ASIZE}) {
#! cat 010-include.rc.template|template|rc
#! }

10
qa/cmd/rc/010-template.runner Executable file
View File

@ -0,0 +1,10 @@
#!/cmd/rc
runner=$0
test = `{echo $runner|sed 's/.runner//'}
A=(first second third)
PTR=A
OUTPUT=/tmp/template.$pid.output
cat $test.rc.template|template > $OUTPUT
cat $OUTPUT

View File

@ -1,11 +0,0 @@
{
"RegressionTests": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/qa/gnu/gcc",
"SourceFilesCmd": [
"rune.c"
]
}
}

6
qa/gnu/gcc/gcc.rc.build Normal file
View File

@ -0,0 +1,6 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/qa/gnu/gcc
rm -f *.o

View File

@ -1,51 +0,0 @@
{
"RegressionTests": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/qa/kern",
"Post": [
"cp *.rc $JEHANNE/arch/$ARCH/qa/kern/",
"cp *.runner $JEHANNE/arch/$ARCH/qa/kern/"
],
"SourceFilesCmd": [
"alarm.c",
"args.c",
"awake.c",
"awake_note0.c",
"awake_note1.c",
"brk.c",
"broken.c",
"dup.c",
"execl.c",
"float.c",
"fork.c",
"fork_chain.c",
"frexp.c",
"getmainpid.c",
"getpid.c",
"getppid.c",
"iphash.c",
"malloc1GiB.c",
"memoryisolation.c",
"memoryshare.c",
"mixedfloat.c",
"nested_note.c",
"noexecmem.c",
"notify.c",
"nsclone.c",
"nsec.c",
"pipering.c",
"postnote.c",
"psx.c",
"segattach.c",
"sched0.c",
"stop_start.c",
"syscall.c",
"sysstatread.c",
"tsemacquire.c",
"wait_note.c",
"waserror.c"
]
}
}

8
qa/kern/kern.rc.build Normal file
View File

@ -0,0 +1,8 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/qa/kern
cp *.rc $JEHANNE/arch/$ARCH/qa/kern/
cp *.runner $JEHANNE/arch/$ARCH/qa/kern/
rm -f *.o

View File

@ -1,46 +0,0 @@
{
"RegressionTests": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Cflags": [
"-O2",
"-std=gnu11"
],
"Install": "/arch/$ARCH/qa/lib/c",
"Post": [
"cp *.rc $JEHANNE/arch/$ARCH/qa/lib/c/"
],
"SourceFilesCmd": [
"access.c",
"asmscall.c",
"cleanname.c",
"conswrite.c",
"hcube.c",
"lockt.c",
"longjmp.c",
"privates.c",
"privates2.c",
"qlockt0.c",
"qlockt1.c",
"qlockt2.c",
"rlockt0.c",
"rlockt1.c",
"rlockt2.c",
"rsleept0.c",
"rsleept1.c",
"rsleept2.c",
"rwakeup0.c",
"rwakeup1.c",
"sleep.c",
"sleep2.c",
"sqrt.c",
"sysfatal.c",
"va_copy.c",
"vseprint.c",
"wlockt0.c",
"wlockt1.c",
"wlockt2.c"
]
}
}

9
qa/lib/c/c.rc.build Normal file
View File

@ -0,0 +1,9 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/qa/lib/c
cp *.rc $JEHANNE/arch/$ARCH/qa/lib/c/
rm -f *.o

View File

@ -1,138 +0,0 @@
{
"SimplePOSIXTests": {
"Cflags": [
"-g",
"-gdwarf-2",
"-ggdb",
"-mcmodel=small",
"-O0",
"-Wall",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas",
"-fstack-check",
"-fstack-protector-all",
"-O2",
"-std=gnu11"
],
"Install": "/arch/$ARCH/qa/lib/newlib",
"Post": [
"rm -f *.o",
"cp *.runner $JEHANNE/arch/$ARCH/qa/lib/newlib/",
"git clean -xdf ."
],
"Pre": [
"rm -f *.tag.*"
],
"SourceFiles": [
"libposix_customization.c"
],
"SourceFilesCmd": [
"000-hello.c",
"001-hello.c",
"002-atexit.c",
"010-fork.c",
"020-waitpid.c",
"030-pause.c",
"031-setjmp.c",
"040-gettimeofday.c",
"041-env.c",
"050-setsid.c",
"100-files.c",
"101-files.c",
"102-files.c",
"103-files.c",
"104-files-nonblocking.c",
"120-fcntl.c",
"121-fcntl.c",
"200-signals.c",
"201-signals.c",
"202-signals.c",
"203-signals.c",
"204-signals.c",
"205-signals.c",
"206-signals.c",
"207-sigsuspend.c",
"208-sigpending.c",
"209-sigwaitinfo.c",
"210-sigtimedwait.c",
"211-sigtimedwait.c",
"212-sigwait.c",
"213-sigqueue.c",
"214-sigsetjmp.c",
"215-sigprocmask.c"
]
},
"SIGCHLDTests": {
"Cflags": [
"-g",
"-gdwarf-2",
"-ggdb",
"-mcmodel=small",
"-O0",
"-Wall",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas",
"-fstack-check",
"-fstack-protector-all",
"-O2",
"-DWITH_SIGCHLD",
"-std=gnu11"
],
"Install": "/arch/$ARCH/qa/lib/newlib/sigchld",
"Post": [
"rm -f *.o",
"cp *.runner $JEHANNE/arch/$ARCH/qa/lib/newlib/sigchld/",
"git clean -xdf ."
],
"Pre": [
"rm -f *.tag.*"
],
"SourceFiles": [
"libposix_sigchld.c"
],
"SourceFilesCmd": [
"000-hello.c",
"001-hello.c",
"002-atexit.c",
"010-fork.c",
"020-waitpid.c",
"030-pause.c",
"031-setjmp.c",
"040-gettimeofday.c",
"041-env.c",
"050-setsid.c",
"100-files.c",
"101-files.c",
"102-files.c",
"103-files.c",
"104-files-nonblocking.c",
"120-fcntl.c",
"121-fcntl.c",
"200-signals.c",
"201-signals.c",
"202-signals.c",
"203-signals.c",
"204-signals.c",
"205-signals.c",
"206-signals.c",
"207-sigsuspend.c",
"208-sigpending.c",
"209-sigwaitinfo.c",
"210-sigtimedwait.c",
"211-sigtimedwait.c",
"212-sigwait.c",
"213-sigqueue.c",
"214-sigsetjmp.c",
"215-sigprocmask.c"
]
},
"NewlibTestsuite": {
"Projects": [
"testsuite/"
]
}
}

View File

@ -0,0 +1,42 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
TEST=`{ls *.c|grep -v libposix_}
CFLAGS=( \
-g \
-gdwarf-2 \
-ggdb \
-mcmodel=small \
-Wall \
-Wno-main \
-Wno-missing-braces \
-Wno-parentheses \
-Wno-unknown-pragmas \
-O2 \
-std=gnu11 \
)
# test without SIGCHILD emulation
mkdir -p $JEHANNE/arch/$ARCH/qa/lib/newlib/
for (f in $TEST) {
BINARY=`{basename $f|sed 's/\.c//'}
debuggable $CC $f libposix_customization.c -o $BINARY $STACKCHECK_CFLAGS $CFLAGS
debuggable mv $BINARY $JEHANNE/arch/$ARCH/qa/lib/newlib/
}
# test with SIGCHILD emulation
mkdir -p $JEHANNE/arch/$ARCH/qa/lib/newlib/sigchld/
for (f in $TEST) {
BINARY=`{basename $f|sed 's/\.c//'}
debuggable $CC $f libposix_sigchld.c -o $BINARY -DWITH_SIGCHLD $STACKCHECK_CFLAGS $CFLAGS
debuggable mv $BINARY $JEHANNE/arch/$ARCH/qa/lib/newlib/sigchld/
}
rm -f *.o
build testsuite/

View File

@ -1,54 +0,0 @@
{
"NewlibTestsuite": {
"Cflags": [
"-g",
"-gdwarf-2",
"-ggdb",
"-mcmodel=small",
"-O0",
"-Wall",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas",
"-iquote", "/hacking/cross/pkgs/newlib/src/newlib/testsuite/include/",
"-fstack-check",
"-Wno-unused-variable",
"-Wno-format",
"-fstack-protector-all",
"-O2",
"-std=gnu11"
],
"Oflags": [
"-static"
],
"Post": [
"mkdir -p $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite",
"find -type f -perm /a+x -exec cp {} $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite/ \\;",
"cp *.runner $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite/",
"git clean -xdf ."
],
"Pre": [
"cat $JEHANNE/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.wctype/twctype.c|sed 's/0x0967/0x0905/g' > twctype.c",
"rm -f *.tag.*"
],
"SourceFiles": [
"../libposix_customization.c"
],
"SourceFilesCmd": [
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.string/tstring.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.string/memmove1.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.string/memcpy-1.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.string/strcmp-1.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.stdlib/size_max.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.stdlib/atexit.c",
"twctype.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.wctype/tiswctype.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.wctype/twctrans.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.search/hsearchtest.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.locale/UTF-8.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.stdio/nulprintf.c",
"/hacking/cross/pkgs/newlib/src/newlib/testsuite/newlib.stdio/swprintf.c"
]
}
}

View File

@ -0,0 +1,59 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
NEWLIB_TESTSUITE=$JEHANNE/hacking/cross/pkgs/newlib/src/newlib/testsuite/
TARGET_DIR=$JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite
CFLAGS=( \
-g \
-gdwarf-2 \
-ggdb \
'-mcmodel=small' \
-Wall \
-Wno-main \
-Wno-missing-braces \
-Wno-parentheses \
-Wno-unknown-pragmas \
-iquote $NEWLIB_TESTSUITE/include \
-fstack-check \
-Wno-unused-variable \
-Wno-format \
-fstack-protector-all \
-O2 \
'-std=gnu11' \
-static \
)
cat $NEWLIB_TESTSUITE/newlib.wctype/twctype.c|sed 's/0x0967/0x0905/g' > twctype.c
mkdir -p $TARGET_DIR
rm -f *.tag.*
$CC $NEWLIB_TESTSUITE/newlib.string/tstring.c -o tstring ../libposix_customization.c $CFLAGS
mv tstring $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.string/memmove1.c -o memmove1 ../libposix_customization.c $CFLAGS
mv memmove1 $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.string/memcpy-1.c -o memcpy-1 ../libposix_customization.c $CFLAGS
mv memcpy-1 $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.string/strcmp-1.c -o strcmp-1 ../libposix_customization.c $CFLAGS
mv strcmp-1 $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.stdlib/size_max.c -o size_max ../libposix_customization.c $CFLAGS
mv size_max $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.stdlib/atexit.c -o atexit ../libposix_customization.c $CFLAGS
mv atexit $TARGET_DIR
$CC twctype.c -o twctype ../libposix_customization.c $CFLAGS
mv twctype $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.wctype/tiswctype.c -o tiswctype ../libposix_customization.c $CFLAGS
mv tiswctype $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.wctype/twctrans.c -o twctrans ../libposix_customization.c $CFLAGS
mv twctrans $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.search/hsearchtest.c -o hsearchtest ../libposix_customization.c $CFLAGS
mv hsearchtest $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.locale/UTF-8.c -o UTF-8 ../libposix_customization.c $CFLAGS
mv UTF-8 $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.stdio/nulprintf.c -o nulprintf ../libposix_customization.c $CFLAGS
mv nulprintf $TARGET_DIR
$CC $NEWLIB_TESTSUITE/newlib.stdio/swprintf.c -o swprintf ../libposix_customization.c $CFLAGS
mv swprintf $TARGET_DIR
cp *.runner $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite/
git clean -xdf .

View File

@ -1,11 +0,0 @@
{
"RegressionTests": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/qa/lib/thread",
"SourceFilesCmd": [
"thread.c"
]
}
}

View File

@ -0,0 +1,6 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/qa/lib/thread
rm -f *.o

6
qa/qa.rc.build Normal file
View File

@ -0,0 +1,6 @@
#!/cmd/rc
build kern/
build lib/c/
build lib/thread/
build lib/newlib
build gnu/gcc/

View File

@ -0,0 +1,53 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d mpc.y && mv y.tab.c mpc.c && mv y.tab.h mpc.h
rm -f *.tag.*
$CC \
$JEHANNE/sys/src/lib/jehanne/lib9.c \
mpc.c \
'-DYYSIZE_T=size_t' \
-fstack-check \
-fstack-protector-all \
-9 \
-g \
-gdwarf-2 \
-ggdb \
'-mcmodel=small' \
-O0 \
-Wall \
-Werror \
-Wno-main \
-Wno-missing-braces \
-Wno-parentheses \
-Wno-unknown-pragmas \
-static \
-lavl \
-lcomplete \
-lcontrol \
-ldisk \
-lflate \
-lframe \
-lmemdraw \
-lmemlayer \
-lmemdraw \
-ldraw \
-lplumb \
-lregexp \
-lString \
-l9p \
-lauth \
-lauthsrv \
-lndb \
-lip \
-lsec \
-lauth \
-lmp \
-lthread \
-lbio \
-l9p2000 \
-ljehanne \
-o mpc
safemove mpc $JEHANNE/arch/$ARCH/cmd
rm mpc.c mpc.h
rm -f *.o

View File

@ -0,0 +1,33 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
acme.c \
addr.c \
buff.c \
cols.c \
disk.c \
ecmd.c \
edit.c \
elog.c \
exec.c \
file.c \
fsys.c \
look.c \
regx.c \
rows.c \
scrl.c \
text.c \
time.c \
util.c \
wind.c \
xfid.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o acme
safemove acme $JEHANNE/arch/$ARCH/cmd
rm -f *.o
build aux/

View File

@ -0,0 +1,8 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/aux/acme
rm -f *.o
build win/

View File

@ -1,15 +0,0 @@
{
"Cmd": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Projects": [
"win/"
],
"Install": "/arch/$ARCH/aux/acme",
"SourceFilesCmd": [
"mkwnew.c",
"awd.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"win": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/aux/acme/",
"Program": "win",
"SourceFiles": [
"fs.c",
"main.c",
"pipe.c",
"util.c",
"win.c"
]
}
}

View File

@ -0,0 +1,16 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
fs.c \
main.c \
pipe.c \
util.c \
win.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o win
safemove win $JEHANNE/arch/$ARCH/aux/acme
rm -f *.o

View File

@ -1,36 +0,0 @@
{
"acme": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "acme",
"SourceFiles": [
"acme.c",
"addr.c",
"buff.c",
"cols.c",
"disk.c",
"ecmd.c",
"edit.c",
"elog.c",
"exec.c",
"file.c",
"fsys.c",
"look.c",
"regx.c",
"rows.c",
"scrl.c",
"text.c",
"time.c",
"util.c",
"wind.c",
"xfid.c"
]
},
"aux": {
"Projects": [
"aux/"
]
}
}

View File

@ -1,16 +0,0 @@
{
"authsrv": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "authsrv",
"SourceFiles": [
"authsrv.c",
"secureidcheck.c"
]
}
}

View File

@ -1,50 +0,0 @@
{
"Auth": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Projects": [
"lib/libauthcmd.json",
"factotum/",
"secstore/",
"authsrv.json",
"dsa2pub.json",
"dsa2ssh.json",
"guard.srv.json",
"rsa2csr.json",
"rsa2pub.json",
"rsa2ssh.json",
"rsa2x509.json",
"rsafill.json"
],
"SourceFilesCmd": [
"as.c",
"asn12dsa.c",
"asn12rsa.c",
"changeuser.c",
"convkeys.c",
"cron.c",
"debug.c",
"dsagen.c",
"httpauth.c",
"keyfs.c",
"login.c",
"newns.c",
"none.c",
"passwd.c",
"pemdecode.c",
"pemencode.c",
"printnetkey.c",
"readnvram.c",
"rsagen.c",
"uniq.c",
"userpasswd.c",
"warning.c",
"wrkey.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"dsa2pub": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "dsa2pub",
"SourceFiles": [
"dsa2pub.c",
"rsa2any.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"dsa2ssh": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "dsa2ssh",
"SourceFiles": [
"dsa2ssh.c",
"rsa2any.c"
]
}
}

View File

@ -1,27 +0,0 @@
{
"factotum": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Program": "factotum",
"SourceFiles": [
"apop.c",
"chap.c",
"confirm.c",
"ecdsa.c",
"fs.c",
"httpdigest.c",
"log.c",
"p9any.c",
"p9cr.c",
"p9sk1.c",
"pass.c",
"rpc.c",
"rsa.c",
"util.c",
"wep.c",
"wpapsk.c"
]
}
}

View File

@ -0,0 +1,27 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
apop.c \
chap.c \
confirm.c \
ecdsa.c \
fs.c \
httpdigest.c \
log.c \
p9any.c \
p9cr.c \
p9sk1.c \
pass.c \
rpc.c \
rsa.c \
util.c \
wep.c \
wpapsk.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o factotum
safemove factotum $JEHANNE/arch/$ARCH/cmd/auth
rm -f *.o

View File

@ -1,16 +0,0 @@
{
"guard.srv": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "guard.srv",
"SourceFiles": [
"guard.srv.c",
"secureidcheck.c"
]
}
}

View File

@ -1,29 +0,0 @@
{
"libauthcmd": {
"Cflags": [
"-I../"
],
"Include": [
"../../../lib/lib.json"
],
"Library": "libauthcmd.a",
"Install": "./",
"SourceFiles": [
"keyfmt.c",
"netcheck.c",
"okpasswd.c",
"readwrite.c",
"readarg.c",
"readln.c",
"getauthkey.c",
"log.c",
"error.c",
"fs.c",
"rdbio.c",
"querybio.c",
"wrbio.c",
"private.c",
"getexpiration.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"rsa2csr": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "rsa2csr",
"SourceFiles": [
"rsa2csr.c",
"rsa2any.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"rsa2pub": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "rsa2pub",
"SourceFiles": [
"rsa2pub.c",
"rsa2any.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"rsa2ssh": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "rsa2ssh",
"SourceFiles": [
"rsa2ssh.c",
"rsa2any.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"rsa2x509": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "rsa2x509",
"SourceFiles": [
"rsa2x509.c",
"rsa2any.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"rsafill": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/bin/auth/",
"Oflags": [
"lib/libauthcmd.a"
],
"Program": "rsafill",
"SourceFiles": [
"rsafill.c",
"rsa2any.c"
]
}
}

View File

@ -1,13 +0,0 @@
{
"aescbc": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth",
"Program": "aescbc",
"SourceFiles": [
"aescbc.c",
"util.c"
]
}
}

View File

@ -1,21 +0,0 @@
{
"secstore": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Program": "secstore",
"Projects": [
"aescbc.json",
"secstored.json",
"secuser.json"
],
"SourceFiles": [
"pak.c",
"password.c",
"secstore.c",
"SConn.c",
"util.c"
]
}
}

View File

@ -0,0 +1,81 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
pak.c \
password.c \
secstore.c \
SConn.c \
util.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o secstore
safemove secstore $JEHANNE/arch/$ARCH/cmd/auth/
rm -f *.o
rm -f *.tag.*
$CC \
aescbc.c \
util.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o aescbc
safemove aescbc $JEHANNE/arch/$ARCH/cmd/auth/
rm -f *.o
rm -f *.tag.*
$CC \
dirls.c \
pak.c \
password.c \
SConn.c \
secstored.c \
../secureidcheck.c \
util.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o secstored
safemove secstored $JEHANNE/arch/$ARCH/cmd/auth/
rm -f *.o
rm -f *.tag.*
$CC \
pak.c \
password.c \
SConn.c \
secuser.c \
util.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o secuser
safemove secuser $JEHANNE/arch/$ARCH/cmd/auth/
rm -f *.o
{
"secstore": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Program": "secstore",
"Projects": [
"aescbc.json",
"secstored.json",
"secuser.json"
],
"SourceFiles": [
"pak.c",
"password.c",
"secstore.c",
"SConn.c",
"util.c"
]
}
}

View File

@ -1,18 +0,0 @@
{
"secstored": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Program": "secstored",
"SourceFiles": [
"dirls.c",
"pak.c",
"password.c",
"SConn.c",
"secstored.c",
"../secureidcheck.c",
"util.c"
]
}
}

View File

@ -1,16 +0,0 @@
{
"secuser": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/auth/",
"Program": "secuser",
"SourceFiles": [
"pak.c",
"password.c",
"SConn.c",
"secuser.c",
"util.c"
]
}
}

View File

@ -0,0 +1,28 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d awkgram.y && mv y.tab.c awkgram.c
cat maketab.rc.template|template|rc > proctab.c
rm -f *.tag.*
$CC \
re.c \
lex.c \
main.c \
parse.c \
proctab.c \
popen.c \
tran.c \
lib.c \
run.c \
awkgram.c \
'-DYYMALLOC=malloc' \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o awk
safemove awk $JEHANNE/arch/$ARCH/cmd
git clean -xdf ./
rm -f *.o

View File

@ -1,31 +0,0 @@
{
"awk": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Pre": [
"yacc -d awkgram.y && mv y.tab.c awkgram.c",
"go run maketab.go > proctab.c"
],
"Post": [
"git clean -xdf ./"
],
"Cflags": [
"-DYYMALLOC=malloc"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "awk",
"SourceFiles": [
"re.c",
"lex.c",
"main.c",
"parse.c",
"proctab.c",
"popen.c",
"tran.c",
"lib.c",
"run.c",
"awkgram.c"
]
}
}

View File

@ -1,171 +0,0 @@
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name Lucent Technologies or any of
its entities not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/*
* this program makes the table to link function names
* and type indices that is used by execute() in run.c.
* it finds the indices in y.tab.h, produced by yacc.
*/
#include <u.h>
#include <lib9.h>
#include <bio.h>
#include "awk.h"
#include "y.tab.h"
struct xx
{ int token;
char *name;
char *pname;
} proc[] = {
{ PROGRAM, "program", nil },
{ BOR, "boolop", " || " },
{ AND, "boolop", " && " },
{ NOT, "boolop", " !" },
{ NE, "relop", " != " },
{ EQ, "relop", " == " },
{ LE, "relop", " <= " },
{ LT, "relop", " < " },
{ GE, "relop", " >= " },
{ GT, "relop", " > " },
{ ARRAY, "array", nil },
{ INDIRECT, "indirect", "$(" },
{ SUBSTR, "substr", "substr" },
{ SUB, "sub", "sub" },
{ GSUB, "gsub", "gsub" },
{ INDEX, "sindex", "sindex" },
{ SPRINTF, "awksprintf", "sprintf" },
{ ADD, "arith", " + " },
{ MINUS, "arith", " - " },
{ MULT, "arith", " * " },
{ DIVIDE, "arith", " / " },
{ MOD, "arith", " % " },
{ UMINUS, "arith", " -" },
{ POWER, "arith", " **" },
{ PREINCR, "incrdecr", "++" },
{ POSTINCR, "incrdecr", "++" },
{ PREDECR, "incrdecr", "--" },
{ POSTDECR, "incrdecr", "--" },
{ CAT, "cat", " " },
{ PASTAT, "pastat", nil },
{ PASTAT2, "dopa2", nil },
{ MATCH, "matchop", " ~ " },
{ NOTMATCH, "matchop", " !~ " },
{ MATCHFCN, "matchop", "matchop" },
{ INTEST, "intest", "intest" },
{ PRINTF, "awkprintf", "printf" },
{ PRINT, "printstat", "print" },
{ CLOSE, "closefile", "closefile" },
{ DELETE, "awkdelete", "awkdelete" },
{ SPLIT, "split", "split" },
{ ASSIGN, "assign", " = " },
{ ADDEQ, "assign", " += " },
{ SUBEQ, "assign", " -= " },
{ MULTEQ, "assign", " *= " },
{ DIVEQ, "assign", " /= " },
{ MODEQ, "assign", " %= " },
{ POWEQ, "assign", " ^= " },
{ CONDEXPR, "condexpr", " ?: " },
{ IF, "ifstat", "if(" },
{ WHILE, "whilestat", "while(" },
{ FOR, "forstat", "for(" },
{ DO, "dostat", "do" },
{ IN, "instat", "instat" },
{ NEXT, "jump", "next" },
{ NEXTFILE, "jump", "nextfile" },
{ EXIT, "jump", "exit" },
{ BREAK, "jump", "break" },
{ CONTINUE, "jump", "continue" },
{ RETURN, "jump", "ret" },
{ BLTIN, "bltin", "bltin" },
{ CALL, "call", "call" },
{ ARG, "arg", "arg" },
{ VARNF, "getnf", "NF" },
{ GETLINE, "getline", "getline" },
{ 0, "", "" },
};
#define SIZE (LASTTOKEN - FIRSTTOKEN + 1)
char *table[SIZE];
char *names[SIZE];
void main(int _, char** __)
{
struct xx *p;
int i, tok;
Biobuf *fp;
char *buf, *toks[3];
print("#include <u.h>\n");
print("#include <lib9.h>\n");
print("#include <bio.h>\n");
print("#include \"awk.h\"\n");
print("#include \"y.tab.h\"\n\n");
for (i = SIZE; --i >= 0; )
names[i] = "";
if ((fp = Bopen("y.tab.h", OREAD)) == nil) {
fprint(2, "maketab can't open y.tab.h!\n");
exits("can't open y.tab.h");
}
print("static char *printname[%d] = {\n", SIZE);
i = 0;
while ((buf = Brdline(fp, '\n')) != nil) {
buf[Blinelen(fp)-1] = '\0';
tokenize(buf, toks, 3);
if (toks[0] == nil || strcmp("#define", toks[0]) != 0) /* not a valid #define */
continue;
tok = strtol(toks[2], nil, 10);
if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
fprint(2, "maketab funny token %d %s\n", tok, buf);
exits("funny token");
}
names[tok-FIRSTTOKEN] = (char *) malloc(strlen(toks[1])+1);
strcpy(names[tok-FIRSTTOKEN], toks[1]);
print("\t(char *) \"%s\",\t/* %d */\n", toks[1], tok);
i++;
}
print("};\n\n");
for (p=proc; p->token!=0; p++)
table[p->token-FIRSTTOKEN] = p->name;
print("\nCell *(*proctab[%d])(Node **, int) = {\n", SIZE);
for (i=0; i<SIZE; i++)
if (table[i]==0)
print("\tnullproc,\t/* %s */\n", names[i]);
else
print("\t%s,\t/* %s */\n", table[i], names[i]);
print("};\n\n");
print("char *tokname(int n)\n"); /* print a tokname() function */
print("{\n");
print(" static char buf[100];\n\n");
print(" if (n < FIRSTTOKEN || n > LASTTOKEN) {\n");
print(" sprint(buf, \"token %%d\", n);\n");
print(" return buf;\n");
print(" }\n");
print(" return printname[n-FIRSTTOKEN];\n");
print("}\n");
exits(0);
}

View File

@ -1,189 +0,0 @@
/*
* This file is part of Jehanne.
*
* Copyright (C) 2016 Giacomo Tesio <giacomo@tesio.it>
*
* Jehanne is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 of the License.
*
* Jehanne is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* this program makes the table to link function names
* and type indices that is used by execute() in run.c.
* it finds the indices in y.tab.h, produced by yacc.
*/
package main
import (
"bufio"
"log"
"os"
"strings"
"strconv"
"text/template"
)
type Flist struct {
Token string
Name string
Pname string
}
var flist = []Flist {
{ "PROGRAM", "program", "" },
{ "BOR", "boolop", " || " },
{ "AND", "boolop", " && " },
{ "NOT", "boolop", " !" },
{ "NE", "relop", " != " },
{ "EQ", "relop", " == " },
{ "LE", "relop", " <= " },
{ "LT", "relop", " < " },
{ "GE", "relop", " >= " },
{ "GT", "relop", " > " },
{ "ARRAY", "array", "" },
{ "INDIRECT", "indirect", "$(" },
{ "SUBSTR", "substr", "substr" },
{ "SUB", "sub", "sub" },
{ "GSUB", "gsub", "gsub" },
{ "INDEX", "sindex", "sindex" },
{ "SPRINTF", "awksprintf", "sprintf" },
{ "ADD", "arith", " + " },
{ "MINUS", "arith", " - " },
{ "MULT", "arith", " * " },
{ "DIVIDE", "arith", " / " },
{ "MOD", "arith", " % " },
{ "UMINUS", "arith", " -" },
{ "POWER", "arith", " **" },
{ "PREINCR", "incrdecr", "++" },
{ "POSTINCR", "incrdecr", "++" },
{ "PREDECR", "incrdecr", "--" },
{ "POSTDECR", "incrdecr", "--" },
{ "CAT", "cat", " " },
{ "PASTAT", "pastat", "" },
{ "PASTAT2", "dopa2", "" },
{ "MATCH", "matchop", " ~ " },
{ "NOTMATCH", "matchop", " !~ " },
{ "MATCHFCN", "matchop", "matchop" },
{ "INTEST", "intest", "intest" },
{ "PRINTF", "awkprintf", "printf" },
{ "PRINT", "printstat", "print" },
{ "CLOSE", "closefile", "closefile" },
{ "DELETE", "awkdelete", "awkdelete" },
{ "SPLIT", "split", "split" },
{ "ASSIGN", "assign", " = " },
{ "ADDEQ", "assign", " += " },
{ "SUBEQ", "assign", " -= " },
{ "MULTEQ", "assign", " *= " },
{ "DIVEQ", "assign", " /= " },
{ "MODEQ", "assign", " %= " },
{ "POWEQ", "assign", " ^= " },
{ "CONDEXPR", "condexpr", " ?: " },
{ "IF", "ifstat", "if(" },
{ "WHILE", "whilestat", "while(" },
{ "FOR", "forstat", "for(" },
{ "DO", "dostat", "do" },
{ "IN", "instat", "instat" },
{ "NEXT", "jump", "next" },
{ "NEXTFILE", "jump", "nextfile" },
{ "EXIT", "jump", "exit" },
{ "BREAK", "jump", "break" },
{ "CONTINUE", "jump", "continue" },
{ "RETURN", "jump", "ret" },
{ "BLTIN", "bltin", "bltin" },
{ "CALL", "call", "call" },
{ "ARG", "arg", "arg" },
{ "VARNF", "getnf", "NF" },
{ "GETLINE", "getline", "getline" },
{ "", "", "" },
}
type Proctab struct {
Code int
Name string
Func string
}
func getf(token string) Flist {
for i := range flist {
if token == flist[i].Token {
return flist[i]
}
}
return Flist{"","nullproc",""}
}
func main() {
file, err := os.Open("y.tab.h")
if err != nil {
log.Fatal(err)
}
defer file.Close()
proctab := make([]Proctab, 0)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
s := scanner.Text()
if strings.Contains(s, "#define") {
tokens := strings.Split(s, " ");
i, err := strconv.Atoi(tokens[2])
if err == nil {
f := getf(tokens[1])
proctab = append(proctab, Proctab{i, tokens[1], f.Name})
}
}
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
tmpl, err := template.New("proctab.c").Parse(`/* automatically generated by maketab */
#include <u.h>
#include <lib9.h>
#include <bio.h>
#include "awk.h"
#include "y.tab.h"
static char *printname[{{len .}}] = {
{{ range . }} (char *) "{{.Name}}", /* {{.Code}} */
{{ end }}
};
Cell *(*proctab[{{len .}}])(Node **, int) = {
{{ range . }} {{.Func}}, /* {{.Name}} */
{{ end }}
};
char *
tokname(int n)
{
static char buf[100];
if (n < FIRSTTOKEN || n > LASTTOKEN) {
sprint(buf, "token %d", n);
return buf;
}
return printname[n-FIRSTTOKEN];
}
`)
if err != nil {
log.Fatal(err)
}
err = tmpl.Execute(os.Stdout, proctab)
if err != nil {
log.Fatal(err)
}
}

View File

@ -0,0 +1,64 @@
PROGRAM=(program '')
BOR=(boolop ' || ')
AND=(boolop ' && ')
NOT=(boolop ' !')
NE=(relop ' != ')
EQ=(relop ' == ')
LE=(relop ' <= ')
LT=(relop ' < ')
GE=(relop ' >= ')
GT=(relop ' > ')
ARRAY=(array '')
INDIRECT=(indirect '$(')
SUBSTR=(substr 'substr')
SUB=(sub 'sub')
GSUB=(gsub 'gsub')
INDEX=(sindex 'sindex')
SPRINTF=(awksprintf 'sprintf')
ADD=(arith ' + ')
MINUS=(arith ' - ')
MULT=(arith ' * ')
DIVIDE=(arith ' / ')
MOD=(arith ' % ')
UMINUS=(arith ' -')
POWER=(arith ' **')
PREINCR=(incrdecr '++')
POSTINCR=(incrdecr '++')
PREDECR=(incrdecr '--')
POSTDECR=(incrdecr '--')
CAT=(cat ' ')
PASTAT=(pastat '')
PASTAT2=(dopa2 '')
MATCH=(matchop ' ~ ')
NOTMATCH=(matchop ' !~ ')
MATCHFCN=(matchop 'matchop')
INTEST=(intest 'intest')
PRINTF=(awkprintf 'printf')
PRINT=(printstat 'print')
CLOSE=(closefile 'closefile')
DELETE=(awkdelete 'awkdelete')
SPLIT=(split 'split')
ASSIGN=(assign ' = ')
ADDEQ=(assign ' += ')
SUBEQ=(assign ' -= ')
MULTEQ=(assign ' *= ')
DIVEQ=(assign ' /= ')
MODEQ=(assign ' %= ')
POWEQ=(assign ' ^= ')
CONDEXPR=(condexpr ' ?: ')
IF=(ifstat 'if(')
WHILE=(whilestat 'while(')
FOR=(forstat 'for(')
DO=(dostat 'do')
IN=(instat 'instat')
NEXT=(jump 'next')
NEXTFILE=(jump 'nextfile')
EXIT=(jump 'exit')
BREAK=(jump 'break')
CONTINUE=(jump 'continue')
RETURN=(jump 'ret')
BLTIN=(bltin 'bltin')
CALL=(call 'call')
ARG=(arg 'arg')
VARNF=(getnf 'NF')
GETLINE=(getline 'getline')

View File

@ -0,0 +1,40 @@
/* automatically generated by maketab.rc.template */
#include <u.h>
#include <lib9.h>
#include <bio.h>
#include "awk.h"
#include "y.tab.h"
#! rfork e
#! . ./maketab.rc.environment
#! GETNAMES='/#define FIRSTTOKEN/,/#define LASTTOKEN/{s/#define //;s/ [0-9]\+$//g;p}'
#! NAMES=`{cat y.tab.h|sed -n $GETNAMES}
#! GETCODES='/#define FIRSTTOKEN/,/#define LASTTOKEN/{s/#define [A-Z0-9]\+ //;p}'
#! CODES=`{cat y.tab.h|sed -n $GETCODES}
static char *printname[$#NAMES] = {
#! for (token in `{seq $#NAMES}) {
(char *) "$NAMES($token)", /* $CODES($token) */
#! }
};
Cell *(*proctab[$#NAMES])(Node **, int) = {
#! for (token in `{seq $#NAMES}) {
#! PROC=$$NAMES($token)
#! if( ~ 0 $#PROC ) PROC=(nullproc '')
$PROC(1), /* $NAMES($token) */
#! }
};
char *
tokname(int n)
{
static char buf[100];
if (n < FIRSTTOKEN || n > LASTTOKEN) {
sprint(buf, "token %d", n);
return buf;
}
return printname[n-FIRSTTOKEN];
}

View File

@ -1,45 +0,0 @@
{
"Cmd": {
"Include": [
"/arch/$ARCH/include/cflags.json"
],
"Cflags": [
"-fstack-check",
"-fstack-protector-all"
],
"Oflags": [
"-static",
"-lavl",
"-lcomplete",
"-lcontrol",
"-ldisk",
"-lflate",
"-lframe",
"-lmemdraw",
"-lmemlayer",
"-lmemdraw",
"-ldraw",
"-lplumb",
"-lregexp",
"-lString",
"-l9p",
"-lauth",
"-lauthsrv",
"-lndb",
"-lip",
"-lsec",
"-lauth",
"-lmp",
"-lthread",
"-lbio",
"-l9p2000",
"-ljehanne"
],
"Post": [
"rm -f *.o"
],
"Pre": [
"rm -f *.tag.*"
]
}
}

31
sys/src/cmd/cmd.rc.build Normal file
View File

@ -0,0 +1,31 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
mkdir -p $JEHANNE/arch/$ARCH/cmd
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/cmd
rm -f *.o
build FromYacc.rc.build
build acme/
build auth/factotum/
build hmi/
build awk/
build disk/
build dossrv/
build exportfs/
build ip/
build grep/
build hjfs/
build hoc/
build ndb/
build ns/
build rc/
build rio/
build sam/
build samterm/
build sys/
build usb/
build vt/

View File

@ -1,118 +0,0 @@
{
"Cmd": {
"Include": [
"cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"SourceFilesCmd": [
"ascii.c",
"basename.c",
"bind.c",
"cal.c",
"cat.c",
"chgrp.c",
"chmod.c",
"cleanname.c",
"cp.c",
"cpu.c",
"date.c",
"dd.c",
"du.c",
"echo.c",
"ed.c",
"fcp.c",
"field.c",
"flip.c",
"hget.c",
"import.c",
"init.c",
"join.c",
"lock.c",
"look.c",
"ls.c",
"mc.c",
"mkdir.c",
"mntgen.c",
"mount.c",
"mtime.c",
"mv.c",
"netstat.c",
"p.c",
"pipefile.c",
"ps.c",
"pstree.c",
"pwd.c",
"ramfs.c",
"rm.c",
"sed.c",
"seq.c",
"sleep.c",
"sort.c",
"split.c",
"srv.c",
"srvfs.c",
"stats.c",
"tail.c",
"tar.c",
"tee.c",
"test.c",
"time.c",
"touch.c",
"tr.c",
"unicode.c",
"uniq.c",
"unmount.c",
"wc.c",
"xargs.c",
"xd.c"
]
},
"FromYacc": {
"Include": [
"cmd.json"
],
"Pre": [
"yacc -d mpc.y && mv y.tab.c mpc.c && mv y.tab.h mpc.h"
],
"Post": [
"rm mpc.c mpc.h"
],
"Cflags": [
"-DYYSIZE_T=size_t"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "mpc",
"SourceFiles": [
"/sys/src/lib/jehanne/lib9.c",
"mpc.c"
]
},
"Dirs": {
"Include": [
"cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Projects": [
"acme/",
"auth/factotum/",
"hmi/",
"awk/",
"disk/build.json",
"dossrv/",
"exportfs/",
"ip/",
"grep/",
"hjfs/",
"hoc/",
"ndb/",
"ns/",
"rc/",
"rio/",
"sam/",
"samterm/",
"sys/",
"usb/",
"vt/"
]
}
}

View File

@ -1,18 +0,0 @@
{
"disk": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/disk/",
"Projects": [
"prep/prep.json",
"prep/fdisk.json",
"rofs/"
],
"SourceFilesCmd": [
"format.c",
"mkext.c",
"mkfs.c"
]
}
}

View File

@ -0,0 +1,11 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/cmd/disk
rm -f *.o
build rofs/
build prep/fdisk.rc.build
build prep/

View File

@ -1,21 +0,0 @@
{
"fdisk": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/disk",
"Post": [
"rm y.tab.[ch]"
],
"Pre": [
"yacc -d calc.y"
],
"Program": "fdisk",
"SourceFiles": [
"/sys/src/lib/jehanne/lib9.c",
"fdisk.c",
"edit.c",
"y.tab.c"
]
}
}

View File

@ -0,0 +1,17 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d calc.y
rm -f *.tag.*
$CC \
$JEHANNE/sys/src/lib/jehanne/lib9.c \
fdisk.c \
edit.c \
y.tab.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o fdisk
safemove fdisk $JEHANNE/arch/$ARCH/cmd/disk
rm y.tab.[ch]
rm -f *.o

View File

@ -1,21 +0,0 @@
{
"prep": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/disk",
"Post": [
"rm -f y.tab.[ch]"
],
"Pre": [
"yacc -d calc.y"
],
"Program": "prep",
"SourceFiles": [
"/sys/src/lib/jehanne/lib9.c",
"prep.c",
"edit.c",
"y.tab.c"
]
}
}

View File

@ -0,0 +1,17 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d calc.y
rm -f *.tag.*
$CC \
$JEHANNE/sys/src/lib/jehanne/lib9.c \
prep.c \
edit.c \
y.tab.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o prep
safemove prep $JEHANNE/arch/$ARCH/cmd/disk
rm -f y.tab.[ch]
rm -f *.o

View File

@ -1,12 +0,0 @@
{
"rofs": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/disk/",
"SourceFilesCmd": [
"rofs.c",
"mkrofs.c"
]
}
}

View File

@ -0,0 +1,6 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/cmd/disk
rm -f *.o

View File

@ -1,23 +0,0 @@
{
"dossrv": {
"Include": [
"../cmd.json"
],
"Cflags": [
"-fno-aggressive-loop-optimizations",
"-Wno-array-bounds"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "dossrv",
"SourceFiles": [
"xfssrv.c",
"xfile.c",
"dosfs.c",
"dossubs.c",
"iotrack.c",
"lock.c",
"chat.c",
"devio.c"
]
}
}

View File

@ -0,0 +1,21 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
xfssrv.c \
xfile.c \
dosfs.c \
dossubs.c \
iotrack.c \
lock.c \
chat.c \
devio.c \
-fno-aggressive-loop-optimizations \
-Wno-array-bounds \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o dossrv
safemove dossrv $JEHANNE/arch/$ARCH/cmd
rm -f *.o

View File

@ -1,14 +0,0 @@
{
"exportfs": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "exportfs",
"SourceFiles": [
"exportfs.c",
"exportsrv.c",
"pattern.c"
]
}
}

View File

@ -0,0 +1,14 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
exportfs.c \
exportsrv.c \
pattern.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o exportfs
safemove exportfs $JEHANNE/arch/$ARCH/cmd
rm -f *.o

View File

@ -1,22 +0,0 @@
{
"grep": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Post": [
"rm y.tab*"
],
"Pre": [
"yacc -d grep.y"
],
"Program": "grep",
"SourceFiles": [
"/sys/src/lib/jehanne/lib9.c",
"comp.c",
"main.c",
"sub.c",
"y.tab.c"
]
}
}

View File

@ -0,0 +1,18 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d grep.y
rm -f *.tag.*
$CC \
$JEHANNE/sys/src/lib/jehanne/lib9.c \
comp.c \
main.c \
sub.c \
y.tab.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o grep
safemove grep $JEHANNE/arch/$ARCH/cmd
rm y.tab*
rm -f *.o

View File

@ -1,21 +0,0 @@
{
"hjfs": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "hjfs",
"SourceFiles": [
"9p.c",
"auth.c",
"buf.c",
"cons.c",
"conv.c",
"dev.c",
"dump.c",
"fs1.c",
"fs2.c",
"main.c"
]
}
}

View File

@ -0,0 +1,21 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
9p.c \
auth.c \
buf.c \
cons.c \
conv.c \
dev.c \
dump.c \
fs1.c \
fs2.c \
main.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o hjfs
safemove hjfs $JEHANNE/arch/$ARCH/cmd
rm -f *.o

View File

@ -1,19 +0,0 @@
{
"Aux": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"Projects": [
"console/screenconsole.json",
"console/comconsole.json",
"console/pipeconsole.json",
"realemu/realemu.json",
"realemu/loadcom.json",
"vga/"
],
"SourceFilesCmd": [
"mouse.c"
]
}
}

View File

@ -0,0 +1,16 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
$CC \
buffer.c \
comconsole.c \
passthrough.c \
serve9p.c \
utils.c \
-9 \
$CFLAGS \
-static \
-l9p2000 \
-ljehanne \
-o comconsole
safemove comconsole $JEHANNE/arch/$ARCH/cmd/hmi

View File

@ -0,0 +1,16 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
$CC \
buffer.c \
pipeconsole.c \
passthrough.c \
serve9p.c \
utils.c \
-9 \
$CFLAGS \
-static \
-l9p2000 \
-ljehanne \
-o pipeconsole
safemove pipeconsole $JEHANNE/arch/$ARCH/cmd/hmi

View File

@ -0,0 +1,17 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
$CC \
buffer.c \
cga.c \
screenconsole.c \
keyboard.c \
serve9p.c \
utils.c \
-9 \
$CFLAGS \
-static \
-l9p2000 \
-ljehanne \
-o screenconsole
safemove screenconsole $JEHANNE/arch/$ARCH/cmd/hmi

View File

@ -1,24 +0,0 @@
{
"Console": {
"Include": [
"/arch/$ARCH/include/cflags.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"Cflags": [
"-9"
],
"Oflags": [
"-static",
"-l9p2000",
"-ljehanne"
],
"Program": "comconsole",
"SourceFiles": [
"buffer.c",
"comconsole.c",
"passthrough.c",
"serve9p.c",
"utils.c"
]
}
}

View File

@ -0,0 +1,5 @@
#!/cmd/rc
build COMConsole.rc.build
build PipeConsole.rc.build
build ScreenConsole.rc.build

View File

@ -1,24 +0,0 @@
{
"PipeConsole": {
"Include": [
"/arch/$ARCH/include/cflags.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"Cflags": [
"-9"
],
"Oflags": [
"-static",
"-l9p2000",
"-ljehanne"
],
"Program": "pipeconsole",
"SourceFiles": [
"buffer.c",
"pipeconsole.c",
"passthrough.c",
"serve9p.c",
"utils.c"
]
}
}

View File

@ -1,25 +0,0 @@
{
"ScreenConsole": {
"Include": [
"/arch/$ARCH/include/cflags.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"Cflags": [
"-9"
],
"Oflags": [
"-static",
"-l9p2000",
"-ljehanne"
],
"Program": "screenconsole",
"SourceFiles": [
"buffer.c",
"cga.c",
"screenconsole.c",
"keyboard.c",
"serve9p.c",
"utils.c"
]
}
}

View File

@ -0,0 +1,10 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/cmd/hmi
rm -f *.o
build console/
build realemu/
build vga/

View File

@ -1,11 +0,0 @@
{
"Loadcom": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"SourceFilesCmd": [
"loadcom.c"
]
}
}

View File

@ -1,21 +0,0 @@
{
"realemu": {
"Cflags": [
"-I", "/sys/src/kern/$ARCH/"
],
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/hmi/",
"Program": "realemu",
"SourceFiles": [
"arg.c",
"debug.c",
"decode.c",
"fmt.c",
"main.c",
"pit.c",
"xec.c"
]
}
}

View File

@ -0,0 +1,29 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
loadcom.c \
-o loadcom \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS
safemove loadcom $JEHANNE/arch/$ARCH/cmd/hmi
rm -f *.o
rm -f *.tag.*
$CC \
arg.c \
debug.c \
decode.c \
fmt.c \
main.c \
pit.c \
xec.c \
-I $JEHANNE/sys/src/kern/amd64 \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o realemu
safemove realemu $JEHANNE/arch/$ARCH/cmd/hmi
rm -f *.o

View File

@ -1,54 +0,0 @@
{
"vga": {
"Cflags": [
"-I", "/sys/src/kern/$ARCH/"
],
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/hmi",
"Program": "vga",
"SourceFiles": [
"error.c",
"ics534x.c",
"radeon.c",
"s3928.c",
"sc15025.c",
"trio64.c",
"tvp3026.c",
"vga.c",
"vision968.c",
"ch9294.c",
"io.c",
"main.c",
"nvidia.c",
"rgb524.c",
"s3clock.c",
"stg1702.c",
"tvp3020.c",
"tvp3026clock.c",
"virge.c",
"vmware.c",
"clgd542x.c",
"data.c",
"icd2061a.c",
"palette.c",
"rgb524mn.c",
"s3generic.c",
"t2r4.c",
"tvp3025.c",
"vesa.c",
"vision864.c",
"clgd546x.c",
"db.c",
"ics2494.c",
"pci.c",
"s3801.c",
"s3hwgc.c",
"template.c",
"tvp3025clock.c",
"vesadb.c",
"vision964.c"
]
}
}

View File

@ -0,0 +1,52 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
error.c \
ics534x.c \
radeon.c \
s3928.c \
sc15025.c \
trio64.c \
tvp3026.c \
vga.c \
vision968.c \
ch9294.c \
io.c \
main.c \
nvidia.c \
rgb524.c \
s3clock.c \
stg1702.c \
tvp3020.c \
tvp3026clock.c \
virge.c \
vmware.c \
clgd542x.c \
data.c \
icd2061a.c \
palette.c \
rgb524mn.c \
s3generic.c \
t2r4.c \
tvp3025.c \
vesa.c \
vision864.c \
clgd546x.c \
db.c \
ics2494.c \
pci.c \
s3801.c \
s3hwgc.c \
template.c \
tvp3025clock.c \
vesadb.c \
vision964.c \
-I $JEHANNE/sys/src/kern/amd64 \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o vga
safemove vga $JEHANNE/arch/$ARCH/cmd/hmi
rm -f *.o

View File

@ -1,23 +0,0 @@
{
"hoc": {
"Include": [
"../cmd.json"
],
"Install": "/arch/$ARCH/cmd/",
"Post": [
"rm -f $JEHANNE/sys/src/cmd/hoc/y.tab.[ch]"
],
"Pre": [
"yacc -d hoc.y"
],
"Program": "hoc",
"SourceFiles": [
"/sys/src/lib/jehanne/lib9.c",
"code.c",
"init.c",
"math.c",
"symbol.c",
"y.tab.c"
]
}
}

View File

@ -0,0 +1,19 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
yacc -d hoc.y
rm -f *.tag.*
$CC \
$JEHANNE/sys/src/lib/jehanne/lib9.c \
code.c \
init.c \
math.c \
symbol.c \
y.tab.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o hoc
safemove hoc $JEHANNE/arch/$ARCH/cmd
rm -f $JEHANNE/sys/src/cmd/hoc/y.tab.[ch]
rm -f *.o

View File

@ -1,29 +0,0 @@
{
"ipcmds": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Cflags": [
"-fno-strict-aliasing"
],
"Install": "/arch/$ARCH/cmd/ip",
"Projects": [
"dhcpd/dhcpd.json",
"dhcpd/dhcpleases.json",
"ipconfig/"
],
"SourceFilesCmd": [
"ping.c",
"dhcpclient.c",
"gping.c",
"hogports.c",
"linklocal.c",
"listen.c",
"listen1.c",
"rip.c",
"timesync.c",
"traceroute.c",
"trampoline.c"
]
}
}

View File

@ -1,15 +0,0 @@
{
"dhcpd": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/ip",
"Program": "dhcpd",
"SourceFiles": [
"dhcpd.c",
"db.c",
"ndb.c",
"ping.c"
]
}
}

View File

@ -0,0 +1,28 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
dhcpd.c \
db.c \
ndb.c \
ping.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o dhcpd
safemove dhcpd $JEHANNE/arch/$ARCH/cmd/ip
rm -f *.o
rm -f *.tag.*
$CC \
dhcpleases.c \
db.c \
ping.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o dhcpleases
safemove dhcpleases $JEHANNE/arch/$ARCH/cmd/ip
rm -f *.o

View File

@ -1,14 +0,0 @@
{
"dhcpleases": {
"Include": [
"/sys/src/cmd/cmd.json"
],
"Install": "/arch/$ARCH/cmd/ip",
"Program": "dhcpleases",
"SourceFiles": [
"dhcpleases.c",
"db.c",
"ping.c"
]
}
}

View File

@ -0,0 +1,9 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
compileCommands c $JEHANNE/arch/$ARCH/cmd/ip
rm -f *.o
build dhcpd/
build ipconfig/

View File

@ -1,14 +0,0 @@
{
"ipconfig": {
"Include": [
"../../cmd.json"
],
"Install": "/arch/$ARCH/cmd/ip",
"Program": "ipconfig",
"SourceFiles": [
"ipv6.c",
"main.c",
"ppp.c"
]
}
}

View File

@ -0,0 +1,14 @@
#!/cmd/rc
if ( ~ 0 $#BUILD_INITIALIZED ) . $JEHANNE/arch/rc/lib/build/utils.rc
rm -f *.tag.*
$CC \
ipv6.c \
main.c \
ppp.c \
$STACKCHECK_CFLAGS \
$CFLAGS \
$CMD_OFLAGS \
-o ipconfig
safemove ipconfig $JEHANNE/arch/$ARCH/cmd/ip
rm -f *.o

View File

@ -1,14 +0,0 @@
{
"ipconfig": {
"Include": [
"../../kernel.json"
],
"Install": "/arch/$ARCH/cmd/ip",
"Program": "ipconfig",
"SourceFiles": [
"ipv6.c",
"main.c",
"ppp.c"
]
}
}

View File

@ -1,20 +0,0 @@
{
"Kcmds": {
"Include": [
"kernel.json"
],
"Install": "/arch/$ARCH/cmd/",
"Projects": [
"/sys/src/cmd/rc/",
"/sys/src/cmd/ip/ipconfig/kipconfig.json"
],
"SourceFilesCmd": [
"bind.c",
"mount.c",
"date.c",
"srv.c",
"echo.c",
"ls.c"
]
}
}

View File

@ -1,31 +0,0 @@
{
"KernelCmd": {
"Cflags": [
"-mcmodel=small",
"-O0",
"-fplan9-extensions",
"-fno-builtin",
"-Wall",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas",
"-g"
],
"Libs": [
"/arch/$ARCH/lib/libString.a",
"/arch/$ARCH/lib/lib9p.a",
"/arch/$ARCH/lib/libndb.a",
"/arch/$ARCH/lib/libauth.a",
"/arch/$ARCH/lib/libbio.a",
"/arch/$ARCH/lib/libip.a",
"/arch/$ARCH/lib/libjehanne.a"
],
"Oflags": [
"-static"
],
"Pre": [
"rm -f *.o *.tag.*"
]
}
}

Some files were not shown because too many files have changed in this diff Show More