File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 11.PHONY: all clean
22
33PROJECT = yatka
4-
5- $(PROJECT): main.c
6- arm-linux-gcc -g -Ofast -march=armv5te -mtune=arm926ej-s -o $(PROJECT) main.c -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer -D_BITTBOY
4+ SRC = src/main.c src/data_persistence.c src/video.c src/sound.c \
5+ src/state_gameover.c src/state_settings.c src/randomizer.c
6+ OBJ = $(SRC:.c=.o)
7+ DEP = $(SRC:.c=.d)
8+ CFLAGS = -Iinc -D_BITTBOY -Ofast -march=armv5te -mtune=arm926ej-s
9+ LDFLAGS = -s $(shell pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer)
10+ CC = arm-linux-gcc
711
812all: $(PROJECT)
913
14+ $(PROJECT): $(OBJ)
15+ $(CC) -o $(PROJECT) $(OBJ) $(LDFLAGS)
16+
17+ src/%.o: src/%.c
18+ $(CC) $(CFLAGS) -c -o $@ $<
19+
20+ src/%.d: src/%.c
21+ @set -e; \
22+ rm -f $@; \
23+ $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
24+ sed 's,\($*\)\.o[ :]*,src/\1.o $@ : ,g' < $@.$$$$ > $@; \
25+ rm -f $@.$$$$
26+
1027clean:
11- rm -rf $(PROJECT)
28+ rm -rf $(PROJECT) $(OBJ) $(DEP) src/*.d.*
29+
30+ -include $(DEP)
You can’t perform that action at this time.
0 commit comments