Add note about correct version of `groff'
[geda-gaf.git] / Makefile.am
blob161083cb64ac23555b55192473cfa734e543bc0a
1 if ENABLE_GATTRIB
2 GATTRIB_DIR=gattrib
3 endif
4 SUBDIRS = libgeda libgedacairo gaf gschem ${GATTRIB_DIR} \
5         gsymcheck gnetlist-legacy utils symbols docs examples contrib xorn
7 ACLOCAL_AMFLAGS = -I m4
9 # We need to ensure that `make distcheck' *doesn't* find a git
10 # repository!
12 # We also should be able to successfully build & install without
13 # groff.
14 false=/bin/sh -c '! :'
15 DISTCHECK_CONFIGURE_FLAGS = \
16         GIT="$(false)" \
17         GROFF="$(false)" \
18         --disable-update-xdg-database
20 BUILT_SOURCES = version.h
21 EXTRA_DIST = autogen.sh version.h version.h.in HACKING \
22         COPYING.LGPL
24 # Generate version.h. This works by looking at any git repository that
25 # is present in the source directory (detected at configure time). If
26 # there is a git repository, the HEAD commitid is checked every time
27 # the package is built to see if it has changed. If so, version.h is
28 # regenerated. If there isn't a git repository, version.h is just
29 # assumed to be present (since the generated version.h is distributed
30 # in the source tarball).
31 if HAVE_GIT_REPO
32 version.h: stamp-git $(top_builddir)/configure $(srcdir)/version.h.in
33         @if test ! -f version.h; then \
34           rm -f stamp-git; \
35           $(MAKE) $(AM_MAKEFLAGS) stamp-git; \
36         else :; fi
38         @date_ver=$(DATE_VERSION); dotted_ver=$(DOTTED_VERSION); \
39         git_commit=`cd $(srcdir) && $(GIT) rev-parse HEAD`; \
40         sed -e"s:^.*\(PACKAGE_DATE_VERSION\).*$$:#define \1 \"$$date_ver\":" \
41             -e"s:^.*\(PACKAGE_DOTTED_VERSION\).*$$:#define \1 \"$$dotted_ver\":" \
42             -e"s:^.*\(PACKAGE_GIT_COMMIT\).*$$:#define \1 \"$$git_commit\":" \
43               < $(srcdir)/version.h.in > version.h.new; \
44         if diff version.h version.h.new > /dev/null 2>&1; then \
45           echo "version.h is unchanged"; \
46           rm version.h.new; \
47         else \
48           echo "Recreating version.h"; \
49           mv version.h.new version.h; \
50         fi
51 stamp-git:
52         @last_version=`if test -f stamp-git; then cat stamp-git; else :; fi`; \
53         now_version=`cd $(srcdir) && $(GIT) rev-parse HEAD`; \
54         if test "X$$now_version" != "X$$last_version"; then \
55           echo $$now_version > stamp-git; \
56           echo "Now at git commit $$now_version..."; \
57         fi
58 .PHONY: stamp-git
59 endif HAVE_GIT_REPO
61 doxygen:
62 if ENABLE_DOXYGEN
63         @for subdir in gattrib/docs gschem/docs gnetlist-legacy/docs \
64           libgeda/docs gsymcheck/docs utils/docs ; do \
65           (cd $$subdir; $(MAKE) doxygen) || exit 1; \
66         done
67 else
68         @echo 'configure was not run with the --enable-doxygen switch.'
69         @echo 'The documentation cannot be built from the sources.'
70 endif
72 DISTCLEANFILES = stamp-git
73 MAINTAINERCLEANFILES=Makefile.in aclocal.m4 config.h.in configure