From: Alan Cox Date: Fri, 29 Sep 2017 21:14:35 +0000 (+0100) Subject: Applications: Update for new Makefile setup X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=cfb105be1d7576abeadd36853a5512432e8b58a6;p=FUZIX.git Applications: Update for new Makefile setup We now have a Makefile.$(CPU) for each - not all are complete yet but the rest can be filled in, or null targetted if not relevant to that platform. --- diff --git a/Applications/MWC/cmd/Makefile.z80 b/Applications/MWC/cmd/Makefile.z80 new file mode 100644 index 00000000..13480a3a --- /dev/null +++ b/Applications/MWC/cmd/Makefile.z80 @@ -0,0 +1,62 @@ +CC = sdcc +ASM = sdasz80 +AR = sdar +LINKER = sdcc +FCC = ../../../Library/tools/fcc +FCCOPTS = -O2 +PLATFORM = +#PLATFORM = -tzx128 + +PROGLOAD=`(cat ../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n1` + +.SUFFIXES: .c .rel + +SRCSNS = expr.c test.c + +SRCS = ac.c almanac.c at.c col.c deroff.c find.c moo.c pr.c tar.c ttt.c units.c + +SRCSBAD = calendar.c m4.c + +OBJS = $(SRCS:.c=.rel) +OBJSNS = $(SRCSNS:.c=.rel) +OBJSBAD = $(SRCSBAD:.c=.rel) + +LIBS = ../../../Library/libs/syslib.lib + +APPSNS = $(OBJSNS:.rel=) + +APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=) $(OBJSNS:.rel=) + +all: $(APPS) sizes + + +$(APPSNS): OPTS = --nostdio + +$(OBJS): %.rel: %.c + +$(OBJSNS): %.rel: %.c + +$(OBJSBAD): %.rel: %.c + $(FCC) $(PLATFORM) -c $< + +expr.c: expr.y + byacc -o expr.c expr.y + +find.c: find.y + byacc -o find.c find.y + +.c.rel: + $(FCC) $(PLATFORM) $(FCCOPTS) -c $< + +%: %.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core + diff --git a/Applications/Makefile b/Applications/Makefile new file mode 100644 index 00000000..6cc1e277 --- /dev/null +++ b/Applications/Makefile @@ -0,0 +1,28 @@ +# + +all: + (cd util; make -f Makefile.$(CPU)) + (cd V7/cmd; make -f Makefile.$(CPU)) + (cd V7/cmd/sh; make -f Makefile.$(CPU)) + (cd V7/games; make -f Makefile.$(CPU)) + (cd cave; make -f Makefile.$(CPU)) + (cd cpm; make -f Makefile.$(CPU)) + (cd games; make -f Makefile.$(CPU)) + (cd ld09; make -f Makefile.$(CPU)) + (cd netd; make -f Makefile.$(CPU)) + (cd SmallC; make -f Makefile.$(CPU)) + (cd MWC/cmd; make -f Makefile.$(CPU)) + +clean: + (cd util; make -f Makefile.$(CPU) clean) + (cd V7/cmd; make -f Makefile.$(CPU) clean) + (cd V7/cmd/sh; make -f Makefile.$(CPU) clean) + (cd V7/games; make -f Makefile.$(CPU) clean) + (cd cave; make -f Makefile.$(CPU) clean) + (cd cpm; make -f Makefile.$(CPU) clean) + (cd games; make -f Makefile.$(CPU) clean) + (cd ld09; make -f Makefile.$(CPU) clean) + (cd netd; make -f Makefile.$(CPU) clean) + (cd SmallC; make -f Makefile.$(CPU) clean) + (cd MWC/cmd; make -f Makefile.$(CPU) clean) + diff --git a/Applications/SmallC/Makefile.z80 b/Applications/SmallC/Makefile.z80 new file mode 100644 index 00000000..b1bd2da9 --- /dev/null +++ b/Applications/SmallC/Makefile.z80 @@ -0,0 +1,46 @@ +.SUFFIXES: .c .rel + +CC = fcc +CFLAGS = -DTINY +COPT = -O2 + +OBJS = initials.rel data.rel error.rel expr.rel function.rel gen.rel io.rel \ + lex.rel main.rel outstack.rel preproc.rel primary.rel stmt.rel struct.rel sym.rel while.rel + +OBJ_Z80 = codez80.rel +OBJ_8080 = code8080.rel +OBJ_6801 = code6801.rel +OBJ_6809 = code6809.rel + +OBJ_COPT = copt.rel + +INC = data.h defs.h prototype.h + +OBJS_ALL = $(OBJS) $(OBJ_Z80) $(OBJ_8080) +all: scc6801 scc6809 scc8080 sccz80 copt + +sccz80: $(OBJS) $(OBJ_Z80) + $(CC) -o sccz80 --nostdio $(OBJS) $(OBJ_Z80) + +scc8080: $(OBJS) $(OBJ_8080) + $(CC) -o scc8080 --nostdio $(OBJS) $(OBJ_8080) + +scc6801: $(OBJS) $(OBJ_6801) + $(CC) -o scc6801 --nostdio $(OBJS) $(OBJ_6801) + +scc6809: $(OBJS) $(OBJ_6809) + $(CC) -o scc6809 --nostdio $(OBJS) $(OBJ_6809) + +copt: $(OBJ_COPT) + $(CC) -o copt $(OBJ_COPT) + +clean: + rm -f $(OBJ) scc8080 sccz80 scc6801 scc6809 *.rel *~ + +.c.rel: + $(CC) $(COPT) $(CFLAGS) -c $< -o $@ + +$(OBJS_ALL) : $(INC) + +clean: + rm -f *~ *.rel *.asm *.lst *.sym *.o *.map *.noi *.bin *.lk diff --git a/Applications/V7/cmd/Makefile.z80 b/Applications/V7/cmd/Makefile.z80 new file mode 100644 index 00000000..eb15fadb --- /dev/null +++ b/Applications/V7/cmd/Makefile.z80 @@ -0,0 +1,59 @@ +CC = sdcc +ASM = sdasz80 +AR = sdar +LINKER = sdcc +FCC = ../../../Library/tools/fcc +FCCOPTS = -O2 +PLATFORM = +#PLATFORM = -tzx128 + +PROGLOAD=`(cat ../../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n1` + +.SUFFIXES: .c .rel + +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 + +SRCSBAD = + +OBJS = $(SRCS:.c=.rel) +OBJSNS = $(SRCSNS:.c=.rel) +OBJSBAD = $(SRCSBAD:.c=.rel) + +LIBS = ../../../Library/libs/syslib.lib + +APPSNS = $(OBJSNS:.rel=) + +APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=) $(OBJSNS:.rel=) + +all: $(APPS) sizes + + +$(APPSNS): OPTS = --nostdio + +$(OBJS): %.rel: %.c + +$(OBJSNS): %.rel: %.c + +$(OBJSBAD): %.rel: %.c + $(FCC) $(PLATFORM) -c $< + +.c.rel: + $(FCC) $(PLATFORM) $(FCCOPTS) -c $< + +%: %.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core + diff --git a/Applications/V7/games/Makefile.z80 b/Applications/V7/games/Makefile.z80 new file mode 100644 index 00000000..43520aa9 --- /dev/null +++ b/Applications/V7/games/Makefile.z80 @@ -0,0 +1,54 @@ +CC = sdcc +ASM = sdasz80 +AR = sdar +LINKER = sdcc +FCC = ../../../Library/tools/fcc +FCCOPTS = -O2 +PLATFORM = +#PLATFORM = -tzx128 + +PROGLOAD=`(cat ../../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n1` + +.SUFFIXES: .c .rel + +SRCS = arithmetic.c backgammon.c fish.c wump.c + +SRCSBAD = + +OBJS = $(SRCS:.c=.rel) +OBJSNS = $(SRCSNS:.c=.rel) +OBJSBAD = $(SRCSBAD:.c=.rel) + +LIBS = ../../../Library/libs/syslib.lib + +APPSNS = $(OBJSNS:.rel=) + +APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=) $(OBJSNS:.rel=) + +all: $(APPS) sizes + + +$(APPSNS): OPTS = --nostdio + +$(OBJS): %.rel: %.c + +$(OBJSNS): %.rel: %.c + +$(OBJSBAD): %.rel: %.c + $(FCC) $(PLATFORM) -c $< + +.c.rel: + $(FCC) $(PLATFORM) $(FCCOPTS) -c $< + +%: %.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core + diff --git a/Applications/cave/Makefile.z80 b/Applications/cave/Makefile.z80 new file mode 100644 index 00000000..2527e85d --- /dev/null +++ b/Applications/cave/Makefile.z80 @@ -0,0 +1,31 @@ +# +# For Z80 at least this should work. We will need to hack advgen to +# do endian swapping if building on PC for 6809 +# + +FCC = fcc +FCCOPTS = -O2 --nostdio +PLATFORM = + +SRC = advent.c adventdb.c database.c english.c itverb.c lib.c saveadv.c \ + turn.c verb.c +OBJ = $(SRC:.c=.rel) + +.SUFFIXES: .c .rel + +all: advent advent.db + +advent.db: advgen + ./advgen > advent.db + +advgen: advgen.c + cc advgen.c -o ./advgen + +.c.rel: + $(FCC) $(PLATFORM) $(FCCOPTS) -c $< + +advent: $(OBJ) + $(FCC) $(PLATFORM) $(FCCOPTS) -o $@ $(OBJ) + +clean: + rm -f advent advent.db advgen *.rel *.asm *.lst core *.sym *.map *.noi *.lk *.ihx *.tmp *.bin diff --git a/Applications/cpm/Makefile.6502 b/Applications/cpm/Makefile.6502 new file mode 100644 index 00000000..c2436e06 --- /dev/null +++ b/Applications/cpm/Makefile.6502 @@ -0,0 +1,4 @@ +all: + +clean: + rm -f *~ *.rel *.ihx *.tmp *.bin *.lst *.lk *.noi *.map cpm.def *.sym runcpm emulator runcpm.asm diff --git a/Applications/cpm/Makefile.68000 b/Applications/cpm/Makefile.68000 new file mode 100644 index 00000000..c2436e06 --- /dev/null +++ b/Applications/cpm/Makefile.68000 @@ -0,0 +1,4 @@ +all: + +clean: + rm -f *~ *.rel *.ihx *.tmp *.bin *.lst *.lk *.noi *.map cpm.def *.sym runcpm emulator runcpm.asm diff --git a/Applications/cpm/Makefile.6809 b/Applications/cpm/Makefile.6809 new file mode 100644 index 00000000..c2436e06 --- /dev/null +++ b/Applications/cpm/Makefile.6809 @@ -0,0 +1,4 @@ +all: + +clean: + rm -f *~ *.rel *.ihx *.tmp *.bin *.lst *.lk *.noi *.map cpm.def *.sym runcpm emulator runcpm.asm diff --git a/Applications/cpm/Makefile.z80 b/Applications/cpm/Makefile.z80 new file mode 100644 index 00000000..645fd888 --- /dev/null +++ b/Applications/cpm/Makefile.z80 @@ -0,0 +1,19 @@ +# +# +BASE=49152 +# +all: emulator runcpm + +emulator: emulator.s + echo " .org "$(BASE) >cpm.def + sdasz80 -o -l emulator.rel emulator.s + sdldz80 -m -i emulator.ihx emulator.rel -e + makebin -s 65536 emulator.ihx emulator.tmp + dd if=emulator.tmp of=emulator.bin bs=1 count=4096 skip=$(BASE) + +runcpm: runcpm.c + fcc -O2 -c --nostdio runcpm.c + fcc -o runcpm runcpm.rel + +clean: + rm -f *~ *.rel *.ihx *.tmp *.bin *.lst *.lk *.noi *.map cpm.def *.sym runcpm emulator runcpm.asm diff --git a/Applications/games/Makefile.z80 b/Applications/games/Makefile.z80 new file mode 100644 index 00000000..d55ef7f3 --- /dev/null +++ b/Applications/games/Makefile.z80 @@ -0,0 +1,65 @@ +CC = sdcc +ASM = sdasz80 +AR = sdar +LINKER = sdcc +FCC = ../../Library/tools/fcc -O2 +PLATFORM = +#PLATFORM = -tzx128 + +PROGLOAD=`(cat ../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n1` + +# Used for programs that make sdcc go boom or take hours +CC_CRAP = -mz80 --std-c99 -c --opt-code-size --max-allocs-per-node 1000 -I../../Library/include +ASM_OPT = -l -o -s +LINKER_OPT = -mz80 --nostdlib --no-std-crt0 --code-loc $(PROGLOAD) --data-loc 0 +BINMAN = ../../Library/tools/binman + +.SUFFIXES: .c .rel + +SRCSNS = qrun.c fortune.c + +SRCS = adv01.c adv02.c adv03.c adv04.c adv05.c adv06.c adv07.c \ + adv08.c adv09.c adv10.c adv11.c adv12.c adv13.c adv14a.c adv14b.c \ + myst01.c myst02.c myst03.c myst04.c myst05.c myst06.c myst07.c \ + myst08.c myst09.c myst10.c myst11.c fortune-gen.c + +SRCSBAD = + +OBJS = $(SRCS:.c=.rel) +OBJSNS = $(SRCSNS:.c=.rel) +OBJSBAD = $(SRCSBAD:.c=.rel) + +LIBS = ../../Library/libs/syslib.lib + +APPSNS = $(OBJSNS:.rel=) + +APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=) $(OBJSNS:.rel=) + +all: $(APPS) sizes + +$(OBJSBAD): $(SRCSBAD) + $(CC) $(CC_CRAP) $(@:.rel=.c) + +$(APPSNS): OPTS = --nostdio + +$(OBJS): %.rel: %.c + +$(OBJSNS): %.rel: %.c + +$(OBJSBAD): %.rel: %.c + +.c.rel: + $(FCC) $(PLATFORM) -c $< + +%: %.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core + diff --git a/Applications/netd/Makefile.z80 b/Applications/netd/Makefile.z80 new file mode 100644 index 00000000..7af3113c --- /dev/null +++ b/Applications/netd/Makefile.z80 @@ -0,0 +1,3 @@ +all: + +clean: diff --git a/Applications/util/Makefile.6502 b/Applications/util/Makefile.6502 new file mode 100644 index 00000000..2b4336da --- /dev/null +++ b/Applications/util/Makefile.6502 @@ -0,0 +1,136 @@ +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 + +SRCSNS = \ + basename.c \ + cat.c \ + chgrp.c \ + chmod.c \ + chown.c \ + cmp.c \ + cp.c \ + date.c \ + dirname.c \ + false.c \ + groups.c \ + head.c \ + init.c \ + kill.c \ + ln.c \ + logname.c \ + mkdir.c \ + mkfifo.c \ + mknod.c \ + mv.c \ + pagesize.c \ + printenv.c \ + prtroot.c \ + pwd.c \ + reboot.c \ + rm.c \ + rmdir.c \ + sum.c \ + sync.c \ + tee.c \ + telinit.c \ + touch.c \ + tr.c \ + true.c \ + while1.c \ + whoami.c \ + yes.c + + +SRCS = \ + banner.c \ + bd.c \ + cal.c \ + cksum.c \ + cut.c \ + dd.c \ + df.c \ + dosread.c \ + echo.c \ + ed.c \ + env.c \ + factor.c \ + fdisk.c \ + fgrep.c \ + grep.c \ + id.c \ + kbdrate.c \ + ll.c \ + ls.c \ + man.c \ + manscan.c \ + mkfs.c \ + mode.c \ + more.c \ + mount.c \ + od.c \ + passwd.c \ + ps.c \ + sed.c \ + sleep.c \ + ssh.c \ + sort.c \ + stty.c \ + su.c \ + tar.c \ + tail.c \ + termcap.c \ + umount.c \ + uname.c \ + uniq.c \ + uptime.c \ + uud.c \ + uue.c \ + wc.c \ + which.c \ + who.c \ + write.c \ + xargs.c + +SRCTC = tget.c \ + tchelp.c \ + marksman.c + +SKIPPED = + + +OBJS = $(SRCS:.c=.o) +OBJSNS = $(SRCSNS:.c=.o) +OBJTC = $(SRCTC:.c=.o) + +APPS = $(OBJS:.o=) +APPSNS = $(OBJSNS:.o=) +APPTC = $(OBJTC:.o=) + +all: $(APPS) $(APPSNS) $(APPTC) size.report + +$(APPS): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib -m $@.map + +$(APPSNS): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0NS) $^ c6502.lib -m $@.map + +$(APPTC): %: %.o + $(LINKER) -o $@ $(LINKER_OPT) $(CRT0) $^ c6502.lib termcap6502.lib + +size.report: $(APPS) $(APPSNS) $(APPTC) + ls -l $^ > $@ + +clean: + rm -f $(OBJS) $(OBJSNS) $(APPS) $(APPSNS) $(APPTC) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core diff --git a/Applications/util/Makefile.z80 b/Applications/util/Makefile.z80 new file mode 100644 index 00000000..016e3655 --- /dev/null +++ b/Applications/util/Makefile.z80 @@ -0,0 +1,151 @@ +CC = sdcc +ASM = sdasz80 +AR = sdar +LINKER = sdcc +FCC = ../../Library/tools/fcc +FCCOPTS = -O2 +PLATFORM = +#PLATFORM = -tzx128 + +PROGLOAD=`(cat ../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n1` + +.SUFFIXES: .c .rel + +SRCSNS = \ + basename.c \ + cat.c \ + chgrp.c \ + chmod.c \ + chown.c \ + cmp.c \ + cp.c \ + date.c \ + dirname.c \ + false.c \ + groups.c \ + head.c \ + init.c \ + kill.c \ + ln.c \ + logname.c \ + mkdir.c \ + mkfifo.c \ + mknod.c \ + mv.c \ + pagesize.c \ + printenv.c \ + prtroot.c \ + pwd.c \ + reboot.c \ + rm.c \ + rmdir.c \ + sum.c \ + sync.c \ + tee.c \ + telinit.c \ + touch.c \ + tr.c \ + true.c \ + while1.c \ + whoami.c \ + yes.c + +SRCS = banner.c \ + bd.c \ + cal.c \ + cksum.c \ + cut.c \ + dd.c \ + decomp16.c \ + df.c \ + dosread.c \ + du.c \ + echo.c \ + ed.c \ + env.c \ + factor.c \ + fdisk.c \ + fgrep.c \ + fsck.c \ + grep.c \ + id.c \ + kbdrate.c \ + ll.c \ + ls.c \ + man.c \ + manscan.c \ + marksman.c \ + mkfs.c \ + mode.c \ + more.c \ + mount.c \ + od.c \ + passwd.c \ + ps.c \ + sleep.c \ + ssh.c \ + sort.c \ + stty.c \ + su.c \ + tail.c \ + tar.c \ + termcap.c \ + tget.c \ + tchelp.c \ + umount.c \ + uname.c \ + uniq.c \ + uptime.c \ + uud.c \ + uue.c \ + wc.c \ + which.c \ + who.c \ + write.c \ + xargs.c + +SRCSBAD = sed.c socktest.c seltest.c + +OBJS = $(SRCS:.c=.rel) +OBJSNS = $(SRCSNS:.c=.rel) +OBJSBAD = $(SRCSBAD:.c=.rel) + +LIBS = ../../Library/libs/syslib.lib + +APPSNS = $(OBJSNS:.rel=) + +APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=) $(OBJSNS:.rel=) + +all: $(APPS) sizes + + +$(APPSNS): OPTS = --nostdio + +$(OBJS): %.rel: %.c + +$(OBJSNS): %.rel: %.c + +$(OBJSBAD): %.rel: %.c + $(FCC) $(PLATFORM) -c $< + +.c.rel: + $(FCC) $(PLATFORM) $(FCCOPTS) -c $< + +tchelp: tchelp.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ -ltermcap + +tget: tget.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ -ltermcap + +%: %.rel + $(FCC) $(PLATFORM) $(OPTS) $< -o $@ + +sizes: $(APPS) + ls -l $(APPS) >size.report + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report + +rmbak: + rm -f *~ core +