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