Update Makefiles for ATRAC9, clean and remove .mingw variations

This commit is contained in:
bnnm 2018-01-07 20:13:20 +01:00
parent e12e87fc78
commit 29fc9386d6
7 changed files with 349 additions and 216 deletions

View File

@ -1,8 +1,55 @@
.PHONY: buildfullrelease buildrelease mingw_test mingw_winamp mingw_xmplay sourceball mingwbin
###############################
# vgmstream makefile
###############################
buildfullrelease: clean sourceball mingwbin
### defs
# currently aimed to WIN32 builds but vgmstream_cli should work for others (or use autotools instead)
export TARGET_OS = WIN32
buildrelease: clean mingwbin
### tools
RMF = rm -f
ifeq ($(TARGET_OS),WIN32)
SHELL = sh
CC = gcc
AR = ar
STRIP = strip
WINDRES = windres
DLLTOOL = dlltool
# same thing, the above should be available
#CC = i686-w64-mingw32-gcc
#AR = i686-w64-mingw32-ar
#STRIP = i686-w64-mingw32-strip
#WINDRES = i686-w64-mingw32-windres
#DLLTOOL = i686-w64-mingw32-dlltool
else
SHELL = /bin/sh
CC = gcc
AR = ar
STRIP = strip
WINDRES =
DLLTOOL =
# (old crosscompile, not used anymore?)
#CC = i586-mingw32msvc-gcc
#AR = i586-mingw32msvc-ar
#STRIP = i586-mingw32msvc-strip
#WINDRES = i586-mingw32msvc-windres
#DLLTOOL = i586-mingw32msvc-dlltool
endif
export RMF SHELL CC AR STRIP WINDRES DLLTOOL
### targets
buildrelease: clean bin
buildfullrelease: clean sourceball bin
sourceball:
rm -rf vgmstream-`./version.sh`
@ -13,23 +60,29 @@ sourceball:
tar cvzf "vgmstream-`./version.sh`.tar.gz" vgmstream-`./version.sh`/*
rm -rf vgmstream-`./version.sh`
mingwbin: mingw_test mingw_winamp mingw_xmplay
bin mingwbin: vgmstream_cli winamp xmplay
zip -FS -j "vgmstream-`./version.sh`-test.zip" COPYING README.md test/test.exe winamp/in_vgmstream.dll xmplay/xmp-vgmstream.dll ext_libs/*.dll
mingw_test:
$(MAKE) -C test -f Makefile.mingw test.exe
vgmstream_cli mingw_test:
$(MAKE) -C test vgmstream_cli
mingw_winamp:
$(MAKE) -C winamp in_vgmstream.dll
#vgmstream123:
# $(MAKE) -C test vgmstream123
mingw_xmplay:
$(MAKE) -C xmplay xmp-vgmstream.dll
winamp mingw_winamp:
$(MAKE) -C winamp in_vgmstream
xmplay mingw_xmplay:
$(MAKE) -C xmplay xmp_vgmstream
clean:
rm -f vgmstream-*.zip
$(RMF) vgmstream-*.zip
$(MAKE) -C src clean
$(MAKE) -C test clean
$(MAKE) -C test -f Makefile.mingw clean
$(MAKE) -C winamp clean
$(MAKE) -C xmplay clean
$(MAKE) -C ext_libs -f Makefile.mingw clean
$(MAKE) -C ext_libs clean
.PHONY: clean buildfullrelease buildrelease sourceball bin vgmstream_cli winamp xmplay mingwbin mingw_test mingw_winamp mingw_xmplay
#deprecated: buildfullrelease sourceball mingwbin mingw_test mingw_winamp mingw_xmplay

View File

@ -1,6 +1,12 @@
export SHELL = /bin/sh
#export DLLTOOL=i586-mingw32msvc-dlltool
export DLLTOOL=i686-w64-mingw32-dlltool
#
# external libs
#
# needed?
ifneq ($(TARGET_OS),WIN32)
$(error option must be built with TARGET_OS = WIN32)
endif
libvorbis.a: libvorbis.def
$(DLLTOOL) -d libvorbis.def -l libvorbis.a
@ -30,7 +36,9 @@ libswresample.a: swresample-vgmstream-3.dll swresample-vgmstream-3.def
$(DLLTOOL) -D swresample-vgmstream-3.dll -d swresample-vgmstream-3.def -l libswresample.a
libatrac9.a: libatrac9.dll libatrac9.def
$(DLLTOOL) -D libatrac9.dll -d libatrac9.ef -l libatrac9.a
$(DLLTOOL) -d libatrac9.dll -d libatrac9.def -l libatrac9.a
clean:
rm -f libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a libatrac9.a
$(RMF) libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a libatrac9.a
.PHONY: clean

View File

@ -1,26 +1,38 @@
# get all .c to find all possible .o
#
# main vgmstream code
#
# automatically get all possible .o by finding all .c
OBJECTS =
SRC_SRCS = $(wildcard *.c)
SRC_OBJS = $(patsubst %.c,%.o,$(SRC_SRCS))
OBJECTS += $(SRC_OBJS)
CODING_SRCS = $(wildcard coding/*.c)
CODING_OBJS = $(patsubst %.c,%.o,$(CODING_SRCS))
OBJECTS += $(CODING_OBJS)
LAYOUT_SRCS = $(wildcard layout/*.c)
LAYOUT_OBJS = $(patsubst %.c,%.o,$(LAYOUT_SRCS))
OBJECTS += $(LAYOUT_OBJS)
META_SRCS = $(wildcard meta/*.c)
META_OBJS = $(patsubst %.c,%.o,$(META_SRCS))
OBJECTS += $(META_OBJS)
EXT_LIBS_SRCS = $(wildcard ../ext_libs/*.c)
EXT_LIBS_OBJS = $(patsubst %.c,%.o,$(EXT_LIBS_SRCS))
OBJECTS += $(EXT_LIBS_OBJS)
OBJECTS = $(SRC_OBJS) $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS) $(EXT_LIBS_OBJS)
libvgmstream.a: $(OBJECTS)
$(AR) crs libvgmstream.a $(OBJECTS)
vgmstream-deps:
$(CC) $(CFLAGS) -M -o vgmstream-deps
#vgmstream-deps:
# $(CC) $(CFLAGS) -M -o vgmstream-deps
clean:
rm -f $(OBJECTS) libvgmstream.a
$(RMF) $(OBJECTS) libvgmstream.a
.PHONY: clean

View File

@ -1,20 +1,105 @@
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 -I../ext_includes -DUSE_ALLOCA -DVGM_USE_MAIATRAC3PLUS
# -DVGM_USE_G7221 -DVGM_USE_G719
export LDFLAGS=-L../src -L ../ext_libs -lvgmstream -lvorbis -lvorbisfile -lmpg123 -lat3plusdecoder -lpthread -lm
#-lg719_decode -lg7221_decode -lsiren_decode
export CC=gcc
export AR=ar
export STRIP=strip
#
# CLI tools
#
.PHONY: libvgmstream.a
test.exe: libvgmstream.a
$(CC) $(CFLAGS) $(LDFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -o vgmstream
$(STRIP) vgmstream
### main defs
ifeq ($(TARGET_OS),WIN32)
OUTPUT_CLI = test.exe
else
OUTPUT_CLI = vgmstream-cli
endif
# ? -DUSE_ALLOCA -DWIN32
CFLAGS += -Wall -O3 -DVAR_ARRAYS -I../ext_includes $(EXTRA_CFLAGS)
LDFLAGS += -L../src -L../ext_libs -lm -lvgmstream $(EXTRA_LDFLAGS)
TARGET_EXT_LIBS =
#ifdef VGM_DEBUG
# CFLAGS += -DVGM_DEBUG_OUTPUT -O0 -Werror=format-security -Wdeclaration-after-statement -Wvla
# CFLAGS += -Wold-style-definition -Woverflow -Wpointer-arith -Wstrict-prototypes -pedantic -std=gnu90 -fstack-protector -Wformat
#endif
### external libs
ifeq ($(TARGET_OS),WIN32)
VGM_ENABLE_VORBIS = 1
ifeq ($(VGM_ENABLE_VORBIS),1)
#CFLAGS += -DVGM_USE_VORBIS
LDFLAGS += -lvorbis
TARGET_EXT_LIBS += libvorbis.a
else
CFLAGS += -DVGM_DISABLE_VORBIS
endif
VGM_ENABLE_MPEG = 1
ifeq ($(VGM_ENABLE_MPEG),1)
#CFLAGS += -DVGM_USE_MPEG
LDFLAGS += -lmpg123-0
TARGET_EXT_LIBS += libmpg123-0.a
else
CFLAGS += -DVGM_DISABLE_MPEG
endif
VGM_ENABLE_G7221 = 1
ifeq ($(VGM_ENABLE_G7221),1)
CFLAGS += -DVGM_USE_G7221
LDFLAGS += -lg7221_decode
TARGET_EXT_LIBS += libg7221_decode.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
endif #if WIN32
export CFLAGS LDFLAGS
### targets
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
$(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -o $(OUTPUT_CLI)
$(STRIP) $(OUTPUT_CLI)
#vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
# $(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -lao -o $(OUTPUT_123)
# $(STRIP) $(OUTPUT_123)
libvgmstream.a:
$(MAKE) -C ../src $@
$(TARGET_EXT_LIBS):
$(MAKE) -C ../ext_libs $@
clean:
rm -f test test.o
$(RMF) $(OUTPUT_CLI)
.PHONY: clean vgmstream_cli libvgmstream.a $(TARGET_EXT_LIBS)

View File

@ -1,71 +0,0 @@
# optional parts
VGM_ENABLE_FFMPEG=1
ifeq ($(VGM_ENABLE_FFMPEG),1)
FFMPEG_CC=-DVGM_USE_FFMPEG
FFMPEG_LD=-lavcodec -lavformat -lavutil -lswresample
endif
VGM_ENABLE_MAIATRAC3PLUS=0
ifeq ($(VGM_ENABLE_MAIATRAC3PLUS),1)
MAT3P_CC=-DVGM_USE_MAIATRAC3PLUS
MAT3P_LD=-lat3plusdecoder
endif
#MPEG_CC=-DVGM_USE_MPEG
MPEG_LD=-lmpg123-0
VGM_DISABLE_MPEG=0
ifeq ($(VGM_DISABLE_MPEG),1)
MPEG_CC=-DVGM_DISABLE_MPEG
MPEG_LD=
endif
# config
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 $(MPEG_CC) -DVGM_USE_G7221 -DVGM_USE_G719 $(MAT3P_CC) $(FFMPEG_CC) -DVAR_ARRAYS -I../ext_includes $(EXTRA_CFLAGS)
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis $(MPEG_LD) -lg7221_decode -lg719_decode $(MAT3P_LD) $(FFMPEG_LD) -lm $(EXTRA_LDFLAGS)
#export CC=i586-mingw32msvc-gcc
#export AR=i586-mingw32msvc-ar
#export STRIP=i586-mingw32msvc-strip
export CC=i686-w64-mingw32-gcc
export AR=i686-w64-mingw32-ar
export STRIP=i686-w64-mingw32-strip
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a
test.exe: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a
$(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -o test.exe
$(STRIP) test.exe
libvgmstream.a:
$(MAKE) -C ../src $@
libvorbis.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libmpg123-0.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg7221_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg719_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libat3plusdecoder.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavcodec.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavformat.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavutil.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libswresample.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
clean:
rm -f test.exe

View File

@ -1,43 +1,86 @@
# optional parts
VGM_ENABLE_FFMPEG=1
ifeq ($(VGM_ENABLE_FFMPEG),1)
FFMPEG_CC=-DVGM_USE_FFMPEG
FFMPEG_LD=-lavcodec -lavformat -lavutil -lswresample
#
# Winamp plugin
#
ifneq ($(TARGET_OS),WIN32)
$(error option must be built with TARGET_OS = WIN32)
endif
VGM_ENABLE_MAIATRAC3PLUS=0
### main defs
OUTPUT_WINAMP = in_vgmstream.dll
CFLAGS += -Wall -O3 -DUSE_ALLOCA -DWIN32 -I../ext_includes $(EXTRA_CFLAGS)
LDFLAGS += -L../src -L../ext_libs -lm -lvgmstream $(EXTRA_LDFLAGS)
TARGET_EXT_LIBS =
### external libs
ifeq ($(TARGET_OS),WIN32)
VGM_ENABLE_VORBIS = 1
ifeq ($(VGM_ENABLE_VORBIS),1)
#CFLAGS += -DVGM_USE_VORBIS
LDFLAGS += -lvorbis
TARGET_EXT_LIBS += libvorbis.a
else
CFLAGS += -DVGM_DISABLE_VORBIS
endif
VGM_ENABLE_MPEG = 1
ifeq ($(VGM_ENABLE_MPEG),1)
#CFLAGS += -DVGM_USE_MPEG
LDFLAGS += -lmpg123-0
TARGET_EXT_LIBS += libmpg123-0.a
else
CFLAGS += -DVGM_DISABLE_MPEG
endif
VGM_ENABLE_G7221 = 1
ifeq ($(VGM_ENABLE_G7221),1)
CFLAGS += -DVGM_USE_G7221
LDFLAGS += -lg7221_decode
TARGET_EXT_LIBS += libg7221_decode.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)
MAT3P_CC=-DVGM_USE_MAIATRAC3PLUS
MAT3P_LD=-lat3plusdecoder
CFLAGS += -DVGM_USE_MAIATRAC3PLUS
LDFLAGS += -lat3plusdecoder
TARGET_EXT_LIBS += libat3plusdecoder.a
endif
#MPEG_CC=-DVGM_USE_MPEG
MPEG_LD=-lmpg123-0
VGM_DISABLE_MPEG=0
ifeq ($(VGM_DISABLE_MPEG),1)
MPEG_CC=-DVGM_DISABLE_MPEG
MPEG_LD=
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
# config
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 $(MPEG_CC) -DVGM_USE_G7221 -DVGM_USE_G719 $(MAT3P_CC) $(FFMPEG_CC) -DUSE_ALLOCA -DWIN32 -I../ext_includes $(EXTRA_CFLAGS)
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis $(MPEG_LD) -lg7221_decode -lg719_decode $(MAT3P_LD) $(FFMPEG_LD) -lm $(EXTRA_LDFLAGS)
export CC=i586-mingw32msvc-gcc
export AR=i586-mingw32msvc-ar
export STRIP=i586-mingw32msvc-strip
export WINDRES=i586-mingw32msvc-windres
#export CC=i686-w64-mingw32-gcc
#export AR=i686-w64-mingw32-ar
#export STRIP=i686-w64-mingw32-strip
#export WINDRES=i686-w64-mingw32-windres
endif #if WIN32
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a
export CFLAGS LDFLAGS
in_vgmstream.dll: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a resource.o
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" in_vgmstream.c resource.o $(LDFLAGS) -o in_vgmstream.dll
$(STRIP) in_vgmstream.dll
### targets
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)
resource.o: resource.rc resource.h
$(WINDRES) -o resource.o resource.rc
@ -45,32 +88,10 @@ resource.o: resource.rc resource.h
libvgmstream.a:
$(MAKE) -C ../src $@
libvorbis.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libmpg123-0.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg7221_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg719_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libat3plusdecoder.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavcodec.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavformat.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavutil.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libswresample.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
$(TARGET_EXT_LIBS):
$(MAKE) -C ../ext_libs $@
clean:
rm -f in_vgmstream.dll resource.o
$(RMF) $(OUTPUT_WINAMP) resource.o
.PHONY: clean in_vgmstream libvgmstream.a $(TARGET_EXT_LIBS)

View File

@ -1,69 +1,94 @@
# optional parts
VGM_ENABLE_FFMPEG=1
ifeq ($(VGM_ENABLE_FFMPEG),1)
FFMPEG_CC=-DVGM_USE_FFMPEG
FFMPEG_LD=-lavcodec -lavformat -lavutil -lswresample
#
# XMPlay plugin
#
ifneq ($(TARGET_OS),WIN32)
$(error option must be built with TARGET_OS = WIN32)
endif
VGM_ENABLE_MAIATRAC3PLUS=0
### main defs
OUTPUT_XMPLAY = xmp-vgmstream.dll
CFLAGS += -Wall -O3 -DUSE_ALLOCA -DWIN32 -I../ext_includes $(EXTRA_CFLAGS)
LDFLAGS += -L../src -L../ext_libs -lm -lvgmstream $(EXTRA_LDFLAGS)
TARGET_EXT_LIBS =
### external libs
ifeq ($(TARGET_OS),WIN32)
VGM_ENABLE_VORBIS = 1
ifeq ($(VGM_ENABLE_VORBIS),1)
#CFLAGS += -DVGM_USE_VORBIS
LDFLAGS += -lvorbis
TARGET_EXT_LIBS += libvorbis.a
else
CFLAGS += -DVGM_DISABLE_VORBIS
endif
VGM_ENABLE_MPEG = 1
ifeq ($(VGM_ENABLE_MPEG),1)
#CFLAGS += -DVGM_USE_MPEG
LDFLAGS += -lmpg123-0
TARGET_EXT_LIBS += libmpg123-0.a
else
CFLAGS += -DVGM_DISABLE_MPEG
endif
VGM_ENABLE_G7221 = 1
ifeq ($(VGM_ENABLE_G7221),1)
CFLAGS += -DVGM_USE_G7221
LDFLAGS += -lg7221_decode
TARGET_EXT_LIBS += libg7221_decode.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)
MAT3P_CC=-DVGM_USE_MAIATRAC3PLUS
MAT3P_LD=-lat3plusdecoder
CFLAGS += -DVGM_USE_MAIATRAC3PLUS
LDFLAGS += -lat3plusdecoder
TARGET_EXT_LIBS += libat3plusdecoder.a
endif
#MPEG_CC=-DVGM_USE_MPEG
MPEG_LD=-lmpg123-0
VGM_DISABLE_MPEG=0
ifeq ($(VGM_DISABLE_MPEG),1)
MPEG_CC=-DVGM_DISABLE_MPEG
MPEG_LD=
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
# config
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 $(MPEG_CC) -DVGM_USE_G7221 -DVGM_USE_G719 $(MAT3P_CC) $(FFMPEG_CC) -DUSE_ALLOCA -DWIN32 -I../ext_includes $(EXTRA_CFLAGS)
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis $(MPEG_LD) -lg7221_decode -lg719_decode $(MAT3P_LD) $(FFMPEG_LD) -lm $(EXTRA_LDFLAGS)
export CC=gcc
export AR=ar
export STRIP=strip
endif #if WIN32
export CFLAGS LDFLAGS
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a
### targets
xmp-vgmstream.dll: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a libg719_decode.a libat3plusdecoder.a libavcodec.a libavformat.a libavutil.a libswresample.a
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" xmp_vgmstream.c $(LDFLAGS) -o xmp-vgmstream.dll xmpin.def
$(STRIP) xmp-vgmstream.dll
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
$(STRIP) $(OUTPUT_XMPLAY)
libvgmstream.a:
$(MAKE) -C ../src $@
libvorbis.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libmpg123-0.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg7221_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libg719_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libat3plusdecoder.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavcodec.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavformat.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libavutil.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
libswresample.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
$(TARGET_EXT_LIBS):
$(MAKE) -C ../ext_libs $@
clean:
rm -f xmp-vgmstream.dll
$(RMF) $(OUTPUT_XMPLAY)
.PHONY: clean xmp_vgmstream libvgmstream.a $(TARGET_EXT_LIBS)