From c1357fb36b893d5e1b2391dd2b36e7c5f181182f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 22 Nov 2017 17:55:02 +0000 Subject: [PATCH] as09: build on 6502 --- Applications/as09/Makefile.6502 | 42 +++++++++++++++++++++++++++++++++ Applications/as09/as.c | 2 +- Applications/as09/proto.h | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Applications/as09/Makefile.6502 diff --git a/Applications/as09/Makefile.6502 b/Applications/as09/Makefile.6502 new file mode 100644 index 00000000..54e6f9da --- /dev/null +++ b/Applications/as09/Makefile.6502 @@ -0,0 +1,42 @@ +PLATFORM = 6502 +CC = cl65 +ASM = ca65 +LINKER = cl65 +CFLAGS = -t none -O -D__STDC__ -c -O -I../../Library/include -I../../Library/include/6502 +LINKER_OPT = -L../../Library/libs -C ../../Library/libs/ld65-$(TARGET).cfg +ASM_OPT = -o +CRT0 = ../../Library/libs/crt0_6502.o +CRT0NS = ../../Library/libs/crt0nostdio_6502.o + +.SUFFIXES: .c .o + +SRC = as.c assemble.c errors.c express.c \ + genbin.c genlist.c genobj.c gensym.c \ + keywords.c macro.c mops.c pops.c readsrc.c \ + scan.c table.c typeconv.c alloc.c +OBJ = $(SRC:.c=.o) + +all: as09 + +as09: $(OBJ) + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +clean realclean clobber: + rm -f *.o as09 *~ + +as.o: const.h type.h byteord.h macro.h file.h flag.h globvar.h +assemble.o: const.h type.h address.h globvar.h opcode.h scan.h +error.o: const.h type.h +express.o: const.h type.h address.h globvar.h scan.h source.h +genbin.o: const.h type.h address.h file.h globvar.h +genlist.o: const.h type.h address.h flag.h file.h globvar.h macro.h scan.h \ + source.h +genobj.o: const.h type.h address.h file.h globvar.h +gensym.o: const.h type.h flag.h file.h globvar.h +keywords.o: const.h type.h globvar.h opcode.h +macro.o: const.h type.h globvar.h scan.h macro.h +mops.o: const.h type.h globvar.h opcode.h scan.h address.h +pops.o: const.h type.h address.h flag.h globvar.h opcode.h scan.h +readsrc.o: const.h type.h flag.h file.h globvar.h macro.h scan.h source.h +scan.o: const.h type.h globvar.h scan.h +table.o: const.h type.h globvar.h opcode.h scan.h diff --git a/Applications/as09/as.c b/Applications/as09/as.c index aa3f81e7..9d2bdcda 100644 --- a/Applications/as09/as.c +++ b/Applications/as09/as.c @@ -32,7 +32,7 @@ static int keep_bad_output = 0; static void initp1(void); static int my_creat(char *name, char *message); -static void process_args(int argc, char **argv); +static void process_args(int argc, char *argv[]); static void summary(fd_t fd); static void summ_number(unsigned num); static void usage(void); diff --git a/Applications/as09/proto.h b/Applications/as09/proto.h index 38786334..4473b2aa 100644 --- a/Applications/as09/proto.h +++ b/Applications/as09/proto.h @@ -1,7 +1,7 @@ /* extern functions */ /* as.c */ -int main(int argc, char **argv); +int main(int argc, char *argv[]); void as_abort(char *message); void finishup(void); void initp1p2(void); -- 2.34.1