-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.retrofw
38 lines (29 loc) · 934 Bytes
/
Makefile.retrofw
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 opk
BIN_BASE = /opt/retrofw/bin/
PROJECT = yatka-retrofw
OPK_NAME = yatka.opk
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_RETROFW -Ofast
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer)
CC = mipsel-linux-gcc
all: opk
opk: $(OPK_NAME)
$(PROJECT): $(OBJ)
$(CC) -o $(PROJECT) $(OBJ) $(LDFLAGS)
$(OPK_NAME): $(PROJECT) skins sfx music icon.png README.md LICENSE.md yatka.retrofw.desktop
mksquashfs $^ $@ -noappend -no-xattrs
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.* $(OPK_NAME)
-include $(DEP)