Fix generation of version_git.h for some versions of BSD make.
[tinc] / src / Makefile.am
index 96431a3..f54b476 100644 (file)
@@ -2,6 +2,8 @@
 
 sbin_PROGRAMS = tincd tinc sptps_test sptps_keypair
 
+CLEANFILES = version_git.h
+
 .PHONY: version-stamp
 version-stamp:
 
@@ -10,6 +12,11 @@ version_git.h: version-stamp
        @-(cd $(srcdir) && git describe 2>/dev/null >/dev/null) && echo '#define GIT_DESCRIPTION "'`(cd $(srcdir) && git describe) | sed 's/release-//'`'"' >$@ ||:
 ${srcdir}/version.c: version_git.h
 
+## Now a hack to appease some versions of BSD make that don't understand that "./foo" is the same as "foo".
+if BSD
+version.c: ${srcdir}/version.c
+endif
+
 if LINUX
 sbin_PROGRAMS += sptps_speed
 endif