2018-01-07 20:13:20 +01:00
|
|
|
#
|
|
|
|
# Winamp plugin
|
|
|
|
#
|
2016-11-15 00:05:19 +01:00
|
|
|
|
2018-08-20 20:08:24 +02:00
|
|
|
|
2018-09-08 17:07:33 +02:00
|
|
|
# cross-compile
|
2018-08-20 20:08:24 +02:00
|
|
|
ifneq ($(TARGET_OS),Windows_NT)
|
2018-09-08 17:07:33 +02:00
|
|
|
export CC=i586-mingw32msvc-gcc
|
|
|
|
export AR=i586-mingw32msvc-ar
|
|
|
|
export STRIP=i586-mingw32msvc-strip
|
|
|
|
export WINDRES=i586-mingw32msvc-windres
|
2016-11-15 00:05:19 +01:00
|
|
|
endif
|
|
|
|
|
2016-11-27 16:14:19 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
### main defs
|
|
|
|
OUTPUT_WINAMP = in_vgmstream.dll
|
2016-11-27 16:14:19 +01:00
|
|
|
|
2019-10-20 16:29:49 +02:00
|
|
|
CFLAGS += -ffast-math -O3 -Wall -Werror=format-security -Wdeclaration-after-statement -Wvla -DUSE_ALLOCA -DWIN32 -I../ext_includes $(EXTRA_CFLAGS)
|
2018-01-07 20:13:20 +01:00
|
|
|
LDFLAGS += -L../src -L../ext_libs -lm -lvgmstream $(EXTRA_LDFLAGS)
|
|
|
|
TARGET_EXT_LIBS =
|
2015-01-22 01:28:43 +01:00
|
|
|
|
2008-03-10 23:58:31 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
### external libs
|
2008-03-10 23:58:31 +01:00
|
|
|
|
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
|
2008-05-16 18:09:28 +02:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
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_G7221 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_G7221),1)
|
|
|
|
CFLAGS += -DVGM_USE_G7221
|
|
|
|
endif
|
|
|
|
|
|
|
|
VGM_ENABLE_G719 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_G719),1)
|
|
|
|
CFLAGS += -DVGM_USE_G719
|
|
|
|
LDFLAGS += -lg719_decode
|
|
|
|
TARGET_EXT_LIBS += libg719_decode.a
|
|
|
|
endif
|
2008-03-10 23:58:31 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
VGM_ENABLE_MAIATRAC3PLUS = 0
|
|
|
|
ifeq ($(VGM_ENABLE_MAIATRAC3PLUS),1)
|
|
|
|
CFLAGS += -DVGM_USE_MAIATRAC3PLUS
|
|
|
|
LDFLAGS += -lat3plusdecoder
|
|
|
|
TARGET_EXT_LIBS += libat3plusdecoder.a
|
|
|
|
endif
|
2008-06-15 07:43:40 +02:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
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
|
2010-03-23 21:57:12 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
VGM_ENABLE_ATRAC9 = 1
|
|
|
|
ifeq ($(VGM_ENABLE_ATRAC9),1)
|
|
|
|
CFLAGS += -DVGM_USE_ATRAC9
|
|
|
|
LDFLAGS += -latrac9
|
|
|
|
TARGET_EXT_LIBS += libatrac9.a
|
|
|
|
endif
|
2008-07-05 13:49:29 +02:00
|
|
|
|
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
|
|
|
|
|
2015-01-25 06:08:25 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
export CFLAGS LDFLAGS
|
2015-01-22 01:28:43 +01:00
|
|
|
|
2016-12-26 13:57:15 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
### targets
|
2016-12-26 13:57:15 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
|
|
|
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" in_vgmstream.c resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
|
|
|
$(STRIP) $(OUTPUT_WINAMP)
|
2016-12-26 13:57:15 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
resource.o: resource.rc resource.h
|
|
|
|
$(WINDRES) -o resource.o resource.rc
|
|
|
|
|
|
|
|
libvgmstream.a:
|
|
|
|
$(MAKE) -C ../src $@
|
|
|
|
|
|
|
|
$(TARGET_EXT_LIBS):
|
|
|
|
$(MAKE) -C ../ext_libs $@
|
2017-09-24 19:14:19 +02:00
|
|
|
|
2008-03-10 23:58:31 +01:00
|
|
|
clean:
|
2018-01-07 20:13:20 +01:00
|
|
|
$(RMF) $(OUTPUT_WINAMP) resource.o
|
|
|
|
|
|
|
|
.PHONY: clean in_vgmstream libvgmstream.a $(TARGET_EXT_LIBS)
|