-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 739 Bytes
/
Copy pathMakefile
File metadata and controls
41 lines (29 loc) · 739 Bytes
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
PATH := $(DEVKITARM)/bin:$(PATH)
PROJ := main
TARGET := $(PROJ)
OBJS := $(PROJ).o
PREFIX := arm-none-eabi-
CC := $(PREFIX)gcc
LD := $(PREFIX)gcc
OBJCOPY := $(PREFIX)objcopy
ARCH := -mthumb-interwork -mthumb
SPECS := -specs=gba.specs
CFLAGS := $(ARCH) -O2 -Wall -fno-strict-aliasing
LDFLAGS := $(ARCH) $(SPECS)
EXECUTABLE := "C:/Program Files (x86)/mGBA/mGBA.exe"
build: $(TARGET).gba run
$(TARGET).gba : $(TARGET).elf
$(OBJCOPY) -v -O binary $< $@
-@gbafix $@
$(TARGET).elf : $(OBJS)
$(LD) $^ $(LDFLAGS) -o $@
$(OBJS) : %.o : %.c
$(CC) -c $< $(CFLAGS) -o $@
.PHONY : clean
clean :
@rm -fv *.gba
@rm -fv *.elf
@rm -fv *.o
.PHONY : run
run:
$(EXECUTABLE) C:/Users/Jasper/CLionProjects/gba/main.elf