-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.bittboy
38 lines (29 loc) · 973 Bytes
/
Makefile.bittboy
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
.PHONY: all clean zip
BIN_BASE = /opt/miyoo/bin/
PROJECT = yatka
ZIPNAME = $(PROJECT).zip
SRC = src/main.c src/data_persistence.c src/video.c src/sound.c \
src/state_gameover.c src/state_settings.c src/randomizer.c \
src/state_mainmenu.c src/skin.c
OBJ = $(SRC:.c=.o)
DEP = $(SRC:.c=.d)
CFLAGS = -Iinc -D_BITTBOY -Ofast -march=armv5te -mtune=arm926ej-s
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer) -ljpeg -logg -lfreetype -lpng -lz -lbz2
CC = arm-linux-gcc
all: $(PROJECT)
zip: $(ZIPNAME)
$(ZIPNAME): $(PROJECT) skins sfx music icon.png yatka.png README.md LICENSE.md
zip -r $(ZIPNAME) $^
$(PROJECT): $(OBJ)
$(CC) -o $(PROJECT) $(OBJ) $(LDFLAGS)
src/%.o: src/%.c
$(CC) $(CFLAGS) -c -o $@ $<
src/%.d: src/%.c
@set -e; \
rm -f $@; \
$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,src/\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
clean:
rm -rf $(PROJECT) $(OBJ) $(DEP) src/*.d.* $(ZIPNAME)
-include $(DEP)