forked from prb28/vscode-amiga-wks-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (34 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
subdirs := $(wildcard */)
vasm_sources := $(wildcard *.asm) $(wildcard $(addsuffix *.asm, $(subdirs)))
vasm_objects := $(addprefix obj/, $(patsubst %.asm,%.o,$(notdir $(vasm_sources))))
objects := $(vasm_objects)
program = out/a
OUT = $(program)
CC = m68k-amiga-elf-gcc
VASM = vasmm68k_mot
ifdef OS
WINDOWS = 1
SHELL = cmd.exe
endif
CCFLAGS = -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions
LDFLAGS = -Wl,--emit-relocs,-Ttext=0,-Map=$(OUT).map
VASMFLAGS = -m68000 -Felf -opt-fconst -nowarn=62 -dwarf=3 -quiet -x -DDEBUG
all: $(OUT).exe
$(OUT).exe: $(OUT).elf
$(info Elf2Hunk $(program).exe)
@elf2hunk $(OUT).elf $(OUT).exe -s
$(OUT).elf: $(objects)
$(info Linking $(program).elf)
$(CC) $(CCFLAGS) $(LDFLAGS) $(objects) -o $@
@m68k-amiga-elf-objdump --disassemble --no-show-raw-ins --visualize-jumps -S $@ >$(OUT).s
clean:
$(info Cleaning...)
ifdef WINDOWS
@del /q obj\* out\*
else
@$(RM) obj/* out/*
endif
-include $(objects:.o=.d)
$(vasm_objects): obj/%.o : %.asm
$(info Assembling $<)
@$(VASM) $(VASMFLAGS) -o $@ $(CURDIR)/$<