From c2e099a422f6b15a8b8a3c510800f5c60ffc9b97 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 13 Nov 2016 00:07:33 +0000 Subject: [PATCH] 6502: add Makefile and cfg files --- Library/libs/Makefile.6502 | 21 ++++++++++++--------- Library/libs/ld65-tgl65.cfg | 17 +++++++++++++++++ Library/libs/ld65-v65.cfg | 17 +++++++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 Library/libs/ld65-tgl65.cfg create mode 100644 Library/libs/ld65-v65.cfg diff --git a/Library/libs/Makefile.6502 b/Library/libs/Makefile.6502 index 2a3b9eeb..e018acb6 100644 --- a/Library/libs/Makefile.6502 +++ b/Library/libs/Makefile.6502 @@ -2,10 +2,11 @@ CC = cl65 ASM = ca65 AR = ar65 LINKER = ld65 -CC_OPT = -t none -O -D__STDC__ --all-fastcall -c -O -I../include/ -I../include/6502/ +CC_OPT = -t none -O -D__STDC__ --all-fastcall -c -I../include/ -I../include/6502/ +CC_NOOPT = -t none -D__STDC__ --all-fastcall -c -I../include/ -I../include/6502/ ASM_OPT = -o -LINKER_OPT = -m -i -o -SRC_CRT0 = crt0_6502.s +LINKER_OPT = -o +SRC_CRT0 = crt0_6502.s crt0nostdio_6502.s OBJ_CRT0 = $(SRC_CRT0:.s=.o) SRC_ASM = OBJ_ASM = $(SRC_ASM:.s=.o) @@ -32,7 +33,7 @@ OBJ_ASM = $(SRC_ASM:.s=.o) # SRC_C = __argv.c abort.c asctime.c assert.c atexit.c atoi.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 += closedir_r.c clock_gettime.c clock_getres.c clock_settime.c SRC_C += creat.c crypt.c ctermid.c ctime.c cuserid.c SRC_C += difftime.c err.c errno.c error.c SRC_C += execl.c execv.c execvp.c exit.c @@ -44,7 +45,8 @@ SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c SRC_C += getw.c gmtime.c gmtime_r.c grent.c index.c initgroups.c SRC_C += isatty.c killpg.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 += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c opendir_r.c +SRC_C += pause.c perror.c SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c putw.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 @@ -76,17 +78,18 @@ SRC_HARD += regexp.c #SRC_C += memchr.c memcmp.c memcpy.c memset.c strtol.c OBJ_C = $(SRC_C:.c=.o) -OBJ_ALL = $(OBJ_ASM) $(OBJ_C) +OBJ_HARD = $(SRC_HARD:.c=.o) +OBJ_ALL = $(OBJ_ASM) $(OBJ_C) $(OBJ_HARD) -all: syslib.lib liberror.txt crt0_6502.o +all: syslib.lib liberror.txt crt0_6502.o crt0nostdio_6502.o fuzix6502/Makefile: ../tools/syscall_6502.c ../../Kernel/include/syscall_name.h (cd ..; make tools/syscall_6502) ../tools/syscall_6502 -syslib.lib: fuzix6502/Makefile $(OBJ_C) +syslib.lib: fuzix6502/Makefile $(OBJ_ALL) (cd fuzix6502; make) - $(AR) a syslib.lib $(OBJ_C) + $(AR) a syslib.lib $(OBJ_ALL) ln -sf syslib.lib c6502.lib liberror.txt: diff --git a/Library/libs/ld65-tgl65.cfg b/Library/libs/ld65-tgl65.cfg new file mode 100644 index 00000000..47111e9e --- /dev/null +++ b/Library/libs/ld65-tgl65.cfg @@ -0,0 +1,17 @@ +MEMORY { + RAMZ: start = $0000, size = $0100, type = rw, define = yes; + RAM1: start = $2000, size = $A000, type = rw, define = yes; +} + +SEGMENTS { + ZEROPAGE: load = RAMZ, type = zp, define = yes; + STARTUP: load = RAM1, type = ro, define=yes; + CODE: load = RAM1, type = ro, define=yes; + RODATA: load = RAM1, type = ro, define=yes; + DATA: load = RAM1, type = rw, define=yes; + BSS: load = RAM1, type = bss, define=yes; +} + +FILES { + %O: format = bin; +} diff --git a/Library/libs/ld65-v65.cfg b/Library/libs/ld65-v65.cfg new file mode 100644 index 00000000..2e2722e5 --- /dev/null +++ b/Library/libs/ld65-v65.cfg @@ -0,0 +1,17 @@ +MEMORY { + RAMZ: start = $0000, size = $0100, type = rw, define = yes; + RAM1: start = $2000, size = $C000, type = rw, define = yes; +} + +SEGMENTS { + ZEROPAGE: load = RAMZ, type = zp, define = yes; + STARTUP: load = RAM1, type = ro, define=yes; + CODE: load = RAM1, type = ro, define=yes; + RODATA: load = RAM1, type = ro, define=yes; + DATA: load = RAM1, type = rw, define=yes; + BSS: load = RAM1, type = bss, define=yes; +} + +FILES { + %O: format = bin; +} -- 2.34.1