Commit 8815ef06 authored by nerrons's avatar nerrons

Move PD_BUILD_VERSION from s_stuff.h.in to s_version.h.in

parent 5078a87f
Pipeline #1504 canceled with stage
......@@ -216,9 +216,9 @@ $(debsrc):
git archive --format=tar.gz --prefix=$(debdist)/ HEAD | tar xfz -
# Grab the submodules.
for x in $(submodules); do (cd $(debdist) && rm -rf $$x && git -C ../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done
# Pre-generate and put s_stuff.h into the tarball (see above; the build
# Pre-generate and put s_version.h into the tarball (see above; the build
# version is generated using git which can't be done outside the git repo).
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' pd/src/s_stuff.h.in > $(debdist)/pd/src/s_stuff.h
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' pd/src/s_version.h.in > $(debdist)/pd/src/s_version.h
# Create the source tarball.
tar cfz $(debsrc) $(debdist)
rm -rf $(debdist)
......@@ -103,9 +103,9 @@ $(debsrc):
git -C .. archive --format=tar.gz --prefix=$(debdist)/ HEAD | tar xfz -
# Grab the submodules.
for x in $(submodules); do (cd $(debdist) && rm -rf $$x && git -C ../../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done
# Pre-generate and put s_stuff.h into the tarball (see above; the build
# Pre-generate and put s_version.h into the tarball (see above; the build
# version is generated using git which can't be done outside the git repo).
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' ../pd/src/s_stuff.h.in > $(debdist)/pd/src/s_stuff.h
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' ../pd/src/s_version.h.in > $(debdist)/pd/src/s_version.h
# Create the source tarball.
tar cfz $(debsrc) $(debdist)
rm -rf $(debdist)
......
......@@ -297,12 +297,13 @@ then
# s_stuff.h when we copy it below. XXXNOTE AG: The build seems
# to work just fine even when skipping all this, so why again
# is this needed?
test -f ../../pd/src/s_stuff.h || make -C .. git_version
test -f ../../pd/src/s_version.h || make -C .. git_version
cp ../../pd/src/g_all_guis.h ../../externals/build/include
cp ../../pd/src/g_canvas.h ../../externals/build/include
cp ../../pd/src/m_imp.h ../../externals/build/include
cp ../../pd/src/m_pd.h ../../externals/build/include
cp ../../pd/src/s_stuff.h ../../externals/build/include
cp ../../pd/src/s_version.h ../../externals/build/include
cp ../../pd/src/g_all_guis.h ../../externals/build/include
rm -rf build/
fi
......
......@@ -374,16 +374,16 @@ doc_format:
# 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, we create s_stuff.h from
# s_stuff.h.in, where the latter is kept in the repo and the former gets
# be kept in a source code repository. Instead, we create s_version.h from
# s_version.h.in, where the latter is kept in the repo and the former gets
# created from the latter by substituting PD_BUILD_VERSION. NOTE: This may
# fail if we're building in a static tarball snapshop of the repo, in which
# case we assume that a pre-generated s_stuff.h is supplied.
# case we assume that a pre-generated s_version.h is supplied.
git_version: $(pd_src)/src/s_stuff.h.in
git_version: $(pd_src)/src/s_version.h.in
@test -d $(cvs_root_dir)/.git && cd $(pd_src)/src/ && \
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h.new && \
(test -f s_stuff.h && diff -q s_stuff.h s_stuff.h.new > /dev/null && rm -f s_stuff.h.new && echo s_stuff.h unchanged || (rm -f s_stuff.h && mv s_stuff.h.new s_stuff.h)) || test -f $(pd_src)/src/s_stuff.h
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_version.h.in > s_version.h.new && \
(test -f s_version.h && diff -q s_version.h s_version.h.new > /dev/null && rm -f s_version.h.new && echo s_version.h unchanged || (rm -f s_version.h && mv s_version.h.new s_version.h)) || test -f $(pd_src)/src/s_version.h
set_version:
# change Pd's version number to reflect the extended build
......
......@@ -46,10 +46,10 @@ endif
@echo " "
@echo "win32_inno install succeeded!"
git_version: $(pd_src)/src/s_stuff.h.in
git_version: $(pd_src)/src/s_version.h.in
@cd $(pd_src)/src/ && \
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h.new && \
(test -f s_stuff.h && diff -q s_stuff.h s_stuff.h.new > /dev/null && rm -f s_stuff.h.new && echo s_stuff.h unchanged || (rm -f s_stuff.h && mv s_stuff.h.new s_stuff.h))
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_version.h.in > s_version.h.new && \
(test -f s_version.h && diff -q s_version.h s_version.h.new > /dev/null && rm -f s_version.h.new && echo s_version.h unchanged || (rm -f s_version.h && mv s_version.h.new s_version.h))
build_pd: git_version
cd $(pd_src)/src && $(MAKE) -f makefile.mingw
......
......@@ -10,6 +10,7 @@
#include "m_pd.h"
#include "s_stuff.h"
#include "s_version.h"
#include "g_canvas.h"
#include <stdio.h>
......
......@@ -203,6 +203,7 @@ install: all
install -m644 m_imp.h $(DESTDIR)$(includedir)/pd-l2ork/m_imp.h
install -m644 g_canvas.h $(DESTDIR)$(includedir)/pd-l2ork/g_canvas.h
install -m644 s_stuff.h $(DESTDIR)$(includedir)/pd-l2ork/s_stuff.h
install -m644 s_version.h $(DESTDIR)$(includedir)/pd-l2ork/s_version.h
install -m644 g_all_guis.h $(DESTDIR)$(includedir)/pd-l2ork/g_all_guis.h
install -d $(DESTDIR)$(mandir)/man1
gzip < ../man/pd.1 > $(DESTDIR)$(mandir)/man1/@PDEXEC@.1.gz
......@@ -230,7 +231,7 @@ extra-clean:
clean: extra-clean local-clean
distclean: clean
-rm -f s_stuff.h config.cache config.log config.status makefile tags \
-rm -f s_version.h config.cache config.log config.status makefile tags \
autom4te.cache/output.* autom4te.cache/traces.* autom4te.cache/requests
-rm -rf autom4te*.cache
......@@ -238,10 +239,10 @@ tags: $(SRC); ctags *.[ch]
depend: makefile.dependencies
makefile.dependencies: makefile s_stuff.h
makefile.dependencies: makefile s_version.h
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
s_stuff.h: s_stuff.h.in
s_version.h: s_version.h.in
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' $< > $@
uninstall:
......
......@@ -106,7 +106,7 @@ PMOBJ = $(PMSRC:.c=.o)
GSRC =
HEADERS = g_all_guis.h m_imp.h g_canvas.h g_magicglass.h m_pd.h s_stuff.h \
HEADERS = g_all_guis.h m_imp.h g_canvas.h g_magicglass.h m_pd.h s_stuff.h s_version.h \
g_undo.h x_preset.h s_utf8.h \
$(wildcard ../portaudio/common/*.h) s_audio_paring.h
......@@ -165,7 +165,7 @@ all: config.h $(PDDLL) $(PDEXEC) pdsend.exe pdreceive.exe pd.com externs
config.h: config.h.in
cp config.h.in config.h
s_stuff.h: s_stuff.h.in
s_version.h: s_version.h.in
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' $< > $@
$(OBJ) : %.o : %.c
......@@ -280,6 +280,7 @@ install: all
install -p m_imp.h $(DESTDIR)$(includedir)/pdl2ork/m_imp.h
install -p g_canvas.h $(DESTDIR)$(includedir)/pdl2ork/g_canvas.h
install -p s_stuff.h $(DESTDIR)$(includedir)/pdl2ork/s_stuff.h
install -p s_version.h $(DESTDIR)$(includedir)/pdl2ork/s_version.h
install -p g_all_guis.h $(DESTDIR)$(includedir)/pdl2ork/g_all_guis.h
# since Pd-vanilla on Mac OS X doesn't have an 'include/pd' folder,
# Pd-extended will mimic Pd-vanilla's include/pd until Pd-vanilla gets one
......@@ -300,6 +301,7 @@ install: all
install -d $(DESTDIR)$(includedir)
install -p m_pd.h $(DESTDIR)$(includedir)/m_pd.h
install -p s_stuff.h $(DESTDIR)$(includedir)/s_stuff.h
install -p s_version.h $(DESTDIR)$(includedir)/s_version.h
@echo "Pd install succeeded."
......@@ -312,7 +314,7 @@ clean:
-rm -f makefile.dependencies
distclean: clean
rm -rf -- s_stuff.h config.cache config.log config.status makefile tags \
rm -rf -- s_version.h config.cache config.log config.status makefile tags \
autom4te-*.cache
tags: $(SRC) $(GSRC); ctags *.[ch]
......
......@@ -5,6 +5,7 @@
#include "m_pd.h"
#include "m_imp.h"
#include "s_stuff.h"
#include "s_version.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
......
This diff is collapsed.
#ifndef __s_version_h_
#define __s_version_h_
// AG: Generated build version number. Pd-l2ork uses this in lieu of vanilla's
// PD_TEST_VERSION. We wouldn't want to touch m_pd.h for this, so it's part of
// the internal API. Also note that this value gets substituted automatically
// at build time, so any manual edits will be lost.
#define PD_BUILD_VERSION "<build version>"
#endif
\ No newline at end of file
......@@ -8,6 +8,7 @@
#include "m_imp.h"
#include "g_canvas.h"
#include "s_stuff.h"
#include "s_version.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
......
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