Skip to content

Commit

Permalink
Avoid use of $(wildcard) in version.c dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Nov 7, 2011
1 parent 891c1e5 commit edab3ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile.am
Expand Up @@ -32,8 +32,7 @@ EXTRA_DIST = version.sh openconnect.html openconnect.8 COPYING.LGPL
DISTCLEANFILES = $(pkgconfig_DATA)

version.c: $(library_srcs) $(openconnect_SOURCES) Makefile.am configure.ac \
openconnect.h openconnect-internal.h version.sh \
$(wildcard .git/index .git/refs/tags)
openconnect.h openconnect-internal.h version.sh @GITVERSIONDEPS@
@$(srcdir)/version.sh

tmp-dist: uncommitted-check
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Expand Up @@ -168,5 +168,17 @@ RAWLINGUAS=`sed -e "/^#/d" -e "s/#.*//" "${srcdir}/po/LINGUAS"`
LINGUAS=`echo $RAWLINGUAS`
AC_SUBST(LINGUAS)

# We want version.c to depend on the files that would affect the
# output of version.sh. But we cannot assume that they'll exist,
# and we cannot use $(wildcard) in a non-GNU makefile. So we just
# depend on the files which happen to exist at configure time.
GITVERSIONDEPS=
for a in .git/index .git/packed-refs .git/refs/tags .git/HEAD; do
if test -r $a ; then
GITVERSIONDEPS="$GITVERSIONDEPS $a"
fi
done
AC_SUBST(GITVERSIONDEPS)

AC_OUTPUT(Makefile openconnect.pc po/Makefile www/Makefile \
www/styles/Makefile www/inc/Makefile www/images/Makefile)

0 comments on commit edab3ed

Please sign in to comment.