shithub: scc

Download patch

ref: add67ac20a08533aee533a9ad9498888053c2e3f
parent: e3c286305c8ce6faa45646a6f8d919137a32b6dd
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Aug 20 17:45:36 EDT 2018

[lib/c] Move include to rootdir

This directory is going to be fully copied to the target
so, it makes sense to have the target includes here instead
of copying them from lib/c.

diff: cannot open a/lib/c/include/bits/amd64-sysv/arch//null: file does not exist: 'a/lib/c/include/bits/amd64-sysv/arch//null' diff: cannot open a/lib/c/include/bits/amd64-sysv//null: file does not exist: 'a/lib/c/include/bits/amd64-sysv//null' diff: cannot open a/lib/c/include/bits/i386-sysv/arch//null: file does not exist: 'a/lib/c/include/bits/i386-sysv/arch//null' diff: cannot open a/lib/c/include/bits/i386-sysv//null: file does not exist: 'a/lib/c/include/bits/i386-sysv//null' diff: cannot open a/lib/c/include/bits/z80-dos/arch//null: file does not exist: 'a/lib/c/include/bits/z80-dos/arch//null' diff: cannot open a/lib/c/include/bits/z80-dos//null: file does not exist: 'a/lib/c/include/bits/z80-dos//null' diff: cannot open a/lib/c/include/bits//null: file does not exist: 'a/lib/c/include/bits//null' diff: cannot open a/lib/c/include//null: file does not exist: 'a/lib/c/include//null' diff: cannot open b/rootdir/include/scc/bits/amd64-sysv/arch//null: file does not exist: 'b/rootdir/include/scc/bits/amd64-sysv/arch//null' diff: cannot open b/rootdir/include/scc/bits/amd64-sysv//null: file does not exist: 'b/rootdir/include/scc/bits/amd64-sysv//null' diff: cannot open b/rootdir/include/scc/bits/i386-sysv/arch//null: file does not exist: 'b/rootdir/include/scc/bits/i386-sysv/arch//null' diff: cannot open b/rootdir/include/scc/bits/i386-sysv//null: file does not exist: 'b/rootdir/include/scc/bits/i386-sysv//null' diff: cannot open b/rootdir/include/scc/bits/z80-dos/arch//null: file does not exist: 'b/rootdir/include/scc/bits/z80-dos/arch//null' diff: cannot open b/rootdir/include/scc/bits/z80-dos//null: file does not exist: 'b/rootdir/include/scc/bits/z80-dos//null' diff: cannot open b/rootdir/include/scc/bits//null: file does not exist: 'b/rootdir/include/scc/bits//null' diff: cannot open b/rootdir/include/scc//null: file does not exist: 'b/rootdir/include/scc//null' diff: cannot open b/rootdir/include//null: file does not exist: 'b/rootdir/include//null'
--- a/as/Makefile
+++ b/as/Makefile
@@ -5,7 +5,7 @@
 include $(LIBSCC)/libdep.mk
 
 OBJ = main.o symbol.o ins.o parser.o expr.o myro.o
-MORECFLAGS = -I$(INCDIR)/$(STD)
+MORECFLAGS = -I$(INCLUDE)/$(STD)
 TARGETS = $(LIBEXEC)/as-amd64 $(LIBEXEC)/as-i386 \
           $(LIBEXEC)/as-i286 $(LIBEXEC)/as-z80
 
--- a/cc1/Makefile
+++ b/cc1/Makefile
@@ -5,7 +5,7 @@
 include $(PROJECTDIR)/rules.mk
 include $(LIBSCC)/libdep.mk
 
-MORECFLAGS = -I$(INCDIR)/$(STD)
+MORECFLAGS = -I$(INCLUDE)/$(STD)
 
 OBJ = types.o decl.o lex.o error.o symbol.o main.o expr.o \
       code.o stmt.o cpp.o fold.o init.o builtin.o
--- a/cc2/deps.mk
+++ b/cc2/deps.mk
@@ -1,8 +1,8 @@
 parser.c: $(PROJECTDIR)/inc/$(STD)/cstd.h
-target/amd64-sysv/code.o: $(INCDIR)/$(STD)/cstd.h
-target/i386-sysv/code.o: $(INCDIR)/$(STD)/cstd.h
-target/qbe/cgen.o: $(INCDIR)/$(STD)/cstd.h
-target/z80-scc/code.o: $(INCDIR)/$(STD)/cstd.h
+target/amd64-sysv/code.o: $(INCLUDE)/$(STD)/cstd.h
+target/i386-sysv/code.o: $(INCLUDE)/$(STD)/cstd.h
+target/qbe/cgen.o: $(INCLUDE)/$(STD)/cstd.h
+target/z80-scc/code.o: $(INCLUDE)/$(STD)/cstd.h
 
 #deps
 code.o: ../inc/scc.h
--- a/driver/posix/Makefile
+++ b/driver/posix/Makefile
@@ -3,7 +3,7 @@
 PROJECTDIR = ../..
 include $(PROJECTDIR)/rules.mk
 include $(LIBSCC)/libdep.mk
-include $(INCDIR)/incdep.mk
+include $(INCLUDE)/incdep.mk
 
 # SYSLST is a list of backend-arch-abi-sys. First
 # element of the list becomes the default target
--- a/inc/Makefile
+++ b/inc/Makefile
@@ -9,25 +9,25 @@
 
 config: $(SYSHDR)
 
-$(INCDIR)/ldflags.h:
+$(INCLUDE)/ldflags.h:
 	rm -f $@ ; \
 	trap "rm -f $$$$.h" 0 2 3; \
 	cat < ldflags.def.h > $$$$.h; \
 	mv $$$$.h $@
 
-$(INCDIR)/syscrts.h:
+$(INCLUDE)/syscrts.h:
 	rm -f $@ ; \
 	trap "rm -f $$$$.h" 0 2 3; \
 	sed 's,PREFIX,"$(PREFIX)",g' < syscrts.def.h > $$$$.h && \
 	mv $$$$.h $@
 
-$(INCDIR)/sysincludes.h:
+$(INCLUDE)/sysincludes.h:
 	rm -f $@ ; \
 	trap "rm -f $$$$.h" 0 2 3; \
 	sed 's,PREFIX,"$(PREFIX)",g' < sysincludes.def.h > $$$$.h && \
 	mv $$$$.h $@
 
-$(INCDIR)/syslibs.h:
+$(INCLUDE)/syslibs.h:
 	rm -f $@ ; \
 	trap "rm -f $$$$.h" 0 2 3; \
 	sed 's,PREFIX,"$(PREFIX)",g' < syslibs.def.h > $$$$.h && \
--- a/inc/incdep.mk
+++ b/inc/incdep.mk
@@ -1,7 +1,7 @@
-include $(INCDIR)/inclst.mk
+include $(INCLUDE)/inclst.mk
 
 debug:
 	echo $(SYSHDR)
 
 $(SYSHDR):
