63 lines
1.7 KiB
Makefile
63 lines
1.7 KiB
Makefile
|
|
SDL_CFLAGS := -D__USE_INLINE__ -I/sdk/local/newlib/include/SDL2
|
|
SDL_LIBS := -lSDL2_mixer -lmikmod -lmodplug -lFLAC -logg -lSDL2 -lpthread -athread=native -lstdc++
|
|
|
|
MODPLUG_LIBS ?=
|
|
|
|
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 += -O2 -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)
|
|
|
|
|
|
# prepare an archive for the program
|
|
release:
|
|
@echo "Creating release files..."
|
|
@strip blues
|
|
@mkdir -p release/blues
|
|
@copy ALL release_files/ release/blues/ QUIET
|
|
@copy blues "release/blues/Blues Brothers/"
|
|
@copy blues "release/blues/Jukebox Adventure/"
|
|
@copy blues "release/blues/Prehistorik 2/"
|
|
@copy README.md release/blues/
|
|
@echo "Creating release archive..."
|
|
@lha -aeqr3 a blues.lha release/
|
|
@echo "Clean release files..."
|
|
@delete release ALL QUIET FORCE
|