68000: add MWC makefile
authorAlan Cox <alan@linux.intel.com>
Thu, 20 Oct 2016 16:45:09 +0000 (17:45 +0100)
committerAlan Cox <alan@linux.intel.com>
Thu, 20 Oct 2016 16:45:09 +0000 (17:45 +0100)
Applications/MWC/cmd/Makefile.68000 [new file with mode: 0644]

diff --git a/Applications/MWC/cmd/Makefile.68000 b/Applications/MWC/cmd/Makefile.68000
new file mode 100644 (file)
index 0000000..812977b
--- /dev/null
@@ -0,0 +1,45 @@
+PLATFORM = 68000
+CC = m68k-linux-gnu-gcc
+ASM = m68k-linux-gnu-as
+AR = m68k-linux-gnu-ar
+LINKER = m68k-linux-gnu-ld
+CFLAGS = -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -Wall -m68000 -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
+
+SRCS  = ac.c almanac.c at.c calendar.c col.c deroff.c expr.c find.c m4.c moo.c pr.c tar.c test.c ttt.c units.c
+
+OBJS = $(SRCS:.c=.o)
+
+APPS = $(OBJS:.o=)
+
+all: $(APPS) size.report
+
+$(APPS): $(CRT0)
+
+$(APPS): %: %.o
+       $(LINKER) $^ -o $@.bin $(LINKER_OPT)
+       $(ELF2FUZIX) -o $@ $@.bin
+
+expr.c: expr.y
+       byacc -o expr.c expr.y
+
+find.c: find.y
+       byacc -o find.c find.y
+
+size.report: $(APPS)
+       ls -l $^ > $@
+
+clean:
+       rm -f $(OBJS) $(APPS) $(SRCS:.c=) core *~ *.asm *.lst *.sym *.map *.noi *.lk *.ihx *.tmp *.bin size.report *.o
+
+rmbak:
+       rm -f *~ core
+