nuclear@6: csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c) nuclear@0: asrc = $(wildcard src/*.s) nuclear@0: aSsrc = $(wildcard src/*.S) nuclear@4: obj = $(asrc:.s=.o) $(aSsrc:.S=.o) $(csrc:.c=.o) nuclear@0: nuclear@0: name = test1 nuclear@0: elf = $(name).elf nuclear@0: bin = $(name).bin nuclear@0: nuclear@0: warn = -pedantic -Wall nuclear@0: dbg = -g nuclear@6: def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\" -D__NO_CTYPE nuclear@6: 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@6: CFLAGS = -m68000 -ffreestanding -fno-builtin $(warn) $(dbg) $(opt) $(def) $(inc) nuclear@1: CPPFLAGS = $(def) nuclear@0: ASFLAGS = -m68000 nuclear@6: LDFLAGS = -T megadrive.ldscript -print-gc-sections \ nuclear@6: -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@6: $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(elf) $(bin) nuclear@1: nuclear@1: .PHONY: run nuclear@1: run: $(bin) nuclear@1: gens-sdl $<