-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
65 lines (52 loc) · 2.37 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
################################################################################
# These are variables for the GBA toolchain build
# You can add others if you wish to
# ***** YOUR NAME HERE *****
################################################################################
# This should be a just a name i.e MyFirstGBAProgram
# No SPACES AFTER THE NAME.
PROGNAME = Tic-Tac-Pong
# Here you must put a list of all of the object files
# that will be compiled into your program. For example
# if you have main.c and myLib.c then in the following
# line you would put main.o and myLib.o
OFILES = gba.o sound.o sfx.o font.o main.o game.o ai.o images/splash.o images/diffscreen.o images/battery.o images/x.o images/o.o images/winscreen.o images/losescreen.o
################################################################################
# These are various settings used to make the GBA toolchain work
# DO NOT EDIT BELOW.
################################################################################
.PHONY: all
all: CFLAGS += $(CRELEASE) -I../shared
all: LDFLAGS += $(LDRELEASE)
all: $(PROGNAME).gba
@echo "[FINISH] Created $(PROGNAME).gba"
@rm -f Tic-Tac-Pong.tar.gz
@tar czvf Tic-Tac-Pong.tar.gz README.md dev-readme.md Tic-Tac-Pong.gba.cfg $(PROGNAME).gba
include lib/GBAVariables.mak
LDFLAGS += --specs=nosys.specs
# Adjust default compiler warnings and errors
CFLAGS += -Wstrict-prototypes -Wold-style-definition
GCC_IS_VER_7 := $(shell expr `echo $(GCC_VERSION) | cut -f1 -d.` \>= 7)
ifeq ($(GCC_IS_VER_7), 1)
CFLAGS += -Wno-error=implicit-fallthrough --warn-no-implicit-fallthrough
endif
debug: CFLAGS += $(CDEBUG) -I../shared
debug: LDFLAGS += $(LDDEBUG)
debug: $(PROGNAME).gba
@echo "[FINISH] Created $(PROGNAME).gba"
$(PROGNAME).gba: $(PROGNAME).elf
@echo "[LINK] Linking objects together to create $(PROGNAME).gba"
@$(OBJCOPY) -O binary $(PROGNAME).elf $(PROGNAME).gba
$(PROGNAME).elf: crt0.o $(GCCLIB)/crtbegin.o $(GCCLIB)/crtend.o $(GCCLIB)/crti.o $(GCCLIB)/crtn.o $(OFILES) libc_sbrk.o
$(CC) -o $(PROGNAME).elf $^ $(LDFLAGS)
.PHONY: med
med: CFLAGS += $(CRELEASE) -I../shared
med: LDFLAGS += $(LDRELEASE)
med: $(PROGNAME).gba
@echo "[EXECUTE] Running emulator Mednafen"
@echo " Please see emulator.log if this fails"
@mednafen $(MEDOPT) $(PROGNAME).gba >emulator.log 2>&1
.PHONY: clean
clean:
@echo "[CLEAN] Removing all compiled files"
rm -f *.o *.elf *.gba *.log */*.o