blues/Makefile

47 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2018-07-08 16:08:53 +02:00
SDL_CFLAGS := `sdl2-config --cflags`
2018-07-16 14:43:34 +02:00
SDL_LIBS := `sdl2-config --libs`
2018-07-08 16:08:53 +02:00
MODPLUG_LIBS ?= -lmodplug
2019-06-01 16:25:06 +02:00
BB := decode.c game.c level.c objects.c resource.c screen.c sound.c staticres.c tiles.c unpack.c
2018-12-16 13:34:03 +01:00
JA := game.c level.c resource.c screen.c sound.c staticres.c unpack.c
2019-06-02 02:55:05 +02:00
P2 := bosses.c game.c level.c monsters.c resource.c screen.c sound.c staticres.c unpack.c
2018-12-16 13:34:03 +01:00
BB_SRCS := $(foreach f,$(BB),bb/$f)
JA_SRCS := $(foreach f,$(JA),ja/$f)
2019-05-29 01:54:47 +02:00
P2_SRCS := $(foreach f,$(P2),p2/$f)
SRCS := $(BB_SRCS) $(JA_SRCS) $(P2_SRCS)
2018-07-08 16:08:53 +02:00
OBJS := $(SRCS:.c=.o)
DEPS := $(SRCS:.c=.d)
2022-03-12 23:43:11 +01:00
CPPFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wpedantic -MMD $(SDL_CFLAGS) -I. -g
2018-12-16 13:34:03 +01:00
2022-03-12 23:43:11 +01:00
all: blues
2018-12-16 13:34:03 +01:00
2022-03-12 23:43:11 +01:00
game_bb.o: CPPFLAGS += -fvisibility=hidden
2018-07-08 16:08:53 +02:00
2022-03-12 23:43:11 +01:00
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 $@
2018-07-08 16:08:53 +02:00
2022-03-12 23:53:43 +01:00
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)
2019-05-29 01:54:47 +02:00
2018-07-08 16:08:53 +02:00
clean:
2019-06-01 15:44:23 +02:00
rm -f $(OBJS) $(DEPS) *.o *.d
2018-07-08 16:08:53 +02:00
-include $(DEPS)