-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
25 lines (19 loc) · 876 Bytes
/
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
# Èìÿ âûõîäíîãî ôàéëà ïðîãðàììû
PROGNAME = shootemup
# Âûäåëÿåì èç .cpp ôàéëîâ â src/ ÷èñòûé ñïèñîê èì¸í ìîäóëåé áåç ïóòåé è ðàñøèðåíèé
MODULES = $(patsubst %.cpp,%,$(notdir $(wildcard src/*.cpp)))
# Ïîäãîòîâàëèâàåì ñïèñêè ìîäóëåé ïî òèïàì äîáàâëÿÿ èìÿ ïîäïàïîê âïåðåäè è ðàñøèðåíèÿ â êîíöå
MODULES_CPP = $(addsuffix .cpp,$(addprefix src/,$(MODULES)))
MODULES_O = $(addsuffix .o,$(addprefix out/,$(MODULES)))
MODULES_DEP = $(addsuffix .dep,$(addprefix out/,$(MODULES)))
$(PROGNAME).gba: out/$(PROGNAME).elf
objcopy -O binary out/$(PROGNAME).elf $(PROGNAME).gba
$(DEVKITPRO)/tools/bin/gbafix $(PROGNAME).gba
out/$(PROGNAME).elf: $(MODULES_O)
$(CXX) $(PARAMS) $(MODULES_O) -o out/$(PROGNAME).elf
out/%.o: src/%.cpp
$(CXX) $(PARAMS) -o $@ -c $<
dep: $(MODULES_DEP)
out/%.dep: src/%.cpp
$(CXX) -MT $(patsubst %.dep,%.o,$@) -MM $(PARAMS) $< > $@
-include $(MODULES_DEP)