V7/cmd: build on 6502
authorAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 15:11:42 +0000 (15:11 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 15:11:42 +0000 (15:11 +0000)
Applications/V7/cmd/Makefile.6502 [new file with mode: 0644]

diff --git a/Applications/V7/cmd/Makefile.6502 b/Applications/V7/cmd/Makefile.6502
new file mode 100644 (file)
index 0000000..5556425
--- /dev/null
@@ -0,0 +1,61 @@
+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  = ac.c accton.c at.c atrun.c col.c comm.c cron.c crypt.c dc.c dd.c \
+       deroff.c diff3.c diff.c diffh.c join.c look.c makekey.c mesg.c \
+       newgrp.c pr.c ptx.c rev.c split.c su.c sum.c test.c time.c tsort.c \
+       wall.c
+
+SRCSNS = ed.c
+
+SRCSTC = clear.c
+
+SRCSBAD =
+
+OBJS = $(SRCS:.c=.o)
+OBJSNS = $(SRCSNS:.c=.o)
+OBJSTC = $(SRCSTC:.c=.o)
+OBJSBAD = $(SRCSBAD:.c=.o)
+
+APPSNS = $(OBJSNS:.o=)
+
+APPSTC = $(OBJSTC:.o=)
+
+APPS = $(OBJS:.o=) $(OBJSBAD:.o=) $(OBJSNS:.o=) $(OBJSTC:.o=)
+
+all: $(APPS) sizes
+
+
+$(APPSNS): OPTS =
+
+$(APPSTC): OPTS = 
+
+$(OBJS): %.o: %.c
+
+$(OBJSNS): %.o: %.c
+
+$(OBJSTC): %.o: %.c
+
+$(OBJSBAD): %.o: %.c
+
+%: %.o
+       $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map
+
+sizes: $(APPS)
+       ls -l $(APPS) >size.report
+
+clean:
+       rm -f $(OBJS) $(OBJSNS) $(OBJSBAD) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report *.o
+
+rmbak:
+       rm -f *~ core
+