2018-01-07 20:13:20 +01:00
|
|
|
#
|
|
|
|
# CLI tools
|
|
|
|
#
|
2008-01-31 07:15:03 +01:00
|
|
|
|
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
### main defs
|
|
|
|
|
2018-08-20 20:08:24 +02:00
|
|
|
ifeq ($(TARGET_OS),Windows_NT)
|
2018-01-07 20:13:20 +01:00
|
|
|
OUTPUT_CLI = test.exe
|
2018-01-18 23:29:11 +01:00
|
|
|
OUTPUT_123 = vgmstream123.exe
|
2018-01-07 20:13:20 +01:00
|
|
|
else
|
|
|
|
OUTPUT_CLI = vgmstream-cli
|
2018-01-18 23:29:11 +01:00
|
|
|
OUTPUT_123 = vgmstream123
|
|
|
|
endif
|
|
|
|
|
|
|
|
# -DUSE_ALLOCA
|
2018-08-20 20:08:24 +02:00
|
|
|
ifeq ($(TARGET_OS),Windows_NT)
|
2018-01-18 23:29:11 +01:00
|
|
|
CFLAGS += -DWIN32
|
2018-01-07 20:13:20 +01:00
|
|
|
endif
|
|
|
|
|
2019-10-20 16:29:49 +02:00
|
|
|
CFLAGS += -ffast-math -O3 -Wall -Werror=format-security -Wdeclaration-after-statement -Wvla -DVAR_ARRAYS -I../ext_includes $(EXTRA_CFLAGS)
|
2018-08-20 20:08:24 +02:00
|
|
|
LDFLAGS += -L../src -L../ext_libs -lvgmstream $(EXTRA_LDFLAGS) -lm
|
2018-01-07 20:13:20 +01:00
|
|
|
TARGET_EXT_LIBS =
|
|
|
|
|
2018-01-18 23:29:11 +01:00
|
|
|
LIBAO_INC_PATH = ../../libao/include
|
|
|
|
LIBAO_LIB_PATH = ../../libao/bin
|
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
#ifdef VGM_DEBUG
|
2018-08-25 12:19:51 +02:00
|
|
|
# CFLAGS += -DVGM_DEBUG_OUTPUT -O0
|
2018-01-07 20:13:20 +01:00
|
|
|
# CFLAGS += -Wold-style-definition -Woverflow -Wpointer-arith -Wstrict-prototypes -pedantic -std=gnu90 -fstack-protector -Wformat
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2020-01-12 12:33:37 +01:00
|
|
|
# config libs
|
|
|
|
VGM_ENABLE_G7221 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_G7221),1)
|
|
|
|
CFLAGS += -DVGM_USE_G7221
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
### external libs
|
2018-08-20 20:08:24 +02:00
|
|
|
ifeq ($(TARGET_OS),Windows_NT)
|
2018-01-07 20:13:20 +01:00
|
|
|
|
|
|
|
VGM_ENABLE_VORBIS = 1
|
|
|
|
ifeq ($(VGM_ENABLE_VORBIS),1)
|
2018-08-20 20:08:24 +02:00
|
|
|
CFLAGS += -DVGM_USE_VORBIS
|
2018-01-07 20:13:20 +01:00
|
|
|
LDFLAGS += -lvorbis
|
|
|
|
TARGET_EXT_LIBS += libvorbis.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_MPEG = 1
|
|
|
|
ifeq ($(VGM_ENABLE_MPEG),1)
|
2018-08-20 20:08:24 +02:00
|
|
|
CFLAGS += -DVGM_USE_MPEG
|
2018-01-07 20:13:20 +01:00
|
|
|
LDFLAGS += -lmpg123-0
|
|
|
|
TARGET_EXT_LIBS += libmpg123-0.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_G719 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_G719),1)
|
|
|
|
CFLAGS += -DVGM_USE_G719
|
|
|
|
LDFLAGS += -lg719_decode
|
|
|
|
TARGET_EXT_LIBS += libg719_decode.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_MAIATRAC3PLUS = 0
|
|
|
|
ifeq ($(VGM_ENABLE_MAIATRAC3PLUS),1)
|
|
|
|
CFLAGS += -DVGM_USE_MAIATRAC3PLUS
|
|
|
|
LDFLAGS += -lat3plusdecoder
|
|
|
|
TARGET_EXT_LIBS += libat3plusdecoder.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_FFMPEG = 1
|
|
|
|
ifeq ($(VGM_ENABLE_FFMPEG),1)
|
|
|
|
CFLAGS += -DVGM_USE_FFMPEG
|
|
|
|
LDFLAGS += -lavcodec -lavformat -lavutil -lswresample
|
|
|
|
TARGET_EXT_LIBS += libavcodec.a libavformat.a libavutil.a libswresample.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_ATRAC9 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_ATRAC9),1)
|
|
|
|
CFLAGS += -DVGM_USE_ATRAC9
|
|
|
|
LDFLAGS += -latrac9
|
|
|
|
TARGET_EXT_LIBS += libatrac9.a
|
|
|
|
endif
|
|
|
|
|
2018-08-12 23:00:13 +02:00
|
|
|
VGM_ENABLE_CELT = 1
|
|
|
|
ifeq ($(VGM_ENABLE_CELT),1)
|
|
|
|
CFLAGS += -DVGM_USE_CELT
|
|
|
|
LDFLAGS += -lcelt-0061 -lcelt-0110
|
|
|
|
TARGET_EXT_LIBS += libcelt-0061.a libcelt-0110.a
|
|
|
|
endif
|
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
endif #if WIN32
|
|
|
|
|
|
|
|
export CFLAGS LDFLAGS
|
|
|
|
|
|
|
|
### targets
|
|
|
|
|
|
|
|
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
2018-02-10 18:07:16 +01:00
|
|
|
$(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
2018-01-07 20:13:20 +01:00
|
|
|
$(STRIP) $(OUTPUT_CLI)
|
|
|
|
|
2018-01-18 23:29:11 +01:00
|
|
|
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
|
|
|
$(CC) $(CFLAGS) -I$(LIBAO_INC_PATH) "-DVERSION=\"`../version.sh`\"" vgmstream123.c $(LDFLAGS) -L$(LIBAO_LIB_PATH) -lao -o $(OUTPUT_123)
|
|
|
|
$(STRIP) $(OUTPUT_123)
|
2008-03-25 08:25:46 +01:00
|
|
|
|
2008-03-10 20:20:40 +01:00
|
|
|
libvgmstream.a:
|
2015-01-22 01:28:43 +01:00
|
|
|
$(MAKE) -C ../src $@
|
2008-02-06 01:27:51 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
$(TARGET_EXT_LIBS):
|
|
|
|
$(MAKE) -C ../ext_libs $@
|
|
|
|
|
2008-01-31 07:15:03 +01:00
|
|
|
clean:
|
2018-01-07 20:13:20 +01:00
|
|
|
$(RMF) $(OUTPUT_CLI)
|
|
|
|
|
|
|
|
.PHONY: clean vgmstream_cli libvgmstream.a $(TARGET_EXT_LIBS)
|