forked from cyxx/blues
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (31 loc) · 1.18 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
SDL_CFLAGS := `sdl2-config --cflags`
SDL_LIBS := `sdl2-config --libs`
MODPLUG_LIBS ?= -lmodplug
BB := decode.c game.c level.c objects.c resource.c screen.c sound.c staticres.c tiles.c unpack.c
JA := game.c level.c resource.c screen.c sound.c staticres.c unpack.c
P2 := bosses.c game.c level.c monsters.c resource.c screen.c sound.c staticres.c unpack.c
BB_SRCS := $(foreach f,$(BB),bb/$f)
JA_SRCS := $(foreach f,$(JA),ja/$f)
P2_SRCS := $(foreach f,$(P2),p2/$f)
SRCS := $(BB_SRCS) $(JA_SRCS) $(P2_SRCS)
OBJS := $(SRCS:.c=.o)
DEPS := $(SRCS:.c=.d)
CPPFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wpedantic -MMD $(SDL_CFLAGS) -I. -g
all: blues
game_bb.o: CPPFLAGS += -fvisibility=hidden
game_bb.o: $(BB_SRCS:.c=.o)
ld -r -o $@ $^
objcopy --localize-hidden $@
game_ja.o: CPPFLAGS += -fvisibility=hidden
game_ja.o: $(JA_SRCS:.c=.o)
ld -r -o $@ $^
objcopy --localize-hidden $@
game_p2.o: CPPFLAGS += -fvisibility=hidden
game_p2.o: $(P2_SRCS:.c=.o)
ld -r -o $@ $^
objcopy --localize-hidden $@
blues: main.o mixer.o sys_sdl2.o util.o game_bb.o game_ja.o game_p2.o
$(CC) $(LDFLAGS) -o $@ $^ $(SDL_LIBS) $(MODPLUG_LIBS)
clean:
rm -f $(OBJS) $(DEPS) *.o *.d
-include $(DEPS)