nuclear@0: csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c) nuclear@0: asrc = $(wildcard src/*.s) nuclear@0: aSsrc = $(wildcard src/*.S) nuclear@0: obj = $(asrc:.s=.o) $(aSsrc:.S=.o) $(csrc:.c=.o) nuclear@9: dep = $(csrc:.c=.d) nuclear@0: nuclear@0: name = test2 nuclear@0: elf = $(name).elf nuclear@0: bin = $(name).bin nuclear@0: nuclear@0: warn = -pedantic -Wall nuclear@0: dbg = -g nuclear@5: opt = -O2 nuclear@0: def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\" -D__NO_CTYPE nuclear@5: inc = -I. -Isrc -Isrc/libc nuclear@0: nuclear@0: tool_prefix = m68k-linux-gnu- nuclear@0: nuclear@0: CC = $(tool_prefix)gcc nuclear@0: AS = $(tool_prefix)as nuclear@0: LD = $(tool_prefix)ld nuclear@0: OBJCOPY = $(tool_prefix)objcopy nuclear@0: nuclear@0: CFLAGS = -m68000 -ffreestanding -fno-builtin $(warn) $(dbg) $(opt) $(def) $(inc) nuclear@0: CPPFLAGS = $(def) nuclear@1: ASFLAGS = -m68000 $(inc) nuclear@0: LDFLAGS = -T megadrive.ldscript -print-gc-sections \ nuclear@0: -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc nuclear@0: nuclear@0: $(bin): $(elf) nuclear@0: $(OBJCOPY) -O binary $< $@ nuclear@0: nuclear@5: $(elf): tun_data.h $(obj) nuclear@0: $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) nuclear@0: nuclear@5: tun_data.h: tunnel.ppm nuclear@5: cat $< | tools/ppm2md tun_ >$@ nuclear@5: nuclear@5: tunnel.ppm: nuclear@5: tools/tunnel >$@ nuclear@5: nuclear@9: -include $(dep) nuclear@9: nuclear@9: %.d: %.c nuclear@9: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@9: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@5: rm -f $(obj) $(elf) $(bin) tun_data.h tunnel.ppm nuclear@0: nuclear@9: .PHONY: cleandep nuclear@9: cleandep: nuclear@9: rm -f $(dep) nuclear@9: nuclear@0: .PHONY: run nuclear@0: run: $(bin) nuclear@0: gens-sdl $< nuclear@0: nuclear@0: .PHONY: copy nuclear@0: copy: $(bin) nuclear@0: mount /media/usbmass && cp $(bin) /media/usbmass/$(bin) nuclear@0: umount /media/usbmass nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: $(bin) nuclear@0: mount /media/usbmass nuclear@0: [ -f /media/usbmass/MEGA/MEGA.RBF ] || cp $(bin) /media/usbmass/MEGA/MEGA.BIN nuclear@0: umount /media/usbmass