From 6dfc7699111eda1eafdb76d044b681cb2c44733b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 22 Nov 2017 17:55:32 +0000 Subject: [PATCH] 6502: Add more build Makefiles "make" now builds a fairly substantial set of tools --- Applications/MWC/cmd/Makefile.6502 | 46 +++++++++++++++++++++++++++++ Applications/V7/games/Makefile.6502 | 34 +++++++++++++++++++++ Applications/cave/Makefile.6502 | 30 +++++++++++++++++++ Applications/flashrom/Makefile.6502 | 26 ++++++++++++++++ Applications/ld09/Makefile.6502 | 32 ++++++++++++++++++++ Applications/netd/Makefile.6502 | 6 ++++ 6 files changed, 174 insertions(+) create mode 100644 Applications/MWC/cmd/Makefile.6502 create mode 100644 Applications/V7/games/Makefile.6502 create mode 100644 Applications/cave/Makefile.6502 create mode 100644 Applications/flashrom/Makefile.6502 create mode 100644 Applications/ld09/Makefile.6502 create mode 100644 Applications/netd/Makefile.6502 diff --git a/Applications/MWC/cmd/Makefile.6502 b/Applications/MWC/cmd/Makefile.6502 new file mode 100644 index 00000000..97264fc3 --- /dev/null +++ b/Applications/MWC/cmd/Makefile.6502 @@ -0,0 +1,46 @@ +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 = ac.c almanac.c at.c col.c cron.c deroff.c ed.c find.c make.c \ + moo.c pr.c tar.c ttt.c calendar.c m4.c +# no FP so no units +SRCNS = expr.c test.c + +OBJ = $(SRC:.c=.o) +OBJNS = $(SRCNS:.c=.o) + +APPS = $(OBJ:.o=) +APPSNS = $(OBJNS:.o=) + +all: $(APPS) $(APPSNS) sizes + +expr.c: expr.y + byacc -o expr.c expr.y + +find.c: find.y + byacc -o find.c find.y + +$(APPS): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +$(APPSNS): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0NS) $^ c6502.lib -m $@.map + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ size.report *.o + +rmbak: + rm -f *~ core + diff --git a/Applications/V7/games/Makefile.6502 b/Applications/V7/games/Makefile.6502 new file mode 100644 index 00000000..f98288d6 --- /dev/null +++ b/Applications/V7/games/Makefile.6502 @@ -0,0 +1,34 @@ +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 + +SRCS = arithmetic.c backgammon.c fish.c quiz.c wump.c + +OBJS = $(SRCS:.c=.o) + +APPS = $(OBJS:.o=) + +all: $(APPS) sizes + +$(OBJS): %.o: %.c + +%: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS)$(APPS) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report *.o + +rmbak: + rm -f *~ core + diff --git a/Applications/cave/Makefile.6502 b/Applications/cave/Makefile.6502 new file mode 100644 index 00000000..414122b5 --- /dev/null +++ b/Applications/cave/Makefile.6502 @@ -0,0 +1,30 @@ +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 = advent.c adventdb.c database.c english.c itverb.c lib.c saveadv.c \ + turn.c verb.c +OBJ = $(SRC:.c=.o) + +all: advent advent.db + +advent.db: advgen + ./advgen > advent.db + +advgen: advgen.c + cc advgen.c -o ./advgen + +advent: $(OBJ) + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + + +clean: + rm -f advent advent.db advgen *.o *.asm *.lst core *.sym *.map *.noi *.lk *.ihx *.tmp *.bin *.o diff --git a/Applications/flashrom/Makefile.6502 b/Applications/flashrom/Makefile.6502 new file mode 100644 index 00000000..875caa27 --- /dev/null +++ b/Applications/flashrom/Makefile.6502 @@ -0,0 +1,26 @@ +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 = flashrom.c +OBJ = $(SRC:.c=.o) +APPS = $(OBJ:.o=) + +all: $(APPS) + +$(APPS): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +clean: + rm -f $(OBJS) $(APPS) core *~ *.o + +rmbak: + rm -f *~ core diff --git a/Applications/ld09/Makefile.6502 b/Applications/ld09/Makefile.6502 new file mode 100644 index 00000000..1366a74d --- /dev/null +++ b/Applications/ld09/Makefile.6502 @@ -0,0 +1,32 @@ +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 = dumps.c io.c ld.c readobj.c table.c typeconv.c linksyms.c \ + writefuzix.c +OBJ = $(SRC:.c=.o) + +all: ld09 + +ld09: $(OBJ) + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +clean realclean clobber: + rm -f *.o as09 *~ + +$(OBJ): align.h ar.h bindef.h byteord.h config.h const.h globvar.h obj.h \ + syshead.h type.h + +ar.h: + test -f ar.h || \ + { rm -f ar.h ; ln -s ../libc/include/ar.h . ; } || \ + ln ../libc/include/ar.h . + diff --git a/Applications/netd/Makefile.6502 b/Applications/netd/Makefile.6502 new file mode 100644 index 00000000..97416195 --- /dev/null +++ b/Applications/netd/Makefile.6502 @@ -0,0 +1,6 @@ +# +# For now don't build netd on 6502 +# +all: + +clean: -- 2.34.1