Commit d49a6899 authored by Albert Gräf's avatar Albert Gräf Committed by Albert Gräf
Browse files

Try to untangle the Gordian knot of Pd-l2ork versions.

parent 16cda148
......@@ -128,7 +128,7 @@ HAVE_AUTOGEN_SH := $(wildcard $(pd_src)/autogen.sh)
ifeq (autogen.sh, $(findstring autogen.sh,$(HAVE_AUTOGEN_SH)))
#----------------------------------------------------------------------------#
# new autotools build system
pd: set_version
pd: git_version
cd $(pd_src) \
&& ./autogen.sh \
&& ./configure $(PD_CONFIGURE_FLAGS) \
......@@ -154,7 +154,7 @@ $(pd_src)/src/configure: $(pd_src)/src/configure.ac
# cd $(pd_src)/src/ && ./configure $(PD_CONFIGURE_FLAGS)
# this line has the "-" to support the current makefile.mingw hack
pd: $(pd_src)/src/configure set_version
pd: $(pd_src)/src/configure git_version
-cd $(pd_src)/src && ./configure $(PD_CONFIGURE_FLAGS) && \
make OPT_CFLAGS="" depend && \
make $(DEST_PATHS) $(PD_BUILD_FLAGS)
......@@ -477,19 +477,28 @@ devsymlinks_clean:
-sudo rm -f /usr/local/lib/libtcl*.dylib /usr/local/lib/libtk*.dylib
-sudo rm -f /usr/local/lib/libtclstub*.a /usr/local/lib/libtkstub*.a
# AG: The set_version target is broken since it modifies m_pd.h in-place
# during the build, which is a bad thing to do to files which are supposed to
# be kept in a source code repository. Instead, let's generate m_pd.h from
# m_pd.h.in, where the latter is kept in the repo and the former gets created
# from the latter when needed.
git_version: $(pd_src)/src/m_pd.h.in
cd $(pd_src)/src/ && \
sed 's|^\(#define PD_TEST_VERSION "\).*"|\1$(GIT_VERSION)"|' m_pd.h.in > m_pd.h
set_version:
# change Pd's version number to reflect the extended build
# this needs the complete_version_defines patch to work
cd $(pd_src)/src/ && \
sed 's|^\(#define PD_TEST_VERSION "\).*"|\1$(PD-EXTENDED_VERSION)"|' m_pd.h > \
sed 's|^\(#define PD_TEST_VERSION "\).*"|\1$(GIT_VERSION)"|' m_pd.h > \
m_pd.h.tmp && mv m_pd.h.tmp m_pd.h
unset_version:
# change the version number back to the original
# this needs the complete_version_defines patch to work
cd $(pd_src)/src && \
sed 's|^\(#define PD_TEST_VERSION ".*\)$(PD-EXTENDED_VERSION_PREFIX).*"|\1"|' \
sed 's|^\(#define PD_TEST_VERSION ".*\)$(GIT_VERSION_PREFIX).*"|\1"|' \
m_pd.h > m_pd.h.tmp && \
mv m_pd.h.tmp m_pd.h
......@@ -554,7 +563,7 @@ patch_pd_devel:
# change Pd's version number to reflect the extended build
# this needs the complete_version_defines patch to work
cd $(pd_src)/src/ && \
sed 's|^\(#define PD_TEST_VERSION "\).*"|\1$(PD-EXTENDED_VERSION)"|' m_pd.h > \
sed 's|^\(#define PD_TEST_VERSION "\).*"|\1$(GIT_VERSION)"|' m_pd.h > \
m_pd.h.tmp && mv m_pd.h.tmp m_pd.h
@echo " "
@echo "patching completed."
......@@ -564,7 +573,7 @@ unpatch_pd_devel:
# change the version number back to the original
# this needs the complete_version_defines patch to work
cd $(pd_src)/src && \
sed 's|^\(#define PD_TEST_VERSION ".*\)$(PD-EXTENDED_VERSION)"|\1"|' \
sed 's|^\(#define PD_TEST_VERSION ".*\)$(GIT_VERSION)"|\1"|' \
m_pd.h > m_pd.h.tmp && \
mv m_pd.h.tmp m_pd.h
# apply all platform-specific patches
......@@ -611,7 +620,7 @@ distclean: cruft_clean
test_locations:
@echo "PD_VERSION: $(PD_VERSION)"
@echo "PD-EXTENDED_VERSION: $(PD-EXTENDED_VERSION)"
@echo "GIT_VERSION: $(GIT_VERSION)"
@echo "CWD $(CWD)"
@echo "DESTDIR $(DESTDIR)"
@echo "PREFIX $(prefix)"
......
......@@ -168,26 +168,48 @@ installdirs: $(DESTDIR) $(bindir) $(examplesdir) $(pddocdir) $(includedir) $(hel
#==============================================================================#
PD_MAJOR_VERSION := $(shell grep PD_MAJOR_VERSION $(pd_src)/src/m_pd.h | \
# AG: "Abandon hope all ye who enter here." Past this point lies madness. Most
# of Pd's version information is kept in m_pd.h, but some of it needs to be
# generated at build time to keep in sync with git sources. Since we don't
# want to have files in the repo which get updated with every build, we use a
# template m_pd.h.in for m_pd.h instead. The stable version parts (only
# updated by editing m_pd.h.in manually) can be read from there.
PD_MAJOR_VERSION := $(shell grep PD_MAJOR_VERSION $(pd_src)/src/m_pd.h.in | \
sed 's|^.define *PD_MAJOR_VERSION *\([0-9]*\).*|\1|' )
PD_MINOR_VERSION := $(shell grep PD_MINOR_VERSION $(pd_src)/src/m_pd.h | \
PD_MINOR_VERSION := $(shell grep PD_MINOR_VERSION $(pd_src)/src/m_pd.h.in | \
sed 's|^.define *PD_MINOR_VERSION *\([0-9]*\).*|\1|' )
PD_BUGFIX_VERSION := $(shell grep PD_BUGFIX_VERSION $(pd_src)/src/m_pd.h | \
PD_BUGFIX_VERSION := $(shell grep PD_BUGFIX_VERSION $(pd_src)/src/m_pd.h.in | \
sed 's|^.define *PD_BUGFIX_VERSION *\([0-9]*\).*|\1|' )
PD_TEST_VERSION := $(shell grep PD_TEST_VERSION $(pd_src)/src/m_pd.h | \
sed 's|^.define *PD_TEST_VERSION *"\(.*\)".*|\1|' )
#PD_TEST_VERSION := $(shell grep PD_TEST_VERSION $(pd_src)/src/m_pd.h | \
# sed 's|^.define *PD_TEST_VERSION *"\(.*\)".*|\1|' )
#PD_VERSION = $(PD_MAJOR_VERSION).$(PD_MINOR_VERSION).$(PD_BUGFIX_VERSION)
PD_VERSION := $(PD_TEST_VERSION)
#ifneq ($(PD_TEST_VERSION),)
# PD_VERSION := $(PD_VERSION)-$(PD_TEST_VERSION)
#endif
VERSION_DATE := $(shell date +%Y%m%d)
# AG: version number based on the actual git revision and date. We use this
# both for the PD_TEST_VERSION and for the package name and accompanying
# materials (ReadMe files and such). Note that this will only work when
# building directly from a clone of the git repo, and of course you'll need to
# have git installed.
GIT_VERSION := $(shell git log -1 --format=%cd --date=short | sed -e 's/-//g')-rev.$(shell git rev-parse --short HEAD)
# AG: Untangle the hall of mirrors that is PD_TEST_VERSION. m_pd.h won't exist
# or will at least be outdated when the build starts, so we can't simply read
# it from there. Since we always use the package version (git revision and
# date, see GIT_VERSION below), we just set it directly instead.
PD_TEST_VERSION := $(GIT_VERSION)
# AG: This is being used for the package name and accompanying materials. For
# Pd-l2ork the vanilla Pd version numbers are rather meaningless (they are
# mainly kept around so that 3rd party externals and abstractions know what
# iteration of the vanilla API they have available). Instead, we use a version
# number derived from PD_TEST_VERSION.
PD_VERSION := $(PD_TEST_VERSION)
# release version for this distro
#PD-EXTENDED_VERSION_PREFIX = l2ork
#PD-EXTENDED_VERSION = $(PD-EXTENDED_VERSION_PREFIX)-$(VERSION_DATE)
PD-EXTENDED_VERSION = $(VERSION_DATE)
VERSION_DATE := $(shell date +%Y%m%d)
PACKAGE_NAME = Pd-l2ork-$(PD_VERSION)-`uname -m`
......
......@@ -145,7 +145,7 @@ $(PD_INNO_SETUP): $(PD_INNO_SETUP).in
cat "$(PD_INNO_SETUP).in" | \
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/g' | \
sed 's/PD_VERSION/$(PD_VERSION)/g' | \
sed 's/PD-EXTENDED_VERSION/$(PD-EXTENDED_VERSION)/g' > \
sed 's/GIT_VERSION/$(GIT_VERSION)/g' > \
$(PD_INNO_SETUP)
# start $(PD_INNO_SETUP)
......@@ -182,7 +182,7 @@ test_package:
test_locations:
@echo --------------------------------------------------
@echo "PD_VERSION: $(PD_VERSION)"
@echo "PD-EXTENDED_VERSION: $(PD-EXTENDED_VERSION)"
@echo "GIT_VERSION: $(GIT_VERSION)"
@echo "CWD $(CWD)"
@echo "DESTDIR $(DESTDIR)"
@echo "PREFIX $(prefix)"
......
......@@ -13,7 +13,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 7
#define PD_TEST_VERSION "20160525"
#define PD_TEST_VERSION "date/revision goes here"
#define PDL2ORK
extern int pd_compatibilitylevel; /* e.g., 43 for pd 0.43 compatibility */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment