mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 00:20:47 +01:00
builds: fix makefile version issues and cleanup
This commit is contained in:
parent
f6f26c7992
commit
2fbbe32386
75
Makefile
75
Makefile
@ -4,16 +4,11 @@
|
|||||||
|
|
||||||
ifeq ($(VGMSTREAM_VERSION),)
|
ifeq ($(VGMSTREAM_VERSION),)
|
||||||
# for current dir (expanded later)
|
# for current dir (expanded later)
|
||||||
VGMSTREAM_VERSION_CURR=`./version-get.sh`
|
VGMSTREAM_VERSION=`sh ./version-get.sh`
|
||||||
# for subdirs (expanded later)
|
|
||||||
VGMSTREAM_VERSION_PREV=`../version-get.sh`
|
|
||||||
else
|
else
|
||||||
VGMSTREAM_VERSION_CURR=$(VGMSTREAM_VERSION)
|
VGMSTREAM_VERSION=$(VGMSTREAM_VERSION)
|
||||||
VGMSTREAM_VERSION_PREV=$(VGMSTREAM_VERSION)
|
|
||||||
endif
|
endif
|
||||||
|
DEF_CFLAGS += -DVGMSTREAM_VERSION_AUTO
|
||||||
export VGMSTREAM_VERSION_PREV
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### external defs
|
### external defs
|
||||||
@ -98,6 +93,7 @@ endif
|
|||||||
### external libs
|
### external libs
|
||||||
# (call "make VGM_xxx = 0/1" to override 0/1 defaults, as Make does)
|
# (call "make VGM_xxx = 0/1" to override 0/1 defaults, as Make does)
|
||||||
ifeq ($(TARGET_OS),Windows_NT)
|
ifeq ($(TARGET_OS),Windows_NT)
|
||||||
|
|
||||||
# enabled by default on Windows
|
# enabled by default on Windows
|
||||||
VGM_VORBIS = 1
|
VGM_VORBIS = 1
|
||||||
ifneq ($(VGM_VORBIS),0)
|
ifneq ($(VGM_VORBIS),0)
|
||||||
@ -222,14 +218,22 @@ export DEF_CFLAGS LIBS_CFLAGS LIBS_LDFLAGS LIBS_TARGET_EXT_LIBS
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### internal defs
|
### internal defs
|
||||||
ZIP_FILES = COPYING
|
ifeq ($(TARGET_OS),Windows_NT)
|
||||||
ZIP_FILES+= README.md
|
ZIP_FILES = COPYING
|
||||||
ZIP_FILES+= cli/test.exe
|
ZIP_FILES += README.md
|
||||||
ZIP_FILES+= winamp/in_vgmstream.dll
|
ZIP_FILES += cli/test.exe
|
||||||
ZIP_FILES+= xmplay/xmp-vgmstream.dll
|
ZIP_FILES += winamp/in_vgmstream.dll
|
||||||
ZIP_FILES+= ext_libs/*.dll
|
ZIP_FILES += xmplay/xmp-vgmstream.dll
|
||||||
ZIP_FILES+= ext_libs/libspeex/*.dll
|
ZIP_FILES += ext_libs/*.dll
|
||||||
ZIP_FILES_AO = $(LIBAO_DLL_PATH)/*.dll
|
ZIP_FILES += ext_libs/libspeex/*.dll
|
||||||
|
ZIP_FILES_AO = cli/vgmstream123.exe
|
||||||
|
ZIP_FILES_AO += $(LIBAO_DLL_PATH)/*.dll
|
||||||
|
else
|
||||||
|
ZIP_FILES = COPYING
|
||||||
|
ZIP_FILES += README.md
|
||||||
|
ZIP_FILES += cli/vgmstream-cli
|
||||||
|
ZIP_FILES_AO = cli/vgmstream123
|
||||||
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### targets
|
### targets
|
||||||
@ -240,33 +244,38 @@ buildrelease-ex: clean bin-ex
|
|||||||
buildfullrelease: clean sourceball bin
|
buildfullrelease: clean sourceball bin
|
||||||
|
|
||||||
sourceball:
|
sourceball:
|
||||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
rm -rf vgmstream-$(VGMSTREAM_VERSION)
|
||||||
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION_CURR)/
|
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION)/
|
||||||
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION_CURR).zip master
|
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION).zip master
|
||||||
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION)/version-get.sh
|
||||||
echo "echo \"$(VGMSTREAM_VERSION_CURR)\"" >> vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
echo "echo \"$(VGMSTREAM_VERSION)\"" >> vgmstream-$(VGMSTREAM_VERSION)/version-get.sh
|
||||||
tar cvzf "vgmstream-$(VGMSTREAM_VERSION_CURR).tar.gz" vgmstream-$(VGMSTREAM_VERSION_CURR)/*
|
tar cvzf "vgmstream-$(VGMSTREAM_VERSION)-src.tar.gz" vgmstream-$(VGMSTREAM_VERSION)/*
|
||||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
rm -rf vgmstream-$(VGMSTREAM_VERSION)
|
||||||
|
|
||||||
bin mingwbin: vgmstream_cli winamp xmplay
|
bin: vgmstream_cli winamp xmplay
|
||||||
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES)
|
mkdir -p bin
|
||||||
|
zip -FS -j "bin/vgmstream-$(VGMSTREAM_VERSION).zip" $(ZIP_FILES)
|
||||||
|
|
||||||
#separate since vgmstream123 is kinda untested
|
#separate since vgmstream123 is kinda untested
|
||||||
bin-ex mingwbin-ex: vgmstream_cli winamp xmplay vgmstream123
|
bin-ex: vgmstream_cli winamp xmplay vgmstream123
|
||||||
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
mkdir -p bin
|
||||||
|
zip -FS -j "bin/vgmstream-$(VGMSTREAM_VERSION).zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
||||||
|
|
||||||
vgmstream_cli mingw_test:
|
vgmstream_cli: version
|
||||||
$(MAKE) -C cli vgmstream_cli
|
$(MAKE) -C cli vgmstream_cli
|
||||||
|
|
||||||
vgmstream123:
|
vgmstream123: version
|
||||||
$(MAKE) -C cli vgmstream123
|
$(MAKE) -C cli vgmstream123
|
||||||
|
|
||||||
winamp mingw_winamp:
|
winamp: version
|
||||||
$(MAKE) -C winamp in_vgmstream
|
$(MAKE) -C winamp in_vgmstream
|
||||||
|
|
||||||
xmplay mingw_xmplay:
|
xmplay: version
|
||||||
$(MAKE) -C xmplay xmp_vgmstream
|
$(MAKE) -C xmplay xmp_vgmstream
|
||||||
|
|
||||||
|
version:
|
||||||
|
sh version-make.sh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RMF) vgmstream-*.zip
|
$(RMF) vgmstream-*.zip
|
||||||
$(MAKE) -C src clean
|
$(MAKE) -C src clean
|
||||||
@ -275,6 +284,4 @@ clean:
|
|||||||
$(MAKE) -C xmplay clean
|
$(MAKE) -C xmplay clean
|
||||||
$(MAKE) -C ext_libs clean
|
$(MAKE) -C ext_libs clean
|
||||||
|
|
||||||
.PHONY: clean buildfullrelease buildrelease sourceball bin vgmstream_cli winamp xmplay mingwbin mingw_test mingw_winamp mingw_xmplay
|
.PHONY: clean buildfullrelease buildrelease sourceball bin vgmstream_cli winamp
|
||||||
|
|
||||||
#deprecated: buildfullrelease sourceball mingwbin mingw_test mingw_winamp mingw_xmplay
|
|
||||||
|
@ -6,7 +6,7 @@ inputplugindir = $(plugindir)/$(INPUT_PLUGIN_DIR)
|
|||||||
inputplugin_LTLIBRARIES = libvgmstream.la
|
inputplugin_LTLIBRARIES = libvgmstream.la
|
||||||
|
|
||||||
AM_MAKEFLAGS=-f Makefile.autotools
|
AM_MAKEFLAGS=-f Makefile.autotools
|
||||||
AM_CXXFLAGS = -DVGMSTREAM_VERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
AM_CXXFLAGS = -DVGMSTREAM_VERSION_AUTO -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
||||||
AM_LIBS =
|
AM_LIBS =
|
||||||
|
|
||||||
# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though)
|
# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though)
|
||||||
|
@ -25,11 +25,9 @@ sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $META_HDRS/g" ./src/meta/Makefile.autot
|
|||||||
sed -i -e "s/libvgmstream_la_SOURCES =.*/libvgmstream_la_SOURCES = $AUDACIOUS_SRCS/g" ./audacious/Makefile.autotools.am
|
sed -i -e "s/libvgmstream_la_SOURCES =.*/libvgmstream_la_SOURCES = $AUDACIOUS_SRCS/g" ./audacious/Makefile.autotools.am
|
||||||
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $AUDACIOUS_HDRS/g" ./audacious/Makefile.autotools.am
|
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $AUDACIOUS_HDRS/g" ./audacious/Makefile.autotools.am
|
||||||
|
|
||||||
# get version to show in about dialogs
|
# make version to show in about dialogs
|
||||||
# again, not very pretty
|
# again, not very pretty
|
||||||
VGMSTREAM_VERSION=`./version-get.sh`
|
sh version-make.sh
|
||||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./audacious/Makefile.autotools.am
|
|
||||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./cli/Makefile.autotools.am
|
|
||||||
|
|
||||||
# create fake files expected by automake and process
|
# create fake files expected by automake and process
|
||||||
touch README AUTHORS NEWS ChangeLog
|
touch README AUTHORS NEWS ChangeLog
|
||||||
|
@ -44,11 +44,11 @@ export CFLAGS LDFLAGS
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
$(CC) $(CFLAGS) vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
||||||
$(STRIP) $(OUTPUT_CLI)
|
$(STRIP) $(OUTPUT_CLI)
|
||||||
|
|
||||||
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) $(CFLAGS) $(LIBAO_INC) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream123.c $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
|
$(CC) $(CFLAGS) $(LIBAO_INC) vgmstream123.c $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
|
||||||
$(STRIP) $(OUTPUT_123)
|
$(STRIP) $(OUTPUT_123)
|
||||||
|
|
||||||
libvgmstream.a:
|
libvgmstream.a:
|
||||||
|
@ -6,7 +6,7 @@ if HAVE_LIBAO
|
|||||||
bin_PROGRAMS += vgmstream123
|
bin_PROGRAMS += vgmstream123
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AM_CFLAGS = -DVGMSTREAM_VERSION=\"VGMSTREAM_VERSION\" -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AO_CFLAGS)
|
AM_CFLAGS = -DVGMSTREAM_VERSION_AUTO -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AO_CFLAGS)
|
||||||
AM_MAKEFLAGS = -f Makefile.autotools
|
AM_MAKEFLAGS = -f Makefile.autotools
|
||||||
|
|
||||||
vgmstream_cli_SOURCES = vgmstream_cli.c
|
vgmstream_cli_SOURCES = vgmstream_cli.c
|
||||||
|
@ -1,18 +1,38 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# echo current git version (doesn't make version_auto.h)
|
# echo current git version (doesn't make version_auto.h)
|
||||||
|
VERSION_DEFAULT=unknown
|
||||||
|
VERSION_NAME=VGMSTREAM_VERSION
|
||||||
|
#VERSION_FILE=version_auto.h
|
||||||
|
|
||||||
|
|
||||||
# try get version from Git (dynamic), including lightweight tags
|
# try get version from Git (dynamic), including lightweight tags
|
||||||
if ! command -v git > /dev/null
|
if ! command -v git > /dev/null ; then
|
||||||
then
|
VERSION=""
|
||||||
VERSION="unknown"
|
|
||||||
else
|
else
|
||||||
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ignore git stderr "fatal:
|
# ignore git stderr "fatal:*" or blank
|
||||||
if case $VERSION in fatal*) ;; *) false;; esac; then
|
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
||||||
echo "unknown"
|
LINE="$VERSION"
|
||||||
else
|
else
|
||||||
echo "$VERSION"
|
# try to get version from version.h (static)
|
||||||
fi;
|
#echo "Git version not found, can't autogenerate version (using default)"
|
||||||
|
LINE="$VERSION_DEFAULT"
|
||||||
|
|
||||||
|
while IFS= read -r -u3 item; do
|
||||||
|
COMP="#define $VERSION_NAME*"
|
||||||
|
if [[ $item == $COMP ]] ; then
|
||||||
|
STR_REM1="*$VERSION_NAME \""
|
||||||
|
STR_REM2="\"*"
|
||||||
|
LINE=$item
|
||||||
|
LINE=${LINE/$STR_REM1/}
|
||||||
|
LINE=${LINE/$STR_REM2/}
|
||||||
|
fi
|
||||||
|
done 3< "version.h"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# final print
|
||||||
|
echo "$LINE"
|
||||||
|
@ -13,7 +13,6 @@ else
|
|||||||
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ignore git stderr "fatal:*" or blank
|
# ignore git stderr "fatal:*" or blank
|
||||||
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
||||||
LINE="#define $VERSION_NAME \"$VERSION\" /* autogenerated */"
|
LINE="#define $VERSION_NAME \"$VERSION\" /* autogenerated */"
|
||||||
|
@ -40,7 +40,7 @@ SRC_SRCS = in_vgmstream.c in_streamfile.c in_config.c
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
||||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
$(CC) -shared -static-libgcc $(CFLAGS) $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
||||||
$(STRIP) $(OUTPUT_WINAMP)
|
$(STRIP) $(OUTPUT_WINAMP)
|
||||||
|
|
||||||
resource.o: resource.rc resource.h
|
resource.o: resource.rc resource.h
|
||||||
|
@ -36,7 +36,7 @@ export CFLAGS LDFLAGS
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
|
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
$(CC) -shared -static-libgcc $(CFLAGS) xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
||||||
$(STRIP) $(OUTPUT_XMPLAY)
|
$(STRIP) $(OUTPUT_XMPLAY)
|
||||||
|
|
||||||
libvgmstream.a:
|
libvgmstream.a:
|
||||||
|
Loading…
Reference in New Issue
Block a user