diff --git a/Makefile b/Makefile index 75ee1603140d000db0ca77a9853a26dd67a60bcf..802627d5c5f59d64fd09dbb7c4373613f6bd0d3f 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ # realclean: put the sources into pristine state again (WARNING: this will get # rid of any uncommitted source changes, too); use this as a last resort to # get the sources into a compilable state again after things have gone awry +# NOTE: this target only works in a working copy of the git repo, not in +# static tarball snapshots of the source all: cd l2ork_addons && ./tar_em_up.sh -Tk @@ -48,9 +50,11 @@ clean: cd Gem/ && rm -f gemglutwindow.pd_linux Gem.pd_linux realclean: - git submodule deinit --all -f - git checkout . - git clean -dff # git clean doesn't see these, but we need to get rid of them to prevent # subsequent mysterious build failures rm -rf pd/lib $(addprefix externals/disis/, flext/configure stk/configure) +# The rest require a working copy of the git repo. + test -d .git || (echo "Not a git repository, bailing out." && false) + git submodule deinit --all -f + git checkout . + git clean -dff diff --git a/l2ork_addons/tar_em_up.sh b/l2ork_addons/tar_em_up.sh index 4d13c2c9c695252b4560ba5ec8908b85d00eee67..41754074be96fda6c4fc26b191ffc5f4c1665619 100755 --- a/l2ork_addons/tar_em_up.sh +++ b/l2ork_addons/tar_em_up.sh @@ -292,7 +292,7 @@ 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? - make -C .. git_version + test -f ../../pd/src/s_stuff.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 diff --git a/packages/Makefile b/packages/Makefile index b7b042b0150519884f9303326986ac21d44993b0..69ae8def8bb30f916315f54ade473e2d8e8fd80d 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -373,13 +373,15 @@ 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 created -# from the latter by substituting PD_BUILD_VERSION. +# s_stuff.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. git_version: $(pd_src)/src/s_stuff.h.in - @cd $(pd_src)/src/ && \ + @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 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 set_version: # change Pd's version number to reflect the extended build @@ -422,7 +424,9 @@ distclean: cruft_clean $(MAKE) -C $(abstractions_src) distclean -$(MAKE) -C $(extensions_src) distclean $(MAKE) -C $(externals_src) distclean - -$(MAKE) -C $(pd_src) distclean +# Make sure that we don't remove the precious s_stuff.h file if we're building +# outside of the repo. + -test -d $(cvs_root_dir)/.git && $(MAKE) -C $(pd_src) distclean || $(MAKE) -C $(pd_src) clean test_locations: @echo "PD_VERSION: $(PD_VERSION)"