Browse Source

Klibs are now built with build.go. Just ./BUILD klibs as usual, no need to clean before. Begin migrating libs, for now libc/libip/libdraw

Elbing Miss 9 years ago
parent
commit
5e42743cbf

+ 11 - 12
BUILD

@@ -592,6 +592,15 @@ build_klibs()
 	fi
 }
 
+build_klibs_go()
+{
+	export HARVEY="$_BUILD_DIR"
+	cd "$SRC_DIR"
+	$HARVEY/util/build klibs.json
+	cd "$PATH_ORI" > /dev/null
+
+}
+
 #ARGS:
 #   $1 -> LIB name
 do_link_lib()
@@ -683,17 +692,7 @@ build_a_cmd()
 #   $1 -> cmd name
 clean_a_cmd()
 {
-	if [ -d "${CMD_DIR}/$1" ]
-	then
-		cd ${CMD_DIR}/$1
-	else
-		if [ $1 = ipconfig ]
-		then
-			cd ${CMD_DIR}/ip/$1
-		else
-		cd ${CMD_DIR}
-		fi
-	fi
+	cd ${CMD_DIR}/$1
 	DO_NOTHING=0
 	cmd_${1} 2
 	if [ $DO_NOTHING -eq 0 ]
@@ -819,7 +818,7 @@ else
 					check_lib_dir
 					if [ -z "$2" ]
 					then
-						build_klibs 1
+						build_klibs_go 1
 					else
 						build_a_lib "$2" 1
 						shift

+ 27 - 14
sys/src/9/k10/k8cpu.json

@@ -4,13 +4,7 @@
     "Include":["core.json", "../386/386.json", "../ip/ip.json", "../port/port.json"], 
 	"Projects": [
 	"/sys/src/cmd/rc/kernel.json",
-	"/sys/src/cmd/ip/ipconfig/kernel.json",
-	"/sys/src/cmd/bind.json",
-	"/sys/src/cmd/mount.json",
-	"/sys/src/cmd/date.json",
-	"/sys/src/cmd/srv.json",
-	"/sys/src/cmd/echo.json",
-	"/sys/src/cmd/ls.json"
+	"/sys/src/cmd/ip/ipconfig/kernel.json"
 	],
     "Pre": [
 	"cp ../../../../rc/lib/rcmain rcmain",
@@ -26,21 +20,40 @@
 	"data2c _amd64_bin_mount mount.elf.out>> k8cpu.root.c",
 	"cp ../../cmd/echo.elf.out echo.elf.out",
 	"strip echo.elf.out",
+	"data2c _amd64_bin_echo echo.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/cat.elf.out cat.elf.out",
+	"strip cat.elf.out",
+	"data2c _amd64_bin_cat cat.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/cp.elf.out cp.elf.out",
+	"strip cp.elf.out",
+	"data2c _amd64_bin_cp cp.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/ls.elf.out ls.elf.out",
+	"strip ls.elf.out",
+	"data2c _amd64_bin_ls ls.elf.out>> k8cpu.root.c",
 	"cp ../../cmd/ip/ipconfig/ipconfig.elf.out ipconfig.elf.out",
 	"strip ipconfig.elf.out",
 	"data2c _amd64_bin_ipconfig ipconfig.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/ip/ping.elf.out ping.elf.out",
+	"strip ping.elf.out",
+	"data2c _amd64_bin_ping ping.elf.out>> k8cpu.root.c",
 	"cp ../../cmd/srv.elf.out srv.elf.out",
 	"strip srv.elf.out",
 	"data2c _amd64_bin_srv srv.elf.out>> k8cpu.root.c",
-	"cp ../../cmd/echo.elf.out echo.elf.out",
-	"strip echo.elf.out",
-	"data2c _amd64_bin_echo echo.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/ps.elf.out ps.elf.out",
+	"strip ps.elf.out",
+	"data2c _amd64_bin_ps ps.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/mkdir.elf.out mkdir.elf.out",
+	"strip mkdir.elf.out",
+	"data2c _amd64_bin_mkdir mkdir.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/pwd.elf.out pwd.elf.out",
+	"strip pwd.elf.out",
+	"data2c _amd64_bin_pwd pwd.elf.out>> k8cpu.root.c",
+	"cp ../../cmd/chmod.elf.out chmod.elf.out",
+	"strip chmod.elf.out",
+	"data2c _amd64_bin_chmod chmod.elf.out>> k8cpu.root.c",
 	"cp ../../cmd/date.elf.out date.elf.out",
 	"strip date.elf.out",
-	"data2c _amd64_bin_date date.elf.out>> k8cpu.root.c",
-	"cp ../../cmd/ls.elf.out ls.elf.out",
-	"strip ls.elf.out",
-	"data2c _amd64_bin_ls ls.elf.out>> k8cpu.root.c"
+	"data2c _amd64_bin_date date.elf.out>> k8cpu.root.c"
     ],
     "SourceFiles":[
 	"cga.c",

+ 28 - 0
sys/src/klib.json

@@ -0,0 +1,28 @@
+{
+    "Name": "KernelLibs",
+    "Pre": [
+	"rm -f *.o *.tag.*"
+    ],
+    "Cflags": [
+	"-mcmodel=kernel",
+	"-O0",
+	"-fplan9-extensions",
+	"-ffreestanding",
+	"-fno-builtin",
+	"-Wall",
+	"-Wno-missing-braces",
+	"-Wno-parentheses",
+	"-Wno-unknown-pragmas",
+	"-Wuninitialized",
+	"-Wmaybe-uninitialized",
+	"-g"
+    ],
+    "Oflags": [
+	"-static"
+    ],
+	"Post": [
+	"rm *.o"
+    ],
+    "Libs": [
+    ]
+}

+ 9 - 0
sys/src/klibs.json

@@ -0,0 +1,9 @@
+{
+	"Name":"klibs",
+	"Include":[], 
+	"Projects": [
+	"/sys/src/libc/klibc.json",
+	"/sys/src/libip/klibip.json",
+	"/sys/src/libdraw/klibdraw.json"
+	]
+}

+ 27 - 0
sys/src/lib.json

@@ -0,0 +1,27 @@
+{
+    "Name": "Libs",
+    "Pre": [
+	"rm -f *.o *.tag.*"
+    ],
+    "Cflags": [
+	"-O0",
+	"-fplan9-extensions",
+	"-ffreestanding",
+	"-fno-builtin",
+	"-Wall",
+	"-Wno-missing-braces",
+	"-Wno-parentheses",
+	"-Wno-unknown-pragmas",
+	"-Wuninitialized",
+	"-Wmaybe-uninitialized",
+	"-g"
+    ],
+    "Oflags": [
+	"-static"
+    ],
+	"Post": [
+	"rm *.o"
+    ],
+    "Libs": [
+    ]
+}

+ 9 - 0
sys/src/libc/9syscall/9syscall.json

@@ -0,0 +1,9 @@
+{
+	"Name": "KernelLibc",
+	"Library": "klibc.a",
+	"Include": [],
+	"Pre": [
+	"../../../../util/mksys amd64"
+	]
+
+}

+ 275 - 0
sys/src/libc/klibc.json

@@ -0,0 +1,275 @@
+{
+	"Name": "KernelLibc",
+	"Library": "klibc.a",
+	"Include": ["../klib.json"],
+	"Projects": [
+	"9syscall/9syscall.json"
+	],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"9sys/abort.c",
+	"9sys/access.c",
+	"9sys/announce.c",
+	"9sys/convD2M.c",
+	"9sys/convM2D.c",
+	"9sys/convM2S.c",
+	"9sys/convS2M.c",
+	"9sys/cputime.c",
+	"9sys/ctime.c",
+	"9sys/dial.c",
+	"9sys/dirfstat.c",
+	"9sys/dirfwstat.c",
+	"9sys/dirmodefmt.c",
+	"9sys/dirread.c",
+	"9sys/dirstat.c",
+	"9sys/dirwstat.c",
+	"9sys/fcallfmt.c",
+	"9sys/fork.c",
+	"9sys/getnetconninfo.c",
+	"9sys/getenv.c",
+	"9sys/getpid.c",
+	"9sys/getppid.c",
+	"9sys/getwd.c",
+	"9sys/iounit.c",
+	"9sys/nulldir.c",
+	"9sys/postnote.c",
+	"9sys/privalloc.c",
+	"9sys/pushssl.c",
+	"9sys/pushtls.c",
+	"9sys/putenv.c",
+	"9sys/qlock.c",
+	"9sys/read.c",
+	"9sys/read9pmsg.c",
+	"9sys/readv.c",
+	"9sys/rerrstr.c",
+	"9sys/sbrk.c",
+	"9sys/setnetmtpt.c",
+	"9sys/sysfatal.c",
+	"9sys/syslog.c",
+	"9sys/sysname.c",
+	"9sys/time.c",
+	"9sys/times.c",
+	"9sys/tm2sec.c",
+	"9sys/truerand.c",
+	"9sys/wait.c",
+	"9sys/waitpid.c",
+	"9sys/werrstr.c",
+	"9sys/write.c",
+	"9sys/writev.c",
+	"9syscall/alarm.s",
+	"9syscall/await.s",
+	"9syscall/bind.s",
+	"9syscall/brk_.s",
+	"9syscall/chdir.s",
+	"9syscall/close.s",
+	"9syscall/create.s",
+	"9syscall/dup.s",
+	"9syscall/_errstr.s",
+	"9syscall/errstr.s",
+	"9syscall/execac.s",
+	"9syscall/exec.s",
+	"9syscall/_exits.s",
+	"9syscall/fauth.s",
+	"9syscall/fd2path.s",
+	"9syscall/_fsession.s",
+	"9syscall/_fstat.s",
+	"9syscall/fstat.s",
+	"9syscall/fversion.s",
+	"9syscall/_fwstat.s",
+	"9syscall/fwstat.s",
+	"9syscall/_mount.s",
+	"9syscall/mount.s",
+	"9syscall/nixsyscall.s",
+	"9syscall/noted.s",
+	"9syscall/notify.s",
+	"9syscall/nsec.s",
+	"9syscall/open.s",
+	"9syscall/oseek.s",
+	"9syscall/pipe.s",
+	"9syscall/pread.s",
+	"9syscall/pwrite.s",
+	"9syscall/_read.s",
+	"9syscall/remove.s",
+	"9syscall/rendezvous.s",
+	"9syscall/rfork.s",
+	"9syscall/seek.s",
+	"9syscall/segattach.s",
+	"9syscall/segbrk.s",
+	"9syscall/segdetach.s",
+	"9syscall/segflush.s",
+	"9syscall/segfree.s",
+	"9syscall/semacquire.s",
+	"9syscall/semalt.s",
+	"9syscall/semrelease.s",
+	"9syscall/semsleep.s",
+	"9syscall/semwakeup.s",
+	"9syscall/sleep.s",
+	"9syscall/_stat.s",
+	"9syscall/stat.s",
+	"9syscall/sysr1.s",
+	"9syscall/tsemacquire.s",
+	"9syscall/unmount.s",
+	"9syscall/_wait.s",
+	"9syscall/_write.s",
+	"9syscall/_wstat.s",
+	"9syscall/wstat.s",
+	"9syscall/ziofree.s",
+	"9syscall/ziopread.s",
+	"9syscall/ziopwrite.s",
+	"fmt/dofmt.c",
+	"fmt/dorfmt.c",
+	"fmt/errfmt.c",
+	"fmt/fltfmt.c",
+	"fmt/fmt.c",
+	"fmt/fmtfd.c",
+	"fmt/fmtlock.c",
+	"fmt/fmtprint.c",
+	"fmt/fmtquote.c",
+	"fmt/fmtrune.c",
+	"fmt/fmtstr.c",
+	"fmt/fmtvprint.c",
+	"fmt/fprint.c",
+	"fmt/print.c",
+	"fmt/runefmtstr.c",
+	"fmt/runeseprint.c",
+	"fmt/runesmprint.c",
+	"fmt/runesnprint.c",
+	"fmt/runesprint.c",
+	"fmt/runevseprint.c",
+	"fmt/runevsmprint.c",
+	"fmt/runevsnprint.c",
+	"fmt/seprint.c",
+	"fmt/smprint.c",
+	"fmt/snprint.c",
+	"fmt/sprint.c",
+	"fmt/vfprint.c",
+	"fmt/vseprint.c",
+	"fmt/vsmprint.c",
+	"fmt/vsnprint.c",
+	"port/_assert.c",
+	"port/abs.c",
+	"port/asin.c",
+	"port/atan.c",
+	"port/atan2.c",
+	"port/atexit.c",
+	"port/atnotify.c",
+	"port/atof.c",
+	"port/atol.c",
+	"port/atoll.c",
+	"port/cistrcmp.c",
+	"port/cistrncmp.c",
+	"port/cistrstr.c",
+	"port/charstod.c",
+	"port/cleanname.c",
+	"port/crypt.c",
+	"port/ctype.c",
+	"port/encodefmt.c",
+	"port/execl.c",
+	"port/exp.c",
+	"port/fabs.c",
+	"port/floor.c",
+	"port/fmod.c",
+	"port/frand.c",
+	"port/frexp.c",
+	"port/getcallerpc.c",
+	"port/getfields.c",
+	"port/getuser.c",
+	"port/hangup.c",
+	"port/hypot.c",
+	"port/lnrand.c",
+	"port/lock.c",
+	"port/log.c",
+	"port/lrand.c",
+	"port/malloc.c",
+	"port/memccpy.c",
+	"port/memchr.c",
+	"port/memcmp.c",
+	"port/memmove.c",
+	"port/memset.c",
+	"port/mktemp.c",
+	"port/muldiv.c",
+	"port/nan.c",
+	"port/needsrcquote.c",
+	"port/netcrypt.c",
+	"port/netmkaddr.c",
+	"port/nrand.c",
+	"port/ntruerand.c",
+	"port/perror.c",
+	"port/pool.c",
+	"port/pow.c",
+	"port/pow10.c",
+	"port/profile.c",
+	"port/qsort.c",
+	"port/quote.c",
+	"port/rand.c",
+	"port/readn.c",
+	"port/rune.c",
+	"port/runebase.c",
+	"port/runebsearch.c",
+	"port/runestrcat.c",
+	"port/runestrchr.c",
+	"port/runestrcmp.c",
+	"port/runestrcpy.c",
+	"port/runestrecpy.c",
+	"port/runestrdup.c",
+	"port/runestrncat.c",
+	"port/runestrncmp.c",
+	"port/runestrncpy.c",
+	"port/runestrrchr.c",
+	"port/runestrlen.c",
+	"port/runestrstr.c",
+	"port/runetype.c",
+	"port/sin.c",
+	"port/sinh.c",
+	"port/sqrt.c",
+	"port/strcat.c",
+	"port/strchr.c",
+	"port/strcmp.c",
+	"port/strcpy.c",
+	"port/strecpy.c",
+	"port/strcspn.c",
+	"port/strdup.c",
+	"port/strlen.c",
+	"port/strncat.c",
+	"port/strncmp.c",
+	"port/strncpy.c",
+	"port/strpbrk.c",
+	"port/strrchr.c",
+	"port/strspn.c",
+	"port/strstr.c",
+	"port/strtod.c",
+	"port/strtok.c",
+	"port/strtol.c",
+	"port/strtoll.c",
+	"port/strtoul.c",
+	"port/strtoull.c",
+	"port/tan.c",
+	"port/tanh.c",
+	"port/tokenize.c",
+	"port/toupper.c",
+	"port/utfecpy.c",
+	"port/utflen.c",
+	"port/utfnlen.c",
+	"port/utfrune.c",
+	"port/utfrrune.c",
+	"port/utfutf.c",
+	"port/u16.c",
+	"port/u32.c",
+	"port/u64.c",
+	"amd64/_seek.c",
+	"amd64/notejmp.c",
+	"amd64/cycles.c",
+	"amd64/argv0.c",
+	"amd64/rdpmc.c",
+	"amd64/setjmp.s",
+	"amd64/sqrt.s",
+	"amd64/tas.s",
+	"amd64/atom.S",
+	"amd64/main9.S"
+	],
+	"Post": [
+	"rm 9syscall/*.s",
+	"ar rv ../../../amd64/lib/klibc.a *.o"
+	]
+}

+ 274 - 0
sys/src/libc/libc.json

@@ -0,0 +1,274 @@
+{
+	"Name": "Libc",
+	"Library": "libc.a",
+	"Include": ["../lib.json"],
+    "Projects": [
+	"9syscall/9syscall.json"
+	],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"9sys/abort.c",
+	"9sys/access.c",
+	"9sys/announce.c",
+	"9sys/convD2M.c",
+	"9sys/convM2D.c",
+	"9sys/convM2S.c",
+	"9sys/convS2M.c",
+	"9sys/cputime.c",
+	"9sys/ctime.c",
+	"9sys/dial.c",
+	"9sys/dirfstat.c",
+	"9sys/dirfwstat.c",
+	"9sys/dirmodefmt.c",
+	"9sys/dirread.c",
+	"9sys/dirstat.c",
+	"9sys/dirwstat.c",
+	"9sys/fcallfmt.c",
+	"9sys/fork.c",
+	"9sys/getnetconninfo.c",
+	"9sys/getenv.c",
+	"9sys/getpid.c",
+	"9sys/getppid.c",
+	"9sys/getwd.c",
+	"9sys/iounit.c",
+	"9sys/nulldir.c",
+	"9sys/postnote.c",
+	"9sys/privalloc.c",
+	"9sys/pushssl.c",
+	"9sys/pushtls.c",
+	"9sys/putenv.c",
+	"9sys/qlock.c",
+	"9sys/read.c",
+	"9sys/read9pmsg.c",
+	"9sys/readv.c",
+	"9sys/rerrstr.c",
+	"9sys/sbrk.c",
+	"9sys/setnetmtpt.c",
+	"9sys/sysfatal.c",
+	"9sys/syslog.c",
+	"9sys/sysname.c",
+	"9sys/time.c",
+	"9sys/times.c",
+	"9sys/tm2sec.c",
+	"9sys/truerand.c",
+	"9sys/wait.c",
+	"9sys/waitpid.c",
+	"9sys/werrstr.c",
+	"9sys/write.c",
+	"9sys/writev.c",
+	"9syscall/alarm.s",
+	"9syscall/await.s",
+	"9syscall/bind.s",
+	"9syscall/brk_.s",
+	"9syscall/chdir.s",
+	"9syscall/close.s",
+	"9syscall/create.s",
+	"9syscall/dup.s",
+	"9syscall/_errstr.s",
+	"9syscall/errstr.s",
+	"9syscall/execac.s",
+	"9syscall/exec.s",
+	"9syscall/_exits.s",
+	"9syscall/fauth.s",
+	"9syscall/fd2path.s",
+	"9syscall/_fsession.s",
+	"9syscall/_fstat.s",
+	"9syscall/fstat.s",
+	"9syscall/fversion.s",
+	"9syscall/_fwstat.s",
+	"9syscall/fwstat.s",
+	"9syscall/_mount.s",
+	"9syscall/mount.s",
+	"9syscall/nixsyscall.s",
+	"9syscall/noted.s",
+	"9syscall/notify.s",
+	"9syscall/nsec.s",
+	"9syscall/open.s",
+	"9syscall/oseek.s",
+	"9syscall/pipe.s",
+	"9syscall/pread.s",
+	"9syscall/pwrite.s",
+	"9syscall/_read.s",
+	"9syscall/remove.s",
+	"9syscall/rendezvous.s",
+	"9syscall/rfork.s",
+	"9syscall/seek.s",
+	"9syscall/segattach.s",
+	"9syscall/segbrk.s",
+	"9syscall/segdetach.s",
+	"9syscall/segflush.s",
+	"9syscall/segfree.s",
+	"9syscall/semacquire.s",
+	"9syscall/semalt.s",
+	"9syscall/semrelease.s",
+	"9syscall/semsleep.s",
+	"9syscall/semwakeup.s",
+	"9syscall/sleep.s",
+	"9syscall/_stat.s",
+	"9syscall/stat.s",
+	"9syscall/sysr1.s",
+	"9syscall/tsemacquire.s",
+	"9syscall/unmount.s",
+	"9syscall/_wait.s",
+	"9syscall/_write.s",
+	"9syscall/_wstat.s",
+	"9syscall/wstat.s",
+	"9syscall/ziofree.s",
+	"9syscall/ziopread.s",
+	"9syscall/ziopwrite.s",
+	"fmt/dofmt.c",
+	"fmt/dorfmt.c",
+	"fmt/errfmt.c",
+	"fmt/fltfmt.c",
+	"fmt/fmt.c",
+	"fmt/fmtfd.c",
+	"fmt/fmtlock.c",
+	"fmt/fmtprint.c",
+	"fmt/fmtquote.c",
+	"fmt/fmtrune.c",
+	"fmt/fmtstr.c",
+	"fmt/fmtvprint.c",
+	"fmt/fprint.c",
+	"fmt/print.c",
+	"fmt/runefmtstr.c",
+	"fmt/runeseprint.c",
+	"fmt/runesmprint.c",
+	"fmt/runesnprint.c",
+	"fmt/runesprint.c",
+	"fmt/runevseprint.c",
+	"fmt/runevsmprint.c",
+	"fmt/runevsnprint.c",
+	"fmt/seprint.c",
+	"fmt/smprint.c",
+	"fmt/snprint.c",
+	"fmt/sprint.c",
+	"fmt/vfprint.c",
+	"fmt/vseprint.c",
+	"fmt/vsmprint.c",
+	"fmt/vsnprint.c",
+	"port/_assert.c",
+	"port/abs.c",
+	"port/asin.c",
+	"port/atan.c",
+	"port/atan2.c",
+	"port/atexit.c",
+	"port/atnotify.c",
+	"port/atof.c",
+	"port/atol.c",
+	"port/atoll.c",
+	"port/cistrcmp.c",
+	"port/cistrncmp.c",
+	"port/cistrstr.c",
+	"port/charstod.c",
+	"port/cleanname.c",
+	"port/crypt.c",
+	"port/ctype.c",
+	"port/encodefmt.c",
+	"port/execl.c",
+	"port/exp.c",
+	"port/fabs.c",
+	"port/floor.c",
+	"port/fmod.c",
+	"port/frand.c",
+	"port/frexp.c",
+	"port/getcallerpc.c",
+	"port/getfields.c",
+	"port/getuser.c",
+	"port/hangup.c",
+	"port/hypot.c",
+	"port/lnrand.c",
+	"port/lock.c",
+	"port/log.c",
+	"port/lrand.c",
+	"port/malloc.c",
+	"port/memccpy.c",
+	"port/memchr.c",
+	"port/memcmp.c",
+	"port/memmove.c",
+	"port/memset.c",
+	"port/mktemp.c",
+	"port/muldiv.c",
+	"port/nan.c",
+	"port/needsrcquote.c",
+	"port/netcrypt.c",
+	"port/netmkaddr.c",
+	"port/nrand.c",
+	"port/ntruerand.c",
+	"port/perror.c",
+	"port/pool.c",
+	"port/pow.c",
+	"port/pow10.c",
+	"port/profile.c",
+	"port/qsort.c",
+	"port/quote.c",
+	"port/rand.c",
+	"port/readn.c",
+	"port/rune.c",
+	"port/runebase.c",
+	"port/runebsearch.c",
+	"port/runestrcat.c",
+	"port/runestrchr.c",
+	"port/runestrcmp.c",
+	"port/runestrcpy.c",
+	"port/runestrecpy.c",
+	"port/runestrdup.c",
+	"port/runestrncat.c",
+	"port/runestrncmp.c",
+	"port/runestrncpy.c",
+	"port/runestrrchr.c",
+	"port/runestrlen.c",
+	"port/runestrstr.c",
+	"port/runetype.c",
+	"port/sin.c",
+	"port/sinh.c",
+	"port/sqrt.c",
+	"port/strcat.c",
+	"port/strchr.c",
+	"port/strcmp.c",
+	"port/strcpy.c",
+	"port/strecpy.c",
+	"port/strcspn.c",
+	"port/strdup.c",
+	"port/strlen.c",
+	"port/strncat.c",
+	"port/strncmp.c",
+	"port/strncpy.c",
+	"port/strpbrk.c",
+	"port/strrchr.c",
+	"port/strspn.c",
+	"port/strstr.c",
+	"port/strtod.c",
+	"port/strtok.c",
+	"port/strtol.c",
+	"port/strtoll.c",
+	"port/strtoul.c",
+	"port/strtoull.c",
+	"port/tan.c",
+	"port/tanh.c",
+	"port/tokenize.c",
+	"port/toupper.c",
+	"port/utfecpy.c",
+	"port/utflen.c",
+	"port/utfnlen.c",
+	"port/utfrune.c",
+	"port/utfrrune.c",
+	"port/utfutf.c",
+	"port/u16.c",
+	"port/u32.c",
+	"port/u64.c",
+	"amd64/_seek.c",
+	"amd64/notejmp.c",
+	"amd64/cycles.c",
+	"amd64/argv0.c",
+	"amd64/rdpmc.c",
+	"amd64/setjmp.s",
+	"amd64/sqrt.s",
+	"amd64/tas.s",
+	"amd64/atom.S",
+	"amd64/main9.S",
+	],
+	"Post": [
+	"ar rv /amd64/lib/libc.a *.o"
+	]
+}