-	+@cd $(INCDIR) && $(MAKE)
+	+@cd $(INCLUDE) && $(MAKE)
--- a/inc/inclst.mk
+++ b/inc/inclst.mk
@@ -1,4 +1,4 @@
-SYSHDR = $(INCDIR)/ldflags.h\
-         $(INCDIR)/syscrts.h\
-         $(INCDIR)/sysincludes.h\
-         $(INCDIR)/syslibs.h
+SYSHDR = $(INCLUDE)/ldflags.h\
+         $(INCLUDE)/syscrts.h\
+         $(INCLUDE)/sysincludes.h\
+         $(INCLUDE)/syslibs.h
--- a/lib/c/include/assert.h
+++ /dev/null
@@ -1,10 +1,0 @@
-
-void __assert(char *exp, char *file, long line);
-
-#undef assert
-#ifndef NDEBUG
-# define assert(exp) ((exp) ? (void) 0 : __assert(#exp, __FILE__, __LINE__))
-#else
-# define assert(exp) ((void)0)
-#endif
-
--- a/lib/c/include/bits/amd64-sysv/arch/limits.h
+++ /dev/null
@@ -1,17 +1,0 @@
-#define SCHAR_MAX  0x7F
-#define SCHAR_MIN  (-SCHAR_MIN-1)
-#define CHAR_MAX   0x7F
-#define CHAR_MIN   (-CHAR_MAX-1)
-#define UCHAR_MAX  0xFF
-#define SHRT_MAX   0x7FFF
-#define SHRT_MIN   (-SHRT_MAX-1)
-#define USHRT_MAX  0xFFFF
-#define INT_MAX    0x7FFFFFFF
-#define INT_MIN    (-INT_MAX-1)
-#define UINT_MAX   0xFFFFFFFF
-#define LONG_MAX   0x7FFFFFFFFFFFFFFF
-#define LONG_MIN   (-LONG_MAX-1)
-#define ULONG_MAX  0xFFFFFFFFFFFFFFFF
-#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
-#define LLONG_MIN  (-LLONG_MAX-1)
-#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/lib/c/include/bits/amd64-sysv/arch/signal.h
+++ /dev/null
@@ -1,27 +1,0 @@
-typedef int sig_atomic_t;
-
-#define SIG_ERR    -1
-#define SIG_DFL     0
-#define SIG_IGN     1
-
-#define SIGHUP      1
-#define SIGINT      2
-#define SIGQUIT     3
-#define SIGILL      4
-#define SIGABRT     6
-#define SIGFPE      8
-#define SIGKILL     9
-#define SIGUSR1    10
-#define SIGSEGV    11
-#define SIGUSR2    12
-#define SIGPIPE    13
-#define SIGALRM    14
-#define SIGTERM    15
-#define SIGCHLD    17
-#define SIGCONT    18
-#define SIGSTOP    19
-#define SIGSSTP    20
-#define SIGTTIN    21
-#define SIGTTOU    22
-
-#define __NR_SIGNALS 23
--- a/lib/c/include/bits/amd64-sysv/arch/stddef.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#ifndef _WCHAR_T
-typedef int wchar_t;
-#define _WCHAR_T
-#endif
-
-#ifndef _PTRDIFF_T
-typedef long ptrdiff_t;
-#define _PTRDIFF_T
-#endif
--- a/lib/c/include/bits/amd64-sysv/arch/stdint.h
+++ /dev/null
@@ -1,115 +1,0 @@
-#define INT8_MAX  0x7F
-#define INT8_MIN  (-INT8_MAX-1)
-#define UINT8_MAX 0xFF
-
-#define INT16_MAX  0x7FFF
-#define INT16_MIN  (-INT16_MAX-1)
-#define UINT16_MAX 0xFFFF
-
-#define INT32_MAX  0x7FFFFFFF
-#define INT32_MIN  (-INT32_MAX-1)
-#define UINT32_MAX 0xFFFFFFFF
-
-#define INT64_MAX  0x7FFFFFFFFFFFFFFF
-#define INT64_MIN  (-INT64_MAX-1)
-#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
-
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-
-#define INT_LEAST64_MIN  INT64_MIN
-#define INT_LEAST64_MAX  INT64_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-#define INT_FAST8_MIN  INT32_MIN
-#define INT_FAST8_MAX  INT32_MAX
-#define UINT_FAST8_MAX UINT32_MAX
-
-#define INT_FAST16_MIN  INT32_MIN
-#define INT_FAST16_MAX  INT32_MAX
-#define UINT_FAST16_MAX UINT32_MAX
-
-#define INT_FAST32_MIN  INT32_MIN
-#define INT_FAST32_MAX  INT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INT_FAST64_MIN  INT64_MIN
-#define INT_FAST64_MAX  INT64_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-#define INTPTR_MIN  INT64_MIN
-#define INTPTR_MAX  INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
-
-#define INTMAX_MIN  INT64_MIN
-#define INTMAX_MAX  INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-#define PTRDIFF_MIN INT64_MIN
-#define PTRDIFF_MAX INT64_MAX
-
-#define SIG_ATOMIC_MIN INT32_MIN
-#define SIG_ATOMIC_MAX INT32_MAX
-
-#define SIZE_MAX UINT64_MAX
-
-#define WCHAR_MIN INT32_MIN
-#define WCHAR_MAX INT32_MAX
-
-#define INT8_C(x)  x
-#define INT16_C(x) x
-#define INT32_C(x) x
-#define INT64_C(x) x ## L
-
-#define UINT8_C(x)  x
-#define UINT16_C(x) x
-#define UINT32_C(x) x ## U
-#define UINT64_C(x) x ## UL
-
-#define INTMAX_C(x)  x ## L
-#define UINTMAX_C(x) x ## UL
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned uint32_t;
-typedef unsigned long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned uint32_least_t;
-typedef unsigned long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long int64_fast_t;
-
-typedef unsigned uint8_fast_t;
-typedef unsigned uint16_fast_t;
-typedef unsigned uint32_fast_t;
-typedef unsigned long uint64_fast_t;
-
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
--- a/lib/c/include/bits/amd64-sysv/arch/stdio.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#define BUFSIZ        512
-#define FILENAME_MAX  256
-#define FOPEN_MAX      16
-
-#define TMP_MAX        25
-#define L_tmpnam      256
-
-#define _TMPNAME      "/tmp/tmp.0000000"
-
-typedef int fpos_t;
--- a/lib/c/include/bits/amd64-sysv/arch/stdlib.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-
-#ifndef _WCHAR_T
-typedef int wchar_t;
-#define _WCHAR_T
-#endif
-
-#define _ALIGNTYPE long double
--- a/lib/c/include/bits/amd64-sysv/arch/string.h
+++ /dev/null
@@ -1,3 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#endif
--- a/lib/c/include/bits/amd64-sysv/arch/time.h
+++ /dev/null
@@ -1,6 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-typedef long int time_t;
--- a/lib/c/include/bits/i386-sysv/arch/limits.h
+++ /dev/null
@@ -1,17 +1,0 @@
-#define SCHAR_MAX  0x7F
-#define SCHAR_MIN  (-SCHAR_MIN-1)
-#define CHAR_MAX   0x7F
-#define CHAR_MIN   (-CHAR_MAX-1)
-#define UCHAR_MAX  0xFF
-#define SHRT_MAX   0x7FFF
-#define SHRT_MIN   (-SHRT_MAX-1)
-#define USHRT_MAX  0xFFFF
-#define INT_MAX    0x7FFFFFFF
-#define INT_MIN    (-INT_MAX-1)
-#define UINT_MAX   0xFFFFFFFF
-#define LONG_MAX   0x7FFFFFFF
-#define LONG_MIN   (-LONG_MAX-1)
-#define ULONG_MAX  0xFFFFFFFF
-#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
-#define LLONG_MIN  (-LLONG_MAX-1)
-#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/lib/c/include/bits/i386-sysv/arch/signal.h
+++ /dev/null
@@ -1,27 +1,0 @@
-typedef int sig_atomic_t;
-
-#define SIG_ERR    -1
-#define SIG_DFL     0
-#define SIG_IGN     1
-
-#define SIGHUP      1
-#define SIGINT      2
-#define SIGQUIT     3
-#define SIGILL      4
-#define SIGABRT     6
-#define SIGFPE      8
-#define SIGKILL     9
-#define SIGUSR1    10
-#define SIGSEGV    11
-#define SIGUSR2    12
-#define SIGPIPE    13
-#define SIGALRM    14
-#define SIGTERM    15
-#define SIGCHLD    17
-#define SIGCONT    18
-#define SIGSTOP    19
-#define SIGSSTP    20
-#define SIGTTIN    21
-#define SIGTTOU    22
-
-#define __NR_SIGNALS 23
--- a/lib/c/include/bits/i386-sysv/arch/stddef.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#ifndef _WCHAR_T
-typedef int wchar_t;
-#define _WCHAR_T
-#endif
-
-#ifndef _PTRDIFF_T
-typedef long ptrdiff_t;
-#define _PTRDIFF_T
-#endif
--- a/lib/c/include/bits/i386-sysv/arch/stdint.h
+++ /dev/null
@@ -1,115 +1,0 @@
-#define INT8_MAX  0x7F
-#define INT8_MIN  (-INT8_MAX-1)
-#define UINT8_MAX 0xFF
-
-#define INT16_MAX  0x7FFF
-#define INT16_MIN  (-INT16_MAX-1)
-#define UINT16_MAX 0xFFFF
-
-#define INT32_MAX  0x7FFFFFFF
-#define INT32_MIN  (-INT32_MAX-1)
-#define UINT32_MAX 0xFFFFFFFF
-
-#define INT64_MAX  0x7FFFFFFFFFFFFFFF
-#define INT64_MIN  (-INT64_MAX-1)
-#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
-
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-
-#define INT_LEAST64_MIN  INT64_MIN
-#define INT_LEAST64_MAX  INT64_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-#define INT_FAST8_MIN  INT32_MIN
-#define INT_FAST8_MAX  INT32_MAX
-#define UINT_FAST8_MAX UINT32_MAX
-
-#define INT_FAST16_MIN  INT32_MIN
-#define INT_FAST16_MAX  INT32_MAX
-#define UINT_FAST16_MAX UINT32_MAX
-
-#define INT_FAST32_MIN  INT32_MIN
-#define INT_FAST32_MAX  INT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INT_FAST64_MIN  INT64_MIN
-#define INT_FAST64_MAX  INT64_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-#define INTPTR_MIN  INT32_MIN
-#define INTPTR_MAX  INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
-
-#define INTMAX_MIN  INT64_MIN
-#define INTMAX_MAX  INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-#define PTRDIFF_MIN INT32_MIN
-#define PTRDIFF_MAX INT32_MAX
-
-#define SIG_ATOMIC_MIN INT32_MIN
-#define SIG_ATOMIC_MAX INT32_MAX
-
-#define SIZE_MAX UINT32_MAX
-
-#define WCHAR_MIN INT32_MIN
-#define WCHAR_MAX INT32_MAX
-
-#define INT8_C(x)  x
-#define INT16_C(x) x
-#define INT32_C(x) x
-#define INT64_C(x) x ## LL
-
-#define UINT8_C(x)  x
-#define UINT16_C(x) x
-#define UINT32_C(x) x ## U
-#define UINT64_C(x) x ## ULL
-
-#define INTMAX_C(x)  x ## LL
-#define UINTMAX_C(x) x ## ULL
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned uint32_least_t;
-typedef unsigned long long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long long int64_fast_t;
-
-typedef unsigned uint8_fast_t;
-typedef unsigned uint16_fast_t;
-typedef unsigned uint32_fast_t;
-typedef unsigned long long uint64_fast_t;
-
-typedef int intptr_t;
-typedef unsigned uintptr_t;
-
-typedef long long intmax_t;
-typedef unsigned long long uintmax_t;
--- a/lib/c/include/bits/i386-sysv/arch/stdio.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#define BUFSIZ        512
-#define FILENAME_MAX  256
-#define FOPEN_MAX      16
-
-#define TMP_MAX        25
-#define L_tmpnam      256
-
-#define _TMPNAME      "/tmp/tmp.0000000"
-
-typedef long fpos_t;
--- a/lib/c/include/bits/i386-sysv/arch/stdlib.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-
-#ifndef _WCHAR_T
-typedef int wchar_t;
-#define _WCHAR_T
-#endif
-
-#define _ALIGNTYPE long double
--- a/lib/c/include/bits/i386-sysv/arch/string.h
+++ /dev/null
@@ -1,3 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#endif
--- a/lib/c/include/bits/i386-sysv/arch/time.h
+++ /dev/null
@@ -1,6 +1,0 @@
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-
-typedef long int time_t;
--- a/lib/c/include/bits/z80-dos/arch/limits.h
+++ /dev/null
@@ -1,17 +1,0 @@
-#define SCHAR_MAX  0x7F
-#define SCHAR_MIN  (-SCHAR_MIN-1)
-#define CHAR_MAX   0xFF
-#define CHAR_MIN   0
-#define UCHAR_MAX  0xFF
-#define SHRT_MAX   0x7FFF
-#define SHRT_MIN   (-SHRT_MAX-1)
-#define USHRT_MAX  0xFFFF
-#define INT_MAX    0x7FFF
-#define INT_MIN    (-INT_MAX-1)
-#define UINT_MAX   0xFFFF
-#define LONG_MAX   0x7FFFFFFF
-#define LONG_MIN   (-LONG_MAX-1)
-#define ULONG_MAX  0xFFFFFFFF
-#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
-#define LLONG_MIN  (-LLONG_MAX-1)
-#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/lib/c/include/bits/z80-dos/arch/signal.h
+++ /dev/null
@@ -1,31 +1,0 @@
-typedef char sig_atomic_t;
-
-#define SIG_ERR    -1
-#define SIG_DFL     0
-#define SIG_IGN     1
-
-#define SIG_ERR    -1
-#define SIG_DFL     0
-#define SIG_IGN     1
-
-#define SIGHUP      1
-#define SIGINT      2
-#define SIGQUIT     3
-#define SIGILL      4
-#define SIGABRT     6
-#define SIGFPE      8
-#define SIGKILL     9
-#define SIGUSR1    10
-#define SIGSEGV    11
-#define SIGUSR2    12
-#define SIGPIPE    13
-#define SIGALRM    14
-#define SIGTERM    15
-#define SIGCHLD    17
-#define SIGCONT    18
-#define SIGSTOP    19
-#define SIGSSTP    20
-#define SIGTTIN    21
-#define SIGTTOU    22
-
-#define __NR_SIGNALS 23
--- a/lib/c/include/bits/z80-dos/arch/stddef.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned size_t;
-#define _SIZET
-#endif
-
-#ifndef _WCHAR_T
-typedef short wchar_t;
-#define _WCHAR_T
-#endif
-
-#ifndef _PTRDIFF_T
-typedef short ptrdiff_t;
-#define _PTRDIFF_T
-#endif
--- a/lib/c/include/bits/z80-dos/arch/stdint.h
+++ /dev/null
@@ -1,115 +1,0 @@
-#define INT8_MAX  0x7F
-#define INT8_MIN  (-INT8_MAX-1)
-#define UINT8_MAX 0xFF
-
-#define INT16_MAX  0x7FFF
-#define INT16_MIN  (-INT16_MAX-1)
-#define UINT16_MAX 0xFFFF
-
-#define INT32_MAX  0x7FFFFFFF
-#define INT32_MIN  (-INT32_MAX-1)
-#define UINT32_MAX 0xFFFFFFFF
-
-#define INT64_MAX  0x7FFFFFFFFFFFFFFF
-#define INT64_MIN  (-INT64_MAX-1)
-#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
-
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-
-#define INT_LEAST64_MIN  INT64_MIN
-#define INT_LEAST64_MAX  INT64_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-#define INT_FAST8_MIN  INT16_MIN
-#define INT_FAST8_MAX  INT16_MAX
-#define UINT_FAST8_MAX UINT16_MAX
-
-#define INT_FAST16_MIN  INT16_MIN
-#define INT_FAST16_MAX  INT16_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-
-#define INT_FAST32_MIN  INT32_MIN
-#define INT_FAST32_MAX  INT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INT_FAST64_MIN  INT64_MIN
-#define INT_FAST64_MAX  INT64_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-#define INTPTR_MIN  INT16_MIN
-#define INTPTR_MAX  INT16_MAX
-#define UINTPTR_MAX UINT16_MAX
-
-#define INTMAX_MIN  INT64_MIN
-#define INTMAX_MAX  INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-#define PTRDIFF_MIN INT16_MIN
-#define PTRDIFF_MAX INT16_MAX
-
-#define SIG_ATOMIC_MIN INT16_MIN
-#define SIG_ATOMIC_MAX INT16_MAX
-
-#define SIZE_MAX UINT64_MAX
-
-#define WCHAR_MIN INT16_MIN
-#define WCHAR_MAX INT16_MAX
-
-#define INT8_C(x)  x
-#define INT16_C(x) x
-#define INT32_C(x) x ## L
-#define INT64_C(x) x ## LL
-
-#define UINT8_C(x)  x
-#define UINT16_C(x) x ## U
-#define UINT32_C(x) x ## UL
-#define UINT64_C(x) x ## ULL
-
-#define INTMAX_C(x)  x ## LL
-#define UINTMAX_C(x) x ## ULL
-
-typedef signed char int8_t;
-typedef int int16_t;
-typedef long int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned uint16_t;
-typedef unsigned long uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_least_t;
-typedef int int16_least_t;
-typedef long int32_least_t;
-typedef long long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned uint16_least_t;
-typedef unsigned long uint32_least_t;
-typedef unsigned long long uint64_least_t;
-
-typedef signed char int8_fast_t;
-typedef int int16_fast_t;
-typedef long int32_fast_t;
-typedef long long int64_fast_t;
-
-typedef unsigned char uint8_fast_t;
-typedef unsigned uint16_fast_t;
-typedef unsigned long uint32_fast_t;
-typedef unsigned long long uint64_fast_t;
-
-typedef int intptr_t;
-typedef unsigned uintptr_t;
-
-typedef long long intmax_t;
-typedef unsigned long long uintmax_t;
--- a/lib/c/include/bits/z80-dos/arch/stdio.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#ifndef _SIZET
-typedef unsigned size_t;
-#define _SIZET
-#endif
-
-#define BUFSIZ        512
-#define FILENAME_MAX  256
-#define FOPEN_MAX      16
-
-#define TMP_MAX        25
-#define L_tmpnam      256
-
-#define _TMPNAME      "TMP.000"
-
-typedef long fpos_t;
--- a/lib/c/include/bits/z80-dos/arch/stdlib.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#ifndef _SIZET
-typedef unsigned size_t;
-#define _SIZET
-#endif
-
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-
-#ifndef _WCHAR_T
-typedef short wchar_t;
-#define _WCHAR_T
-#endif
-
-#define _ALIGNTYPE int
--- a/lib/c/include/bits/z80-dos/arch/string.h
+++ /dev/null
@@ -1,3 +1,0 @@
-#ifndef _SIZET
-typedef unsigned size_t;
-#endif
--- a/lib/c/include/bits/z80-dos/arch/time.h
+++ /dev/null
@@ -1,6 +1,0 @@
-#ifndef _SIZET
-typedef unsigned size_t;
-#define _SIZET
-#endif
-
-typedef long time_t;
--- a/lib/c/include/ctype.h
+++ /dev/null
@@ -1,52 +1,0 @@
-#ifndef _CTYPE_H
-#define _CTYPE_H
-
-extern int isalnum(int c);
-extern int isalpha(int c);
-extern int islower(int c);
-extern int isupper(int c);
-extern int isdigit(int c);
-extern int isxdigit(int c);
-extern int iscntrl(int c);
-extern int isgraph(int c);
-extern int isspace(int c);
-extern int isblank(int c);
-extern int isprint(int c);
-extern int ispunct(int c);
-extern int tolower(int c);
-extern int toupper(int c);
-
-#ifdef __USE_MACROS
-
-#define _U	0x01	/* upper */
-#define _L	0x02	/* lower */
-#define _D	0x04	/* digit */
-#define _C	0x08	/* cntrl */
-#define _P	0x10	/* punct */
-#define _S	0x20	/* white space (space/lf/tab) */
-#define _X	0x40	/* hex char */
-#define _SP	0x80	/* hard space (0x20) */
-
-extern unsigned char __ctype[];
-extern int __ctmp;
-
-#define isalnum(c)  ((__ctype+1)[c] & (_U|_L|_D))
-#define isalpha(c)  ((__ctype+1)[c] & (_U|_L))
-#define iscntrl(c)  ((__ctype+1)[c] & (_C))
-#define isdigit(c)  ((__ctype+1)[c] & (_D))
-#define isgraph(c)  ((__ctype+1)[c] & (_P|_U|_L|_D))
-#define islower(c)  ((__ctype+1)[c] & (_L))
-#define isprint(c)  ((__ctype+1)[c] & (_P|_U|_L|_D|_SP))
-#define ispunct(c)  ((__ctype+1)[c] & (_P))
-#define isspace(c)  ((__ctype+1)[c] & (_S))
-#define isupper(c)  ((__ctype+1)[c] & (_U))
-#define isxdigit(c) ((__ctype+1)[c] & (_D|_X))
-
-#define tolower(c) ((__ctmp=c, isupper(__ctmp) ? __ctmp | 0x20 : __ctmp))
-#define toupper(c) ((__ctmp=c, islower(__ctmp) ? __ctmp & ~0x20 : __ctmp))
-
-#define isascii(c) ((unsigned)(c)<=0x7f)
-
-#endif
-
-#endif
--- a/lib/c/include/errno.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#ifndef _ERRNO_H
-#define _ERRNO_H
-
-#define EDOM   1
-#define EILSEQ 2
-#define ERANGE 3
-#define ENOMEM 4
-#define EBADF  5
-#define EINVAL 6
-
-extern int errno;
-extern char *_sys_errlist[];
-extern int _sys_nerr;
-
-#endif
--- a/lib/c/include/limits.h
+++ /dev/null
@@ -1,9 +1,0 @@
-#ifndef _LIMITS_H
-#define _LIMITS_H
-
-#include <arch/limits.h>
-
-#define CHAR_BIT   8
-#define MB_LEN_MAX 1
-
-#endif
--- a/lib/c/include/locale.h
+++ /dev/null
@@ -1,45 +1,0 @@
-#ifndef _LOCALE_H
-#define _LOCALE_H
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#define LC_ALL      0
-#define LC_COLLATE  1
-#define LC_CTYPE    2
-#define LC_MONETARY 3
-#define LC_NUMERIC  4
-#define LC_TIME     5
-
-struct lconv {
-	char *decimal_point;
-	char *thousands_sep;
-	char *grouping;
-	char *mon_decimal_point;
-	char *mon_thousands_sep;
-	char *mon_grouping;
-	char *positive_sign;
-	char *negative_sign;
-	char *currency_symbol;
-	char *int_curr_symbol;
-	char frac_digits;
-	char p_cs_precedes;
-	char n_cs_precedes;
-	char p_sep_by_space;
-	char n_sep_by_space;
-	char p_sign_posn;
-	char n_sign_posn;
-	char int_frac_digits;
-	char int_p_cs_precedes;
-	char int_n_cs_precedes;
-	char int_p_sep_by_space;
-	char int_n_sep_by_space;
-	char int_p_sign_posn;
-	char int_n_sign_posn;
-};
-
-extern char *setlocale(int category, const char *locale);
-extern struct lconv *localeconv(void);
-
-#endif
--- a/lib/c/include/signal.h
+++ /dev/null
@@ -1,9 +1,0 @@
-#ifndef _SIGNAL_H
-#define _SIGNAL_H
-
-#include <arch/signal.h>
-
-void ( *signal(int signum, void (*handler)(int)) ) (int);
-int raise(int sig);
-
-#endif
--- a/lib/c/include/stdarg.h
+++ /dev/null
@@ -1,10 +1,0 @@
-#ifndef _STDARG_H
-#define _STDARG_H
-
-#define va_list __builtin_va_list
-#define va_start(ap, last) __builtin_va_start(ap, last)
-#define va_end(ap) __builtin_va_end(ap)
-#define va_copy(to, from) __builtin_va_copy(to, from)
-#define va_arg(to, type) __builtin_va_arg(to, type)
-
-#endif
--- a/lib/c/include/stdbool.h
+++ /dev/null
@@ -1,9 +1,0 @@
-#ifndef _STDBOOL_H
-#define _STDBOOL_H
-
-#define bool _Bool
-#define true 1
-#define false 0
-#define __bool_true_false_are_defined 1	
-
-#endif
--- a/lib/c/include/stddef.h
+++ /dev/null
@@ -1,12 +1,0 @@
-#ifndef _STDDEF_H
-#define _STDDEF_H
-
-#include <arch/stddef.h>
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#define offsetof(st, m) ((size_t)&(((st *)0)->m))
-
-#endif
--- a/lib/c/include/stdint.h
+++ /dev/null
@@ -1,6 +1,0 @@
-#ifndef _STDINT_H_
-#define _STDINT_H_
-
-#include <arch/stdint.h>
-
-#endif
--- a/lib/c/include/stdio.h
+++ /dev/null
@@ -1,127 +1,0 @@
-#ifndef _STDIO_H
-#define _STDIO_H
-
-#include <arch/stdio.h>
-
-#ifndef FOPEN_MAX
-#define FOPEN_MAX 12
-#endif
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#define EOF            -1
-#define SEEK_CUR        0
-#define SEEK_END        1
-#define SEEK_SET        2
-
-
-#define _IOWRITE        (1 << 0)
-#define _IOREAD         (1 << 1)
-#define _IORW           (1 << 2)
-#define _IOEOF          (1 << 3)
-#define _IOERR          (1 << 4)
-#define _IOSTRG         (1 << 5)
-#define _IOTXT          (1 << 6)
-#define _IOFBF          (1 << 7)
-#define _IOLBF          (1 << 8)
-#define _IONBF          (1 << 9)
-#define _IOALLOC        (1 <<10)
-
-typedef struct {
-	int fd;        	        /* file descriptor */
-	unsigned char *buf;     /* pointer to i/o buffer */
-	unsigned char *rp;      /* read pointer */
-	unsigned char *wp;      /* write pointer */
-	unsigned char *lp;      /* write pointer used when line-buffering */
-	size_t len;             /* actual length of buffer */
-	unsigned short flags;
-	unsigned char unbuf[1];  /* tiny buffer for unbuffered io */
-} FILE;
-
-extern FILE __iob[FOPEN_MAX];
-
-#define	stdin	(&__iob[0])
-#define	stdout	(&__iob[1])
-#define	stderr	(&__iob[2])
-
-extern int remove(const char *filename);
-extern int rename(const char *old, const char *new);
-extern FILE *tmpfile(void);
-extern char *tmpnam(char *s);
-extern int fclose(FILE *fp);
-extern int fflush(FILE *fp);
-extern FILE *fopen(const char * restrict fname, const char * restrict mode);
-extern FILE *freopen(const char * restrict fname, const char * restrict mode,
-                     FILE * restrict fp);
-extern void setbuf(FILE * restrict fp, char * restrict buf);
-extern int setvbuf(FILE * restrict fp,
-                   char * restrict buf, int mode, size_t size);
-extern int fprintf(FILE * restrict fp, const char * restrict fmt, ...);
-extern int fscanf(FILE * restrict fp, const char * restrict fmt, ...);
-extern int printf(const char * restrict fmt, ...);
-extern int scanf(const char * restrict fmt, ...);
-extern int snprintf(char * restrict s,
-                    size_t n, const char * restrict fmt, ...);
-extern int sprintf(char * restrict s, const char * restrict fmt, ...);
-extern int sscanf(const char * restrict s, const char * restrict fmt, ...);
-
-#ifdef _STDARG_H
-extern int vfprintf(FILE * restrict fp,
-                    const char * restrict fmt, va_list arg);
-extern int vfscanf(FILE * restrict fp,
-                   const char * restrict fmt, va_list arg);
-extern int vprintf(const char * restrict fmt, va_list arg);
-extern int vscanf(const char * restrict fmt, va_list arg);
-extern int vsnprintf(char * restrict s, size_t n, const char * restrict fmt,
-                     va_list arg);
-extern int vsprintf(char * restrict s,
-                    const char * restrict fmt, va_list arg);
-extern int vsscanf(const char * restrict s,
-                   const char * restrict fmt, va_list arg);
-#endif
-
-extern int fgetc(FILE *fp);
-extern char *fgets(char * restrict s, int n, FILE * restrict fp);
-extern int fputc(int c, FILE *fp);
-extern int fputs(const char * restrict s, FILE * restrict fp);
-extern int getc(FILE *fp);
-extern int getchar(void);
-extern char *gets(char *s);
-extern int putc(int c, FILE *fp);
-extern int putchar(int c);
-extern int puts(const char *s);
-extern int ungetc(int c, FILE *fp);
-extern size_t fread(void * restrict ptr, size_t size, size_t nmemb,
-             FILE * restrict fp);
-extern size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb,
-              FILE * restrict fp);
-extern int fgetpos(FILE * restrict fp, fpos_t * restrict pos);
-extern int fseek(FILE *fp, long int offset, int whence);
-extern int fsetpos(FILE *fp, const fpos_t *pos);
-extern long int ftell(FILE *fp);
-extern void rewind(FILE *fp);
-extern void clearerr(FILE *fp);
-extern int feof(FILE *fp);
-extern int ferror(FILE *fp);
-extern void perror(const char *s);
-
-extern int __getc(FILE *fp);
-extern int __putc(int, FILE *fp);
-
-#ifdef __USE_MACROS
-#ifdef __UNIX_FILES
-#define getc(fp)     ((fp)->rp >= (fp)->wp ?  __getc(fp) : *(fp)->rp++)
-#define putc(c, fp)  ((fp)->wp >= (fp)->rp ? __putc(c,fp) : (*(fp)->wp++ = c))
-#endif
-
-#define ferror(fp)          ((fp)->flags & _IOERR)
-#define feof(fp)            ((fp)->flags & _IOEOF)
-#define clearerr(fp)        (void) ((fp)->flags &= ~(_IOERR|_IOEOF))
-#define getchar()           getc(stdin)
-#define putchar(c)          putc((c), stdout)
-#define setbuf(fp, b)       (void) setvbuf(fp, b, b ? _IOFBF:_IONBF, BUFSIZ)
-#endif
-
-#endif
--- a/lib/c/include/stdlib.h
+++ /dev/null
@@ -1,79 +1,0 @@
-#ifndef _STDLIB_H
-#define _STDLIB_H
-
-#include <arch/stdlib.h>
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#define _ATEXIT_MAX 32
-
-#define MB_CUR_MAX 1
-#define RAND_MAX 32767
-
-typedef struct {
-	int quot, rem;
-} div_t;
-
-typedef struct {
-	long quot, rem;
-} ldiv_t;
-
-typedef struct {
-	long long quot, rem;
-} lldiv_t;
-
-extern double atof(const char *nptr);
-extern int atoi(const char *nptr);
-extern long int atol(const char *nptr);
-extern long long int atoll(const char *nptr);
-extern double strtod(const char * restrict nptr, char ** restrict endptr);
-extern float strtof(const char * restrict nptr, char ** restrict endptr);
-extern long double strtold(const char * restrict nptr, char ** restrict endptr);
-extern long int strtol(const char * restrict nptr, char ** restrict endptr, int base);
-extern long long int strtoll(const char * restrict nptr, char ** restrict endptr,
-                             int base);
-extern unsigned long int strtoul(const char * restrict nptr, char ** restrict endptr,
-                                 int base);
-extern unsigned long long int strtoull(const char * restrict nptr,
-                                       char ** restrict endptr, int base);
-extern int rand(void);
-extern void srand(unsigned int seed);
-extern void *calloc(size_t nmemb, size_t size);
-extern void free(void *ptr);
-extern void *malloc(size_t size);
-extern void *realloc(void *ptr, size_t size);
-extern void abort(void);
-extern int atexit(void (*func)(void));
-extern void exit(int status);
-extern void _Exit(int status);
-extern char *getenv(const char *name);
-extern int system(const char *string);
-extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
-                     int (*compar)(const void *, const void *));
-extern void qsort(void *base, size_t nmemb, size_t size,
-                  int (*compar)(const void *, const void *));
-extern int abs(int j);
-extern long int labs(long int j);
-extern long long int llabs(long long int j);
-extern div_t div(int numer, int denom);
-extern ldiv_t ldiv(long int numer, long int denom);
-extern lldiv_t lldiv(long long int numer, long long int denom);
-extern int mblen(const char *s, size_t n);
-extern int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n);
-extern int wctomb(char *s, wchar_t wchar);
-extern size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n);
-extern size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n);
-
-#ifdef __USE_MACROS
-extern int __abs;
-extern long __labs;
-extern long long __llabs;
-
-#define abs(x)   (__abs = (x), (__abs) < 0 ? -__abs :  __abs)
-#define labs(x)  (__labs = (x), (__labs) < 0 ? -__labs :  __labs)
-#define llabs(x) (__llabs = (x), (__llabs) < 0 ? -__llabs :  __llabs)
-#endif
-
-#endif
--- a/lib/c/include/string.h
+++ /dev/null
@@ -1,34 +1,0 @@
-#ifndef _STRING_H
-#define _STRING_H
-
-#include <arch/string.h>
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-extern void *memcpy(void * restrict s1, const void * restrict s2, size_t n);
-extern void *memmove(void *s1, const void *s2, size_t n);
-extern char *strcpy(char * restrict s1, const char * restrict s2);
-extern char *strncpy(char * restrict s1, const char * restrict s2, size_t n);
-extern char *strcat(char * restrict s1, const char * restrict s2);
-extern char *strncat(char * restrict s1, const char * restrict s2, size_t n);
-extern int memcmp(const void *s1, const void *s2, size_t n);
-extern int strcmp(const char *s1, const char *s2);
-extern int strcoll(const char *s1, const char *s2);
-extern int strncmp(const char *s1, const char *s2, size_t n);
-extern size_t strxfrm(char * restrict s1, const char * restrict s2, size_t n);
-extern void *memchr(const void *s, int c, size_t n);
-extern char *strchr(const char *s, int c);
-extern size_t strcspn(const char *s1, const char *s2);
-extern char *strpbrk(const char *s1, const char *s2);
-extern char *strrchr(const char *s, int c);
-extern size_t strspn(const char *s1, const char *s2);
-extern char *strstr(const char *s1, const char *s2);
-extern char *strtok(char * restrict s1, const char * restrict s2);
-extern void *memset(void *s, int c, size_t n);
-extern char *strerror(int errnum);
-extern size_t strlen(const char *s);
-extern size_t strnlen(const char *s, size_t maxlen);
-
-#endif
--- a/lib/c/include/time.h
+++ /dev/null
@@ -1,38 +1,0 @@
-#ifndef _TIME_H
-#define _TIME_H
-
-#include <arch/time.h>
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#define CLOCKS_PER_SEC 1000000
-
-typedef long int clock_t;
-
-struct tm {
-	int tm_sec;
-	int tm_min;
-	int tm_hour;
-	int tm_mday;
-	int tm_mon;
-	int tm_year;
-	int tm_wday;
-	int tm_yday;
-	int tm_isdst;
-};
-
-extern clock_t clock(void);
-extern double difftime(time_t time1, time_t time0);
-extern time_t mktime(struct tm *timeptr);
-extern time_t time(time_t *timer);
-extern char *asctime(const struct tm *timeptr);
-extern char *ctime(const time_t *timer);
-extern struct tm *gmtime(const time_t *timer);
-extern struct tm *localtime(const time_t *timer);
-extern size_t strftime(char * restrict s, size_t maxsize,
-                       const char * restrict format,
-                       const struct tm * restrict timeptr);
-
-#endif
--- a/lib/c/include/wchar.h
+++ /dev/null
@@ -1,12 +1,0 @@
-#ifndef _WCHAR_H_
-#define _WCHAR_H_
-
-
-/* TODO: This is only a placeholder */
-typedef long wchar_t;
-typedef long wint_t;
-
-extern size_t wcsnlen(const wchar_t *s, size_t maxlen);
-extern wint_t putwc(wchar_t wc, FILE *fp);
-
-#endif
--- a/lib/c/target/amd64-sysv-linux-elf/Makefile
+++ b/lib/c/target/amd64-sysv-linux-elf/Makefile
@@ -7,7 +7,7 @@
 include syscall.mk
 include ../script/common.mk
 
-SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/amd64-sysv/
+SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
 
 dep:
 	../script/syscall.sh
--- a/lib/c/target/amd64-sysv-openbsd-elf/Makefile
+++ b/lib/c/target/amd64-sysv-openbsd-elf/Makefile
@@ -6,4 +6,4 @@
 include ../script/objlst.mk
 include ../script/common.mk
 
-SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/amd64-sysv/
+SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
--- /dev/null
+++ b/rootdir/include/scc/assert.h
@@ -1,0 +1,10 @@
+
+void __assert(char *exp, char *file, long line);
+
+#undef assert
+#ifndef NDEBUG
+# define assert(exp) ((exp) ? (void) 0 : __assert(#exp, __FILE__, __LINE__))
+#else
+# define assert(exp) ((void)0)
+#endif
+
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/limits.h
@@ -1,0 +1,17 @@
+#define SCHAR_MAX  0x7F
+#define SCHAR_MIN  (-SCHAR_MIN-1)
+#define CHAR_MAX   0x7F
+#define CHAR_MIN   (-CHAR_MAX-1)
+#define UCHAR_MAX  0xFF
+#define SHRT_MAX   0x7FFF
+#define SHRT_MIN   (-SHRT_MAX-1)
+#define USHRT_MAX  0xFFFF
+#define INT_MAX    0x7FFFFFFF
+#define INT_MIN    (-INT_MAX-1)
+#define UINT_MAX   0xFFFFFFFF
+#define LONG_MAX   0x7FFFFFFFFFFFFFFF
+#define LONG_MIN   (-LONG_MAX-1)
+#define ULONG_MAX  0xFFFFFFFFFFFFFFFF
+#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN  (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/signal.h
@@ -1,0 +1,27 @@
+typedef int sig_atomic_t;
+
+#define SIG_ERR    -1
+#define SIG_DFL     0
+#define SIG_IGN     1
+
+#define SIGHUP      1
+#define SIGINT      2
+#define SIGQUIT     3
+#define SIGILL      4
+#define SIGABRT     6
+#define SIGFPE      8
+#define SIGKILL     9
+#define SIGUSR1    10
+#define SIGSEGV    11
+#define SIGUSR2    12
+#define SIGPIPE    13
+#define SIGALRM    14
+#define SIGTERM    15
+#define SIGCHLD    17
+#define SIGCONT    18
+#define SIGSTOP    19
+#define SIGSSTP    20
+#define SIGTTIN    21
+#define SIGTTOU    22
+
+#define __NR_SIGNALS 23
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/stddef.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef int wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef long ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/stdint.h
@@ -1,0 +1,115 @@
+#define INT8_MAX  0x7F
+#define INT8_MIN  (-INT8_MAX-1)
+#define UINT8_MAX 0xFF
+
+#define INT16_MAX  0x7FFF
+#define INT16_MIN  (-INT16_MAX-1)
+#define UINT16_MAX 0xFFFF
+
+#define INT32_MAX  0x7FFFFFFF
+#define INT32_MIN  (-INT32_MAX-1)
+#define UINT32_MAX 0xFFFFFFFF
+
+#define INT64_MAX  0x7FFFFFFFFFFFFFFF
+#define INT64_MIN  (-INT64_MAX-1)
+#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+
+#define INT_LEAST8_MIN  INT8_MIN
+#define INT_LEAST8_MAX  INT8_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+
+#define INT_LEAST16_MIN  INT16_MIN
+#define INT_LEAST16_MAX  INT16_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+
+#define INT_LEAST32_MIN  INT32_MIN
+#define INT_LEAST32_MAX  INT32_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+
+#define INT_LEAST64_MIN  INT64_MIN
+#define INT_LEAST64_MAX  INT64_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT_FAST8_MIN  INT32_MIN
+#define INT_FAST8_MAX  INT32_MAX
+#define UINT_FAST8_MAX UINT32_MAX
+
+#define INT_FAST16_MIN  INT32_MIN
+#define INT_FAST16_MAX  INT32_MAX
+#define UINT_FAST16_MAX UINT32_MAX
+
+#define INT_FAST32_MIN  INT32_MIN
+#define INT_FAST32_MAX  INT32_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+
+#define INT_FAST64_MIN  INT64_MIN
+#define INT_FAST64_MAX  INT64_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#define INTPTR_MIN  INT64_MIN
+#define INTPTR_MAX  INT64_MAX
+#define UINTPTR_MAX UINT64_MAX
+
+#define INTMAX_MIN  INT64_MIN
+#define INTMAX_MAX  INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#define PTRDIFF_MIN INT64_MIN
+#define PTRDIFF_MAX INT64_MAX
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#define SIZE_MAX UINT64_MAX
+
+#define WCHAR_MIN INT32_MIN
+#define WCHAR_MAX INT32_MAX
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x
+#define INT64_C(x) x ## L
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x
+#define UINT32_C(x) x ## U
+#define UINT64_C(x) x ## UL
+
+#define INTMAX_C(x)  x ## L
+#define UINTMAX_C(x) x ## UL
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned uint32_t;
+typedef unsigned long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned uint32_least_t;
+typedef unsigned long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long int64_fast_t;
+
+typedef unsigned uint8_fast_t;
+typedef unsigned uint16_fast_t;
+typedef unsigned uint32_fast_t;
+typedef unsigned long uint64_fast_t;
+
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/stdio.h
@@ -1,0 +1,15 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#define BUFSIZ        512
+#define FILENAME_MAX  256
+#define FOPEN_MAX      16
+
+#define TMP_MAX        25
+#define L_tmpnam      256
+
+#define _TMPNAME      "/tmp/tmp.0000000"
+
+typedef int fpos_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/stdlib.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+#ifndef _WCHAR_T
+typedef int wchar_t;
+#define _WCHAR_T
+#endif
+
+#define _ALIGNTYPE long double
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/string.h
@@ -1,0 +1,3 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/amd64-sysv/arch/time.h
@@ -1,0 +1,6 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+typedef long int time_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/limits.h
@@ -1,0 +1,17 @@
+#define SCHAR_MAX  0x7F
+#define SCHAR_MIN  (-SCHAR_MIN-1)
+#define CHAR_MAX   0x7F
+#define CHAR_MIN   (-CHAR_MAX-1)
+#define UCHAR_MAX  0xFF
+#define SHRT_MAX   0x7FFF
+#define SHRT_MIN   (-SHRT_MAX-1)
+#define USHRT_MAX  0xFFFF
+#define INT_MAX    0x7FFFFFFF
+#define INT_MIN    (-INT_MAX-1)
+#define UINT_MAX   0xFFFFFFFF
+#define LONG_MAX   0x7FFFFFFF
+#define LONG_MIN   (-LONG_MAX-1)
+#define ULONG_MAX  0xFFFFFFFF
+#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN  (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/signal.h
@@ -1,0 +1,27 @@
+typedef int sig_atomic_t;
+
+#define SIG_ERR    -1
+#define SIG_DFL     0
+#define SIG_IGN     1
+
+#define SIGHUP      1
+#define SIGINT      2
+#define SIGQUIT     3
+#define SIGILL      4
+#define SIGABRT     6
+#define SIGFPE      8
+#define SIGKILL     9
+#define SIGUSR1    10
+#define SIGSEGV    11
+#define SIGUSR2    12
+#define SIGPIPE    13
+#define SIGALRM    14
+#define SIGTERM    15
+#define SIGCHLD    17
+#define SIGCONT    18
+#define SIGSTOP    19
+#define SIGSSTP    20
+#define SIGTTIN    21
+#define SIGTTOU    22
+
+#define __NR_SIGNALS 23
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/stddef.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef int wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef long ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/stdint.h
@@ -1,0 +1,115 @@
+#define INT8_MAX  0x7F
+#define INT8_MIN  (-INT8_MAX-1)
+#define UINT8_MAX 0xFF
+
+#define INT16_MAX  0x7FFF
+#define INT16_MIN  (-INT16_MAX-1)
+#define UINT16_MAX 0xFFFF
+
+#define INT32_MAX  0x7FFFFFFF
+#define INT32_MIN  (-INT32_MAX-1)
+#define UINT32_MAX 0xFFFFFFFF
+
+#define INT64_MAX  0x7FFFFFFFFFFFFFFF
+#define INT64_MIN  (-INT64_MAX-1)
+#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+
+#define INT_LEAST8_MIN  INT8_MIN
+#define INT_LEAST8_MAX  INT8_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+
+#define INT_LEAST16_MIN  INT16_MIN
+#define INT_LEAST16_MAX  INT16_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+
+#define INT_LEAST32_MIN  INT32_MIN
+#define INT_LEAST32_MAX  INT32_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+
+#define INT_LEAST64_MIN  INT64_MIN
+#define INT_LEAST64_MAX  INT64_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT_FAST8_MIN  INT32_MIN
+#define INT_FAST8_MAX  INT32_MAX
+#define UINT_FAST8_MAX UINT32_MAX
+
+#define INT_FAST16_MIN  INT32_MIN
+#define INT_FAST16_MAX  INT32_MAX
+#define UINT_FAST16_MAX UINT32_MAX
+
+#define INT_FAST32_MIN  INT32_MIN
+#define INT_FAST32_MAX  INT32_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+
+#define INT_FAST64_MIN  INT64_MIN
+#define INT_FAST64_MAX  INT64_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#define INTPTR_MIN  INT32_MIN
+#define INTPTR_MAX  INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
+
+#define INTMAX_MIN  INT64_MIN
+#define INTMAX_MAX  INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#define SIZE_MAX UINT32_MAX
+
+#define WCHAR_MIN INT32_MIN
+#define WCHAR_MAX INT32_MAX
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x
+#define INT64_C(x) x ## LL
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x
+#define UINT32_C(x) x ## U
+#define UINT64_C(x) x ## ULL
+
+#define INTMAX_C(x)  x ## LL
+#define UINTMAX_C(x) x ## ULL
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned uint32_least_t;
+typedef unsigned long long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long long int64_fast_t;
+
+typedef unsigned uint8_fast_t;
+typedef unsigned uint16_fast_t;
+typedef unsigned uint32_fast_t;
+typedef unsigned long long uint64_fast_t;
+
+typedef int intptr_t;
+typedef unsigned uintptr_t;
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/stdio.h
@@ -1,0 +1,15 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#define BUFSIZ        512
+#define FILENAME_MAX  256
+#define FOPEN_MAX      16
+
+#define TMP_MAX        25
+#define L_tmpnam      256
+
+#define _TMPNAME      "/tmp/tmp.0000000"
+
+typedef long fpos_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/stdlib.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+#ifndef _WCHAR_T
+typedef int wchar_t;
+#define _WCHAR_T
+#endif
+
+#define _ALIGNTYPE long double
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/string.h
@@ -1,0 +1,3 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/i386-sysv/arch/time.h
@@ -1,0 +1,6 @@
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+typedef long int time_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/limits.h
@@ -1,0 +1,17 @@
+#define SCHAR_MAX  0x7F
+#define SCHAR_MIN  (-SCHAR_MIN-1)
+#define CHAR_MAX   0xFF
+#define CHAR_MIN   0
+#define UCHAR_MAX  0xFF
+#define SHRT_MAX   0x7FFF
+#define SHRT_MIN   (-SHRT_MAX-1)
+#define USHRT_MAX  0xFFFF
+#define INT_MAX    0x7FFF
+#define INT_MIN    (-INT_MAX-1)
+#define UINT_MAX   0xFFFF
+#define LONG_MAX   0x7FFFFFFF
+#define LONG_MIN   (-LONG_MAX-1)
+#define ULONG_MAX  0xFFFFFFFF
+#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN  (-LLONG_MAX-1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/signal.h
@@ -1,0 +1,31 @@
+typedef char sig_atomic_t;
+
+#define SIG_ERR    -1
+#define SIG_DFL     0
+#define SIG_IGN     1
+
+#define SIG_ERR    -1
+#define SIG_DFL     0
+#define SIG_IGN     1
+
+#define SIGHUP      1
+#define SIGINT      2
+#define SIGQUIT     3
+#define SIGILL      4
+#define SIGABRT     6
+#define SIGFPE      8
+#define SIGKILL     9
+#define SIGUSR1    10
+#define SIGSEGV    11
+#define SIGUSR2    12
+#define SIGPIPE    13
+#define SIGALRM    14
+#define SIGTERM    15
+#define SIGCHLD    17
+#define SIGCONT    18
+#define SIGSTOP    19
+#define SIGSSTP    20
+#define SIGTTIN    21
+#define SIGTTOU    22
+
+#define __NR_SIGNALS 23
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/stddef.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef short ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/stdint.h
@@ -1,0 +1,115 @@
+#define INT8_MAX  0x7F
+#define INT8_MIN  (-INT8_MAX-1)
+#define UINT8_MAX 0xFF
+
+#define INT16_MAX  0x7FFF
+#define INT16_MIN  (-INT16_MAX-1)
+#define UINT16_MAX 0xFFFF
+
+#define INT32_MAX  0x7FFFFFFF
+#define INT32_MIN  (-INT32_MAX-1)
+#define UINT32_MAX 0xFFFFFFFF
+
+#define INT64_MAX  0x7FFFFFFFFFFFFFFF
+#define INT64_MIN  (-INT64_MAX-1)
+#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+
+#define INT_LEAST8_MIN  INT8_MIN
+#define INT_LEAST8_MAX  INT8_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+
+#define INT_LEAST16_MIN  INT16_MIN
+#define INT_LEAST16_MAX  INT16_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+
+#define INT_LEAST32_MIN  INT32_MIN
+#define INT_LEAST32_MAX  INT32_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+
+#define INT_LEAST64_MIN  INT64_MIN
+#define INT_LEAST64_MAX  INT64_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT_FAST8_MIN  INT16_MIN
+#define INT_FAST8_MAX  INT16_MAX
+#define UINT_FAST8_MAX UINT16_MAX
+
+#define INT_FAST16_MIN  INT16_MIN
+#define INT_FAST16_MAX  INT16_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+
+#define INT_FAST32_MIN  INT32_MIN
+#define INT_FAST32_MAX  INT32_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+
+#define INT_FAST64_MIN  INT64_MIN
+#define INT_FAST64_MAX  INT64_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#define INTPTR_MIN  INT16_MIN
+#define INTPTR_MAX  INT16_MAX
+#define UINTPTR_MAX UINT16_MAX
+
+#define INTMAX_MIN  INT64_MIN
+#define INTMAX_MAX  INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#define PTRDIFF_MIN INT16_MIN
+#define PTRDIFF_MAX INT16_MAX
+
+#define SIG_ATOMIC_MIN INT16_MIN
+#define SIG_ATOMIC_MAX INT16_MAX
+
+#define SIZE_MAX UINT64_MAX
+
+#define WCHAR_MIN INT16_MIN
+#define WCHAR_MAX INT16_MAX
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x ## L
+#define INT64_C(x) x ## LL
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x ## U
+#define UINT32_C(x) x ## UL
+#define UINT64_C(x) x ## ULL
+
+#define INTMAX_C(x)  x ## LL
+#define UINTMAX_C(x) x ## ULL
+
+typedef signed char int8_t;
+typedef int int16_t;
+typedef long int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned uint16_t;
+typedef unsigned long uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char int8_least_t;
+typedef int int16_least_t;
+typedef long int32_least_t;
+typedef long long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned uint16_least_t;
+typedef unsigned long uint32_least_t;
+typedef unsigned long long uint64_least_t;
+
+typedef signed char int8_fast_t;
+typedef int int16_fast_t;
+typedef long int32_fast_t;
+typedef long long int64_fast_t;
+
+typedef unsigned char uint8_fast_t;
+typedef unsigned uint16_fast_t;
+typedef unsigned long uint32_fast_t;
+typedef unsigned long long uint64_fast_t;
+
+typedef int intptr_t;
+typedef unsigned uintptr_t;
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/stdio.h
@@ -1,0 +1,15 @@
+#ifndef _SIZET
+typedef unsigned size_t;
+#define _SIZET
+#endif
+
+#define BUFSIZ        512
+#define FILENAME_MAX  256
+#define FOPEN_MAX      16
+
+#define TMP_MAX        25
+#define L_tmpnam      256
+
+#define _TMPNAME      "TMP.000"
+
+typedef long fpos_t;
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/stdlib.h
@@ -1,0 +1,14 @@
+#ifndef _SIZET
+typedef unsigned size_t;
+#define _SIZET
+#endif
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#define _ALIGNTYPE int
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/string.h
@@ -1,0 +1,3 @@
+#ifndef _SIZET
+typedef unsigned size_t;
+#endif
--- /dev/null
+++ b/rootdir/include/scc/bits/z80-dos/arch/time.h
@@ -1,0 +1,6 @@
+#ifndef _SIZET
+typedef unsigned size_t;
+#define _SIZET
+#endif
+
+typedef long time_t;
--- /dev/null
+++ b/rootdir/include/scc/ctype.h
@@ -1,0 +1,52 @@
+#ifndef _CTYPE_H
+#define _CTYPE_H
+
+extern int isalnum(int c);
+extern int isalpha(int c);
+extern int islower(int c);
+extern int isupper(int c);
+extern int isdigit(int c);
+extern int isxdigit(int c);
+extern int iscntrl(int c);
+extern int isgraph(int c);
+extern int isspace(int c);
+extern int isblank(int c);
+extern int isprint(int c);
+extern int ispunct(int c);
+extern int tolower(int c);
+extern int toupper(int c);
+
+#ifdef __USE_MACROS
+
+#define _U	0x01	/* upper */
+#define _L	0x02	/* lower */
+#define _D	0x04	/* digit */
+#define _C	0x08	/* cntrl */
+#define _P	0x10	/* punct */
+#define _S	0x20	/* white space (space/lf/tab) */
+#define _X	0x40	/* hex char */
+#define _SP	0x80	/* hard space (0x20) */
+
+extern unsigned char __ctype[];
+extern int __ctmp;
+
+#define isalnum(c)  ((__ctype+1)[c] & (_U|_L|_D))
+#define isalpha(c)  ((__ctype+1)[c] & (_U|_L))
+#define iscntrl(c)  ((__ctype+1)[c] & (_C))
+#define isdigit(c)  ((__ctype+1)[c] & (_D))
+#define isgraph(c)  ((__ctype+1)[c] & (_P|_U|_L|_D))
+#define islower(c)  ((__ctype+1)[c] & (_L))
+#define isprint(c)  ((__ctype+1)[c] & (_P|_U|_L|_D|_SP))
+#define ispunct(c)  ((__ctype+1)[c] & (_P))
+#define isspace(c)  ((__ctype+1)[c] & (_S))
+#define isupper(c)  ((__ctype+1)[c] & (_U))
+#define isxdigit(c) ((__ctype+1)[c] & (_D|_X))
+
+#define tolower(c) ((__ctmp=c, isupper(__ctmp) ? __ctmp | 0x20 : __ctmp))
+#define toupper(c) ((__ctmp=c, islower(__ctmp) ? __ctmp & ~0x20 : __ctmp))
+
+#define isascii(c) ((unsigned)(c)<=0x7f)
+
+#endif
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/errno.h
@@ -1,0 +1,15 @@
+#ifndef _ERRNO_H
+#define _ERRNO_H
+
+#define EDOM   1
+#define EILSEQ 2
+#define ERANGE 3
+#define ENOMEM 4
+#define EBADF  5
+#define EINVAL 6
+
+extern int errno;
+extern char *_sys_errlist[];
+extern int _sys_nerr;
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/limits.h
@@ -1,0 +1,9 @@
+#ifndef _LIMITS_H
+#define _LIMITS_H
+
+#include <arch/limits.h>
+
+#define CHAR_BIT   8
+#define MB_LEN_MAX 1
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/locale.h
@@ -1,0 +1,45 @@
+#ifndef _LOCALE_H
+#define _LOCALE_H
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#define LC_ALL      0
+#define LC_COLLATE  1
+#define LC_CTYPE    2
+#define LC_MONETARY 3
+#define LC_NUMERIC  4
+#define LC_TIME     5
+
+struct lconv {
+	char *decimal_point;
+	char *thousands_sep;
+	char *grouping;
+	char *mon_decimal_point;
+	char *mon_thousands_sep;
+	char *mon_grouping;
+	char *positive_sign;
+	char *negative_sign;
+	char *currency_symbol;
+	char *int_curr_symbol;
+	char frac_digits;
+	char p_cs_precedes;
+	char n_cs_precedes;
+	char p_sep_by_space;
+	char n_sep_by_space;
+	char p_sign_posn;
+	char n_sign_posn;
+	char int_frac_digits;
+	char int_p_cs_precedes;
+	char int_n_cs_precedes;
+	char int_p_sep_by_space;
+	char int_n_sep_by_space;
+	char int_p_sign_posn;
+	char int_n_sign_posn;
+};
+
+extern char *setlocale(int category, const char *locale);
+extern struct lconv *localeconv(void);
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/signal.h
@@ -1,0 +1,9 @@
+#ifndef _SIGNAL_H
+#define _SIGNAL_H
+
+#include <arch/signal.h>
+
+void ( *signal(int signum, void (*handler)(int)) ) (int);
+int raise(int sig);
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stdarg.h
@@ -1,0 +1,10 @@
+#ifndef _STDARG_H
+#define _STDARG_H
+
+#define va_list __builtin_va_list
+#define va_start(ap, last) __builtin_va_start(ap, last)
+#define va_end(ap) __builtin_va_end(ap)
+#define va_copy(to, from) __builtin_va_copy(to, from)
+#define va_arg(to, type) __builtin_va_arg(to, type)
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stdbool.h
@@ -1,0 +1,9 @@
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+#define bool _Bool
+#define true 1
+#define false 0
+#define __bool_true_false_are_defined 1	
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stddef.h
@@ -1,0 +1,12 @@
+#ifndef _STDDEF_H
+#define _STDDEF_H
+
+#include <arch/stddef.h>
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#define offsetof(st, m) ((size_t)&(((st *)0)->m))
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stdint.h
@@ -1,0 +1,6 @@
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+#include <arch/stdint.h>
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stdio.h
@@ -1,0 +1,127 @@
+#ifndef _STDIO_H
+#define _STDIO_H
+
+#include <arch/stdio.h>
+
+#ifndef FOPEN_MAX
+#define FOPEN_MAX 12
+#endif
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#define EOF            -1
+#define SEEK_CUR        0
+#define SEEK_END        1
+#define SEEK_SET        2
+
+
+#define _IOWRITE        (1 << 0)
+#define _IOREAD         (1 << 1)
+#define _IORW           (1 << 2)
+#define _IOEOF          (1 << 3)
+#define _IOERR          (1 << 4)
+#define _IOSTRG         (1 << 5)
+#define _IOTXT          (1 << 6)
+#define _IOFBF          (1 << 7)
+#define _IOLBF          (1 << 8)
+#define _IONBF          (1 << 9)
+#define _IOALLOC        (1 <<10)
+
+typedef struct {
+	int fd;        	        /* file descriptor */
+	unsigned char *buf;     /* pointer to i/o buffer */
+	unsigned char *rp;      /* read pointer */
+	unsigned char *wp;      /* write pointer */
+	unsigned char *lp;      /* write pointer used when line-buffering */
+	size_t len;             /* actual length of buffer */
+	unsigned short flags;
+	unsigned char unbuf[1];  /* tiny buffer for unbuffered io */
+} FILE;
+
+extern FILE __iob[FOPEN_MAX];
+
+#define	stdin	(&__iob[0])
+#define	stdout	(&__iob[1])
+#define	stderr	(&__iob[2])
+
+extern int remove(const char *filename);
+extern int rename(const char *old, const char *new);
+extern FILE *tmpfile(void);
+extern char *tmpnam(char *s);
+extern int fclose(FILE *fp);
+extern int fflush(FILE *fp);
+extern FILE *fopen(const char * restrict fname, const char * restrict mode);
+extern FILE *freopen(const char * restrict fname, const char * restrict mode,
+                     FILE * restrict fp);
+extern void setbuf(FILE * restrict fp, char * restrict buf);
+extern int setvbuf(FILE * restrict fp,
+                   char * restrict buf, int mode, size_t size);
+extern int fprintf(FILE * restrict fp, const char * restrict fmt, ...);
+extern int fscanf(FILE * restrict fp, const char * restrict fmt, ...);
+extern int printf(const char * restrict fmt, ...);
+extern int scanf(const char * restrict fmt, ...);
+extern int snprintf(char * restrict s,
+                    size_t n, const char * restrict fmt, ...);
+extern int sprintf(char * restrict s, const char * restrict fmt, ...);
+extern int sscanf(const char * restrict s, const char * restrict fmt, ...);
+
+#ifdef _STDARG_H
+extern int vfprintf(FILE * restrict fp,
+                    const char * restrict fmt, va_list arg);
+extern int vfscanf(FILE * restrict fp,
+                   const char * restrict fmt, va_list arg);
+extern int vprintf(const char * restrict fmt, va_list arg);
+extern int vscanf(const char * restrict fmt, va_list arg);
+extern int vsnprintf(char * restrict s, size_t n, const char * restrict fmt,
+                     va_list arg);
+extern int vsprintf(char * restrict s,
+                    const char * restrict fmt, va_list arg);
+extern int vsscanf(const char * restrict s,
+                   const char * restrict fmt, va_list arg);
+#endif
+
+extern int fgetc(FILE *fp);
+extern char *fgets(char * restrict s, int n, FILE * restrict fp);
+extern int fputc(int c, FILE *fp);
+extern int fputs(const char * restrict s, FILE * restrict fp);
+extern int getc(FILE *fp);
+extern int getchar(void);
+extern char *gets(char *s);
+extern int putc(int c, FILE *fp);
+extern int putchar(int c);
+extern int puts(const char *s);
+extern int ungetc(int c, FILE *fp);
+extern size_t fread(void * restrict ptr, size_t size, size_t nmemb,
+             FILE * restrict fp);
+extern size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb,
+              FILE * restrict fp);
+extern int fgetpos(FILE * restrict fp, fpos_t * restrict pos);
+extern int fseek(FILE *fp, long int offset, int whence);
+extern int fsetpos(FILE *fp, const fpos_t *pos);
+extern long int ftell(FILE *fp);
+extern void rewind(FILE *fp);
+extern void clearerr(FILE *fp);
+extern int feof(FILE *fp);
+extern int ferror(FILE *fp);
+extern void perror(const char *s);
+
+extern int __getc(FILE *fp);
+extern int __putc(int, FILE *fp);
+
+#ifdef __USE_MACROS
+#ifdef __UNIX_FILES
+#define getc(fp)     ((fp)->rp >= (fp)->wp ?  __getc(fp) : *(fp)->rp++)
+#define putc(c, fp)  ((fp)->wp >= (fp)->rp ? __putc(c,fp) : (*(fp)->wp++ = c))
+#endif
+
+#define ferror(fp)          ((fp)->flags & _IOERR)
+#define feof(fp)            ((fp)->flags & _IOEOF)
+#define clearerr(fp)        (void) ((fp)->flags &= ~(_IOERR|_IOEOF))
+#define getchar()           getc(stdin)
+#define putchar(c)          putc((c), stdout)
+#define setbuf(fp, b)       (void) setvbuf(fp, b, b ? _IOFBF:_IONBF, BUFSIZ)
+#endif
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/stdlib.h
@@ -1,0 +1,79 @@
+#ifndef _STDLIB_H
+#define _STDLIB_H
+
+#include <arch/stdlib.h>
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#define _ATEXIT_MAX 32
+
+#define MB_CUR_MAX 1
+#define RAND_MAX 32767
+
+typedef struct {
+	int quot, rem;
+} div_t;
+
+typedef struct {
+	long quot, rem;
+} ldiv_t;
+
+typedef struct {
+	long long quot, rem;
+} lldiv_t;
+
+extern double atof(const char *nptr);
+extern int atoi(const char *nptr);
+extern long int atol(const char *nptr);
+extern long long int atoll(const char *nptr);
+extern double strtod(const char * restrict nptr, char ** restrict endptr);
+extern float strtof(const char * restrict nptr, char ** restrict endptr);
+extern long double strtold(const char * restrict nptr, char ** restrict endptr);
+extern long int strtol(const char * restrict nptr, char ** restrict endptr, int base);
+extern long long int strtoll(const char * restrict nptr, char ** restrict endptr,
+                             int base);
+extern unsigned long int strtoul(const char * restrict nptr, char ** restrict endptr,
+                                 int base);
+extern unsigned long long int strtoull(const char * restrict nptr,
+                                       char ** restrict endptr, int base);
+extern int rand(void);
+extern void srand(unsigned int seed);
+extern void *calloc(size_t nmemb, size_t size);
+extern void free(void *ptr);
+extern void *malloc(size_t size);
+extern void *realloc(void *ptr, size_t size);
+extern void abort(void);
+extern int atexit(void (*func)(void));
+extern void exit(int status);
+extern void _Exit(int status);
+extern char *getenv(const char *name);
+extern int system(const char *string);
+extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
+                     int (*compar)(const void *, const void *));
+extern void qsort(void *base, size_t nmemb, size_t size,
+                  int (*compar)(const void *, const void *));
+extern int abs(int j);
+extern long int labs(long int j);
+extern long long int llabs(long long int j);
+extern div_t div(int numer, int denom);
+extern ldiv_t ldiv(long int numer, long int denom);
+extern lldiv_t lldiv(long long int numer, long long int denom);
+extern int mblen(const char *s, size_t n);
+extern int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n);
+extern int wctomb(char *s, wchar_t wchar);
+extern size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n);
+extern size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n);
+
+#ifdef __USE_MACROS
+extern int __abs;
+extern long __labs;
+extern long long __llabs;
+
+#define abs(x)   (__abs = (x), (__abs) < 0 ? -__abs :  __abs)
+#define labs(x)  (__labs = (x), (__labs) < 0 ? -__labs :  __labs)
+#define llabs(x) (__llabs = (x), (__llabs) < 0 ? -__llabs :  __llabs)
+#endif
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/string.h
@@ -1,0 +1,34 @@
+#ifndef _STRING_H
+#define _STRING_H
+
+#include <arch/string.h>
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+extern void *memcpy(void * restrict s1, const void * restrict s2, size_t n);
+extern void *memmove(void *s1, const void *s2, size_t n);
+extern char *strcpy(char * restrict s1, const char * restrict s2);
+extern char *strncpy(char * restrict s1, const char * restrict s2, size_t n);
+extern char *strcat(char * restrict s1, const char * restrict s2);
+extern char *strncat(char * restrict s1, const char * restrict s2, size_t n);
+extern int memcmp(const void *s1, const void *s2, size_t n);
+extern int strcmp(const char *s1, const char *s2);
+extern int strcoll(const char *s1, const char *s2);
+extern int strncmp(const char *s1, const char *s2, size_t n);
+extern size_t strxfrm(char * restrict s1, const char * restrict s2, size_t n);
+extern void *memchr(const void *s, int c, size_t n);
+extern char *strchr(const char *s, int c);
+extern size_t strcspn(const char *s1, const char *s2);
+extern char *strpbrk(const char *s1, const char *s2);
+extern char *strrchr(const char *s, int c);
+extern size_t strspn(const char *s1, const char *s2);
+extern char *strstr(const char *s1, const char *s2);
+extern char *strtok(char * restrict s1, const char * restrict s2);
+extern void *memset(void *s, int c, size_t n);
+extern char *strerror(int errnum);
+extern size_t strlen(const char *s);
+extern size_t strnlen(const char *s, size_t maxlen);
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/time.h
@@ -1,0 +1,38 @@
+#ifndef _TIME_H
+#define _TIME_H
+
+#include <arch/time.h>
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#define CLOCKS_PER_SEC 1000000
+
+typedef long int clock_t;
+
+struct tm {
+	int tm_sec;
+	int tm_min;
+	int tm_hour;
+	int tm_mday;
+	int tm_mon;
+	int tm_year;
+	int tm_wday;
+	int tm_yday;
+	int tm_isdst;
+};
+
+extern clock_t clock(void);
+extern double difftime(time_t time1, time_t time0);
+extern time_t mktime(struct tm *timeptr);
+extern time_t time(time_t *timer);
+extern char *asctime(const struct tm *timeptr);
+extern char *ctime(const time_t *timer);
+extern struct tm *gmtime(const time_t *timer);
+extern struct tm *localtime(const time_t *timer);
+extern size_t strftime(char * restrict s, size_t maxsize,
+                       const char * restrict format,
+                       const struct tm * restrict timeptr);
+
+#endif
--- /dev/null
+++ b/rootdir/include/scc/wchar.h
@@ -1,0 +1,12 @@
+#ifndef _WCHAR_H_
+#define _WCHAR_H_
+
+
+/* TODO: This is only a placeholder */
+typedef long wchar_t;
+typedef long wint_t;
+
+extern size_t wcsnlen(const wchar_t *s, size_t maxlen);
+extern wint_t putwc(wchar_t wc, FILE *fp);
+
+#endif
--- a/rules.mk
+++ b/rules.mk
@@ -1,9 +1,12 @@
 include $(PROJECTDIR)/config.mk
 
+INCLUDE    = $(PROJECTDIR)/inc
+
 BINDIR     = $(PROJECTDIR)/rootdir/bin
-INCDIR     = $(PROJECTDIR)/inc
+INCDIR     = $(PROJECTDIR)/rootdir/include/scc
 LIBDIR     = $(PROJECTDIR)/rootdir/lib/scc
 LIBEXEC    = $(PROJECTDIR)/rootdir/libexec/scc
+
 LIBSCC     = $(PROJECTDIR)/lib/scc
 LIBCOFF32  = $(PROJECTDIR)/lib/coff32