megadrive_test2
annotate Makefile @ 11:302bcd73edc4
added 6button support
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 Jun 2017 03:47:37 +0300 |
parents | ea70f3da150f |
children |
rev | line source |
---|---|
nuclear@0 | 1 csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c) |
nuclear@0 | 2 asrc = $(wildcard src/*.s) |
nuclear@0 | 3 aSsrc = $(wildcard src/*.S) |
nuclear@0 | 4 obj = $(asrc:.s=.o) $(aSsrc:.S=.o) $(csrc:.c=.o) |
nuclear@9 | 5 dep = $(csrc:.c=.d) |
nuclear@0 | 6 |
nuclear@0 | 7 name = test2 |
nuclear@0 | 8 elf = $(name).elf |
nuclear@0 | 9 bin = $(name).bin |
nuclear@0 | 10 |
nuclear@0 | 11 warn = -pedantic -Wall |
nuclear@0 | 12 dbg = -g |
nuclear@5 | 13 opt = -O2 |
nuclear@0 | 14 def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\" -D__NO_CTYPE |
nuclear@5 | 15 inc = -I. -Isrc -Isrc/libc |
nuclear@0 | 16 |
nuclear@0 | 17 tool_prefix = m68k-linux-gnu- |
nuclear@0 | 18 |
nuclear@0 | 19 CC = $(tool_prefix)gcc |
nuclear@0 | 20 AS = $(tool_prefix)as |
nuclear@0 | 21 LD = $(tool_prefix)ld |
nuclear@0 | 22 OBJCOPY = $(tool_prefix)objcopy |
nuclear@0 | 23 |
nuclear@0 | 24 CFLAGS = -m68000 -ffreestanding -fno-builtin $(warn) $(dbg) $(opt) $(def) $(inc) |
nuclear@0 | 25 CPPFLAGS = $(def) |
nuclear@1 | 26 ASFLAGS = -m68000 $(inc) |
nuclear@0 | 27 LDFLAGS = -T megadrive.ldscript -print-gc-sections \ |
nuclear@0 | 28 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc |
nuclear@0 | 29 |
nuclear@0 | 30 $(bin): $(elf) |
nuclear@0 | 31 $(OBJCOPY) -O binary $< $@ |
nuclear@0 | 32 |
nuclear@5 | 33 $(elf): tun_data.h $(obj) |
nuclear@0 | 34 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) |
nuclear@0 | 35 |
nuclear@5 | 36 tun_data.h: tunnel.ppm |
nuclear@5 | 37 cat $< | tools/ppm2md tun_ >$@ |
nuclear@5 | 38 |
nuclear@5 | 39 tunnel.ppm: |
nuclear@5 | 40 tools/tunnel >$@ |
nuclear@5 | 41 |
nuclear@9 | 42 -include $(dep) |
nuclear@9 | 43 |
nuclear@9 | 44 %.d: %.c |
nuclear@9 | 45 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@9 | 46 |
nuclear@0 | 47 .PHONY: clean |
nuclear@0 | 48 clean: |
nuclear@5 | 49 rm -f $(obj) $(elf) $(bin) tun_data.h tunnel.ppm |
nuclear@0 | 50 |
nuclear@9 | 51 .PHONY: cleandep |
nuclear@9 | 52 cleandep: |
nuclear@9 | 53 rm -f $(dep) |
nuclear@9 | 54 |
nuclear@0 | 55 .PHONY: run |
nuclear@0 | 56 run: $(bin) |
nuclear@0 | 57 gens-sdl $< |
nuclear@0 | 58 |
nuclear@0 | 59 .PHONY: copy |
nuclear@0 | 60 copy: $(bin) |
nuclear@0 | 61 mount /media/usbmass && cp $(bin) /media/usbmass/$(bin) |
nuclear@0 | 62 umount /media/usbmass |
nuclear@0 | 63 |
nuclear@0 | 64 .PHONY: install |
nuclear@0 | 65 install: $(bin) |
nuclear@0 | 66 mount /media/usbmass |
nuclear@0 | 67 [ -f /media/usbmass/MEGA/MEGA.RBF ] || cp $(bin) /media/usbmass/MEGA/MEGA.BIN |
nuclear@0 | 68 umount /media/usbmass |