+# ignore .patch from rsync, and any generated patch files from git-am
*.patch
+# ignore local .config files
.config
-
+# ignore generated .patchnum file
+.patchnum
# files produced by './configure.gnu' on a Linux machine
sperl.i: perl.c $(h)
$(CCCMDSRC) -DIAMSUID -E perl.c > sperl.i
-.PHONY: all translators utilities
+.PHONY: all translators utilities make_patchnum
+
+make_patchnum:
+ sh $(shellflags) make_patchnum.sh
+
+perl$(OBJ_EXT): make_patchnum .patchnum
translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE
@echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
;;
esac
-if test -d .git; then
- ccflags="-DPERL_PATCHNUM=`git describe` $ccflags"
-else
- if test -f .patch; then
- ccflags="-DPERL_PATCHNUM=`awk '{print $4}' .patch` $ccflags"
- fi
+if [ -f .patchnum -a -n "$(cat .patchnum)"]; then
+ ccflags="-DPERL_PATCHNUM=`cat .patchnum`"
fi
: Can we perhaps use $ansi2knr here
--- /dev/null
+#!/bin/sh
+
+Existing=`cat .patchnum 2>/dev/null`
+Current=`git describe`
+
+if [ "$Existing" != "$Current" ]; then
+ echo "Updating .patchnum"
+ echo $Current > .patchnum
+else
+ echo "Reusing .patchnum"
+fi