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@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@0: def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\" -D__NO_CTYPE nuclear@0: inc = -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@0: ASFLAGS = -m68000 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@0: $(elf): $(obj) nuclear@0: $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(elf) $(bin) nuclear@0: 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