--- /dev/null
+CC = m6809-unknown-gcc
+ASM = m6809-unknown-as
+AR = m6809-unknown-ar
+LINKER = m6809-unknown-ld
+PLATFORM = 6809
+export PLATFORM
+CC_OPT = -c -Os -I../include -I../include/6502
+# for stuff that gives sdcc nightmares
+CC_NOOPT = $(CC_OPT)
+ASM_OPT = -o
+LINKER_OPT =
+SRC_CRT0 = crt0_$(PLATFORM).s
+OBJ_CRT0 = $(SRC_CRT0:.s=.o)
+SRC_ASM =
+OBJ_ASM = $(SRC_ASM:.s=.o)
+SRC_C = __argv.c abort.c asctime.c assert.c atexit.c
+SRC_C += bcmp.c bcopy.c bsearch.c bzero.c calloc.c cfree.c clock.c closedir.c
+SRC_C += clock_gettime.c clock_getres.c clock_settime.c
+SRC_C += creat.c crypt.c ctime.c difftime.c err.c errno.c error.c
+SRC_C += execl.c execv.c execvp.c exit.c
+SRC_C += fclose.c fflush.c fgetc.c fgetgrent.c fgetpwent.c
+SRC_C += fgetpos.c fgets.c fopen.c fprintf.c fputc.c fputs.c fread.c free.c
+SRC_C += fsetpos.c ftell.c fwrite.c getcwd.c
+SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getopt.c
+SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c
+SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c killpg.c
+SRC_C += libintl.c
+SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c
+SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c pause.c perror.c
+SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c
+SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c
+SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c
+SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c
+SRC_C += stat.c stdio0.c stime.c
+SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
+SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c
+SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c
+SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
+SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
+SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c
+# ctype
+SRC_C += isalnum.c isalpha.c isascii.c isblank.c iscntrl.c isdigit.c
+SRC_C += isgraph.c islower.c isprint.c ispunct.c isspace.c isupper.c
+SRC_C += isxdigit.c toupper.c tolower.c
+# tty layer
+SRC_C += tcgetattr.c tcsetattr.c tcdrain.c tcflow.c tcflush.c
+SRC_C += cfmakeraw.c cfspeed.c revoke.c
+# scanf
+SRC_C += fscanf.c scanf.c sscanf.c vfscanf.c vscanf.c vsscanf.c
+# Seems to give the compiler a hard time
+SRC_HARD += regexp.c
+# Not supported yet
+#SRC_C += initgroups.c
+# Pieces we inherit in this case from the compiler library instead
+#SRC_C += strcpy.c strlen.c abs.c atof.c atoi.c atol.c labs.c
+#SRC_C += strcat.c strchr.c strcmp.c strcspn.c strncat.c strncmp.c
+#SRC_C += strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c
+#SRC_C += memchr.c memcmp.c memcpy.c memset.c
+
+OBJ_C = $(SRC_C:.c=.o)
+OBJ_HARD = $(SRC_HARD:.c=.o)
+OBJ_ALL = $(OBJ_ASM) $(OBJ_C) $(OBJ_HARD)
+
+all: syslib$(PLATFORM).lib $(OBJ_CRT0)
+
+libc.l:%.l:$(OBJ_ALL)
+ ls $(OBJ_ALL) > libc.l
+
+syscall.l: fuzix$(PLATFORM)/syslib.l
+ ../tools/syscall_$(PLATFORM)
+ (cd fuzix$(PLATFORM); make)
+ cat fuzix$(PLATFORM)/syslib.l | tr " " "\\n" | sed -e "s/^/fuzix$(PLATFORM)\//" >syscall.l
+
+syslib$(PLATFORM).lib: syscall.l libc.l
+ cat libc.l syscall.l >syslib.l
+ $(AR) -c -m syslib$(PLATFORM).lib syslib.l
+ ln -sf syslib$(PLATFORM).lib c$(PLATFORM).lib
+
+fuzix$(PLATFORM)/syslib.l:
+ ../tools/syscall_$(PLATFORM)
+ make -C fuzix$(PLATFORM)
+
+$(OBJ_ASM):%.o: %.s
+ $(ASM) $(ASM_OPT) $@ $(@:.o=.s)
+
+$(OBJ_CRT0):%.o: %.s
+ $(ASM) $(ASM_OPT) $@ $(@:.o=.s)
+
+$(OBJ_C):%.o: %.c
+ $(CC) $(CC_OPT) $(@:.o=.c)
+
+$(OBJ_HARD):%.o: %.c
+ $(CC) $(CC_NOOPT) $(@:.o=.c)
+
+clean:
+ rm -rf *.o *.asm *.sym *.lst *.lib *~ syscall.l libc.l syslib.l
+ (cd fuzix$(PLATFORM); make clean)
+ rm -rf fuzix$(PLATFORM)/Makefile