+ 2 - 2
sys/src/libc/port/pool.c

@@ -475,8 +475,8 @@ blockmerge(Pool *pool, Bhdr *a, Bhdr *b)
 
 	t = B2T(a);
 	t->size = (uint32_t)Poison;
-	t->magic0 = NOT_MAGIC;
-	t->magic1 = NOT_MAGIC;
+	t->magic0 = (uint8_t)NOT_MAGIC;
+	t->magic1 = (uint8_t)NOT_MAGIC;
 	PSHORT(t->datasize, NOT_MAGIC);
 
 	a->size += b->size;

+ 3 - 3
sys/src/libdraw/event.c

@@ -41,7 +41,7 @@ static	int	nslave;
 static	int	parentpid;
 static	int	epipe[2];
 
-static	int	eforkslave(ulong);
+static	int	eforkslave(uint32_t);
 static	void	extract(void);
 static	void	ekill(void);
 static	int	enote(void *, char *);
@@ -77,7 +77,7 @@ ebread(Slave *s)
 uint32_t
 event(Event *e)
 {
-	return eread(~0UL, e);
+	return eread((uint32_t)~0UL, e);
 }
 
 uint32_t
@@ -406,7 +406,7 @@ emouse(void)
 {
 	Mouse m;
 	Ebuf *eb;
-	static but[2];
+	//static but[2];
 	int b;
 
 	if(Smouse < 0)

+ 3 - 1
sys/src/libdraw/font.c

@@ -16,6 +16,8 @@ static int	freeup(Font*);
 
 #define	PJW	0	/* use NUL==pjw for invisible characters */
 
+static Rune empty[] = { 0 };
+
 int
 cachechars(Font *f, char **ss, Rune **rr, uint16_t *cp, int max,
 	   int *wp,
@@ -29,7 +31,7 @@ cachechars(Font *f, char **ss, Rune **rr, uint16_t *cp, int max,
 
 	if(ss){
 		sp = *ss;
-		rp = L"";
+		rp = empty;
 	}else{
 		sp = "";
 		rp = *rr;

+ 68 - 0
sys/src/libdraw/klibdraw.json

@@ -0,0 +1,68 @@
+{
+	"Name": "KernelLibdraw",
+	"Library": "klibdraw.a",
+	"Include": ["../klib.json"],
+	"Pre": [
+	],
+	"SourceFiles": [
+	"alloc.c",
+	"allocimagemix.c",
+	"arith.c",
+	"bezier.c",
+	"border.c",
+	"buildfont.c",
+	"bytesperline.c",
+	"chan.c",
+	"cloadimage.c",
+	"computil.c",
+	"creadimage.c",
+	"debug.c",
+	"defont.c",
+	"draw.c",
+	"drawrepl.c",
+	"egetrect.c",
+	"ellipse.c",
+	"emenuhit.c",
+	"event.c",
+	"fmt.c",
+	"font.c",
+	"freesubfont.c",
+	"getdefont.c",
+	"getrect.c",
+	"getsubfont.c",
+	"icossin.c",
+	"icossin2.c",
+	"init.c",
+	"keyboard.c",
+	"line.c",
+	"menuhit.c",
+	"mkfont.c",
+	"mouse.c",
+	"newwindow.c",
+	"openfont.c",
+	"poly.c",
+	"loadimage.c",
+	"readcolmap.c",
+	"readimage.c",
+	"readsubfont.c",
+	"rectclip.c",
+	"replclipr.c",
+	"rgb.c",
+	"scroll.c",
+	"string.c",
+	"stringbg.c",
+	"stringsubfont.c",
+	"stringwidth.c",
+	"subfont.c",
+	"subfontcache.c",
+	"subfontname.c",
+	"unloadimage.c",
+	"window.c",
+	"writecolmap.c",
+	"writeimage.c",
+	"writesubfont.c"
+	],
+	"Post": [
+	"ar rv ../../../amd64/lib/klibdraw.a *.o"
+	]
+}

+ 69 - 0
sys/src/libdraw/libdraw.json

@@ -0,0 +1,69 @@
+{
+	"Name": "Libdraw",
+	"Library": "libdraw.a",
+	"Include": ["../lib.json"],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"alloc.c",
+	"allocimagemix.c",
+	"arith.c",
+	"bezier.c",
+	"border.c",
+	"buildfont.c",
+	"bytesperline.c",
+	"chan.c",
+	"cloadimage.c",
+	"computil.c",
+	"creadimage.c",
+	"debug.c",
+	"defont.c",
+	"draw.c",
+	"drawrepl.c",
+	"egetrect.c",
+	"ellipse.c",
+	"emenuhit.c",
+	"event.c",
+	"fmt.c",
+	"font.c",
+	"freesubfont.c",
+	"getdefont.c",
+	"getrect.c",
+	"getsubfont.c",
+	"icossin.c",
+	"icossin2.c",
+	"init.c",
+	"keyboard.c",
+	"line.c",
+	"menuhit.c",
+	"mkfont.c",
+	"mouse.c",
+	"newwindow.c",
+	"openfont.c",
+	"poly.c",
+	"loadimage.c",
+	"readcolmap.c",
+	"readimage.c",
+	"readsubfont.c",
+	"rectclip.c",
+	"replclipr.c",
+	"rgb.c",
+	"scroll.c",
+	"string.c",
+	"stringbg.c",
+	"stringsubfont.c",
+	"stringwidth.c",
+	"subfont.c",
+	"subfontcache.c",
+	"subfontname.c",
+	"unloadimage.c",
+	"window.c",
+	"writecolmap.c",
+	"writeimage.c",
+	"writesubfont.c"
+	],
+	"Post": [
+	"rm 9syscall/*.s",
+	"ar rv ../../../amd64/lib/libdraw.a *.o"
+	]
+}

+ 3 - 1
sys/src/libdraw/stringwidth.c

@@ -11,6 +11,8 @@
 #include <libc.h>
 #include <draw.h>
 
+static Rune empty[] = { 0 };
+
 int
 _stringnwidth(Font *f, char *s, Rune *r, int len)
 {
@@ -28,7 +30,7 @@ _stringnwidth(Font *f, char *s, Rune *r, int len)
 	}else
 		sptr = &s;
 	if(r == nil){
-		r = L"";
+		r = empty;
 		rptr = nil;
 	}else
 		rptr = &r;

+ 23 - 0
sys/src/libip/klibip.json

@@ -0,0 +1,23 @@
+{
+	"Name": "KernelLibip",
+	"Library": "klibip.a",
+	"Include": ["../klib.json"],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"eipfmt.c",
+	"equivip.c",
+	"parseip.c",
+	"parseether.c",
+	"myetheraddr.c",
+	"myipaddr.c",
+	"classmask.c",
+	"bo.c",
+	"readipifc.c",
+	"ipaux.c",
+	"ptclbsum.c"
+	],
+	"Post": [
+	"ar rv ../../../amd64/lib/klibip.a *.o"
+	]
+}

+ 24 - 0
sys/src/libip/libip.json

@@ -0,0 +1,24 @@
+{
+	"Name": "Libip",
+	"Library": "libip.a",
+	"Include": ["../lib.json"],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"eipfmt.c",
+	"equivip.c",
+	"parseip.c",
+	"parseether.c",
+	"myetheraddr.c",
+	"myipaddr.c",
+	"classmask.c",
+	"bo.c",
+	"readipifc.c",
+	"ipaux.c",
+	"ptclbsum.c"
+	],
+	"Post": [
+	"rm 9syscall/*.s",
+	"ar rv ../../../amd64/lib/libip.a *.o"
+	]
+}

+ 9 - 0
sys/src/libs.json

@@ -0,0 +1,9 @@
+{
+	"Name":"libs",
+	"Include":[], 
+	"Projects": [
+	"/sys/src/libc/libc.json",
+	"/sys/src/libip/libip.json",
+	"/sys/src/libdraw/libdraw.json"
+	]
+}

+ 1 - 0
util/build.go

@@ -172,6 +172,7 @@ func project(root string) {
 	}
 	if b.Library != "" {
 		//library(b)
+		log.Printf("\n\n*** Building %v ***\n\n", b.Library)
 	}
 	run(b, b.Post)
 }