From d00a15b174fbd405f6af2de8997286c176d877eb Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 9 Mar 2018 21:31:15 +0000 Subject: [PATCH] 68000: add more app makefiles --- Applications/SmallC/Makefile.68000 | 66 ++++++++++++++++++++++++++++ Applications/as09/Makefile.68000 | 54 +++++++++++++++++++++++ Applications/flashrom/Makefile.68000 | 34 ++++++++++++++ Applications/ld09/Makefile.68000 | 43 ++++++++++++++++++ Applications/ue/Makefile.68000 | 44 +++++++++++++++++++ 5 files changed, 241 insertions(+) create mode 100644 Applications/SmallC/Makefile.68000 create mode 100644 Applications/as09/Makefile.68000 create mode 100644 Applications/flashrom/Makefile.68000 create mode 100644 Applications/ld09/Makefile.68000 create mode 100644 Applications/ue/Makefile.68000 diff --git a/Applications/SmallC/Makefile.68000 b/Applications/SmallC/Makefile.68000 new file mode 100644 index 00000000..dacfe2fc --- /dev/null +++ b/Applications/SmallC/Makefile.68000 @@ -0,0 +1,66 @@ +PLATFORM = 68000 +CC = m68k-uclinux-gcc +ASM = m68k-uclinux-as +AR = m68k-uclinux-ar +LINKER = m68k-uclinux-ld +CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -msoft-float -Wall -m68000 -Os -I../../Library/include -I../../Library/include/68000 +LINKER_OPT = -L../../Library/libs -lc68000 +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name)) +LINKER_OPT += --emit-relocs -L$(LIBGCCDIR) -lgcc -T ../../Library/elf2flt.ld +CRT0 = ../../Library/libs/crt0_68000.o +CRT0NS = ../../Library/libs/crt0nostdio_68000.o +# For now while we get going. Really we want to use some kind of elf2zmagic +# with relocs. +ELF2FUZIX = elf2flt +.SUFFIXES: .c .o + +LIBDIR =/usr/bin +LDFLAGS = + +DEFS = + +OBJS = initials.o data.o error.o expr.o function.o gen.o io.o \ + lex.o main.o outstack.o preproc.o primary.o stmt.o struct.o sym.o while.o + +OBJ_Z80 = codez80.o +OBJ_8080 = code8080.o +OBJ_6801 = code6801.o +OBJ_6809 = code6809.o + +OBJ_COPT = copt.o + +INC = data.h defs.h prototype.h + +OBJS_ALL = $(OBJS) $(OBJ_Z80) $(OBJ_8080) +all: scc6801 scc6809 scc8080 sccz80 copt + +sccz80: $(CRT0NS) $(OBJS) $(OBJ_Z80) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +scc8080: $(CRT0NS) $(OBJS) $(OBJ_8080) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +scc6801: $(CRT0NS) $(OBJS) $(OBJ_6801) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +scc6809: $(CRT0NS) $(OBJS) $(OBJ_6809) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +copt: $(CRT0) $(OBJ_COPT) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +clean: + rm -f $(OBJ) scc8080 sccz80 scc6801 scc6809 *.o *~ + +.c.o: + $(CC) $(COPT) $(CFLAGS) -c $< -o $@ + +$(OBJS_ALL) : $(INC) + +clean: + rm -f *~ *.o *.asm *.lst *.sym *.o *.map *.noi *.bin *.lk diff --git a/Applications/as09/Makefile.68000 b/Applications/as09/Makefile.68000 new file mode 100644 index 00000000..21aed866 --- /dev/null +++ b/Applications/as09/Makefile.68000 @@ -0,0 +1,54 @@ +PLATFORM = 68000 +CC = m68k-uclinux-gcc +ASM = m68k-uclinux-as +AR = m68k-uclinux-ar +LINKER = m68k-uclinux-ld +CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -msoft-float -Wall -m68000 -Os -I../../Library/include -I../../Library/include/68000 +LINKER_OPT = -L../../Library/libs -lc68000 +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name)) +LINKER_OPT += --emit-relocs -L$(LIBGCCDIR) -lgcc -T ../../Library/elf2flt.ld +CRT0 = ../../Library/libs/crt0_68000.o +CRT0NS = ../../Library/libs/crt0nostdio_68000.o +# For now while we get going. Really we want to use some kind of elf2zmagic +# with relocs. +ELF2FUZIX = elf2flt +.SUFFIXES: .c .o + + +OBJS =as.o assemble.o errors.o express.o \ + genbin.o genlist.o genobj.o gensym.o \ + keywords.o macro.o mops.o pops.o readsrc.o \ + scan.o table.o typeconv.o alloc.o + +all: as09 + +as09: $(CRT0) $(OBJS) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +clean: +realclean: +clobber: + rm -f *.o as09 *~ + +.c.o: + $(CC) $(CFLAGS) $(COPT) -c $< + +$(OBJS): const.h errors.h + +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/flashrom/Makefile.68000 b/Applications/flashrom/Makefile.68000 new file mode 100644 index 00000000..3c0f2f65 --- /dev/null +++ b/Applications/flashrom/Makefile.68000 @@ -0,0 +1,34 @@ +PLATFORM = 68000 +CC = m68k-uclinux-gcc +ASM = m68k-uclinux-as +AR = m68k-uclinux-ar +LINKER = m68k-uclinux-ld +CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -msoft-float -Wall -m68000 -Os -I../../Library/include -I../../Library/include/68000 +LINKER_OPT = -L../../Library/libs -lc68000 +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name)) +LINKER_OPT += --emit-relocs -L$(LIBGCCDIR) -lgcc -T ../../Library/elf2flt.ld +CRT0 = ../../Library/libs/crt0_68000.o +CRT0NS = ../../Library/libs/crt0nostdio_68000.o +# For now while we get going. Really we want to use some kind of elf2zmagic +# with relocs. +ELF2FUZIX = elf2flt +.SUFFIXES: .c .o + +APPS = flashrom + +SRCS = flashrom.c + +OBJS = $(SRCS:.c=.o) + +all: $(APPS) size.report + +flashrom: $(CRT0) flashrom.o + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +size.report: $(APPS) + ls -l $< > $@ + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) *.lst *.map size.report + diff --git a/Applications/ld09/Makefile.68000 b/Applications/ld09/Makefile.68000 new file mode 100644 index 00000000..774729c6 --- /dev/null +++ b/Applications/ld09/Makefile.68000 @@ -0,0 +1,43 @@ +PLATFORM = 68000 +CC = m68k-uclinux-gcc +ASM = m68k-uclinux-as +AR = m68k-uclinux-ar +LINKER = m68k-uclinux-ld +CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -msoft-float -Wall -m68000 -Os -I../../Library/include -I../../Library/include/68000 +LINKER_OPT = -L../../Library/libs -lc68000 +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name)) +LINKER_OPT += --emit-relocs -L$(LIBGCCDIR) -lgcc -T ../../Library/elf2flt.ld +CRT0 = ../../Library/libs/crt0_68000.o +CRT0NS = ../../Library/libs/crt0nostdio_68000.o +# For now while we get going. Really we want to use some kind of elf2zmagic +# with relocs. +ELF2FUZIX = elf2flt +.SUFFIXES: .c .o + +DEFS = + +# An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha) +# +# NATIVE=-DA_OUT_INCL='"a_out_local.h"' + +OBJS= dumps.o io.o ld.o readobj.o table.o typeconv.o linksyms.o writefuzix.o + +all: ld09 + +ld09: $(CRT0) $(OBJS) + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +clean realclean clobber: + rm -f *.o ld09 ld09r objchop catimage objdump09 *~ + +$(OBJS): 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 . + +.c.o: + $(CC) $(COPT) $(CFLAGS) $(DEFS) -c $< -o $@ diff --git a/Applications/ue/Makefile.68000 b/Applications/ue/Makefile.68000 new file mode 100644 index 00000000..ee073c03 --- /dev/null +++ b/Applications/ue/Makefile.68000 @@ -0,0 +1,44 @@ +PLATFORM = 68000 +CC = m68k-uclinux-gcc +ASM = m68k-uclinux-as +AR = m68k-uclinux-ar +LINKER = m68k-uclinux-ld +CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -msoft-float -Wall -m68000 -Os -I../../Library/include -I../../Library/include/68000 +LINKER_OPT = -L../../Library/libs -lc68000 +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name)) +LINKER_OPT += --emit-relocs -L$(LIBGCCDIR) -lgcc -T ../../Library/elf2flt.ld +CRT0 = ../../Library/libs/crt0_68000.o +CRT0NS = ../../Library/libs/crt0nostdio_68000.o +# For now while we get going. Really we want to use some kind of elf2zmagic +# with relocs. +ELF2FUZIX = elf2flt +.SUFFIXES: .c .o + +APPS = ue.fuzix ue.ansi ue + +SRCS = ue.c term-fuzix.c term-ansi.c term.c + +OBJS = $(SRCS:.c=.o) + +all: $(APPS) size.report + +$(APPS): ue.h + +ue.fuzix: $(CRT0NS) ue.o term-fuzix.o + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +ue.ansi: $(CRT0NS) ue.o term-ansi.o + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +ue: $(CRT0) ue.o term.o + $(LINKER) $^ -o $@.bin $(LINKER_OPT) + $(ELF2FUZIX) -o $@ $@.bin + +size.report: $(APPS) + ls -l $< > $@ + +clean: + rm -f $(OBJS) $(APPS) $(SRCS:.c=) *.lst *.map size.report + -- 2.34.1