6502: Add more build Makefiles
authorAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 17:55:32 +0000 (17:55 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 17:55:32 +0000 (17:55 +0000)
"make" now builds a fairly substantial set of tools

Applications/MWC/cmd/Makefile.6502 [new file with mode: 0644]
Applications/V7/games/Makefile.6502 [new file with mode: 0644]
Applications/cave/Makefile.6502 [new file with mode: 0644]
Applications/flashrom/Makefile.6502 [new file with mode: 0644]
Applications/ld09/Makefile.6502 [new file with mode: 0644]
Applications/netd/Makefile.6502 [new file with mode: 0644]

diff --git a/Applications/MWC/cmd/Makefile.6502 b/Applications/MWC/cmd/Makefile.6502
new file mode 100644 (file)
index 0000000..97264fc
--- /dev/null
@@ -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 (file)
index 0000000..f98288d
--- /dev/null
@@ -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 (file)
index 0000000..414122b
--- /dev/null
@@ -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 (file)
index 0000000..875caa2
--- /dev/null
@@ -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 (file)
index 0000000..1366a74
--- /dev/null
@@ -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 (file)
index 0000000..9741619
--- /dev/null
@@ -0,0 +1,6 @@
+#
+#      For now don't build netd on 6502
+#
+all:
+
+clean: