37fc6cb07454f582b033ffc15f337bcf064f37bd
[openocd.git] / Makefile.am
1 # not a GNU package. You can remove this line, if
2 # have all needed files, that a GNU package needs
3 AUTOMAKE_OPTIONS = gnu 1.6
4
5 # make sure we pass the correct jimtcl flags to distcheck
6 DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
7
8 nobase_dist_pkgdata_DATA = \
9         contrib/libdcc/dcc_stdio.c \
10         contrib/libdcc/dcc_stdio.h \
11         contrib/libdcc/example.c \
12         contrib/libdcc/README \
13         contrib/99-openocd.rules
14
15 if INTERNAL_JIMTCL
16 SUBDIRS = jimtcl
17 else
18 SUBDIRS =
19 endif
20
21 SUBDIRS += src doc
22
23 EXTRA_DIST = \
24         BUGS \
25         HACKING \
26         NEWTAPS \
27         README.Windows \
28         README.OSX \
29         $(wildcard $(srcdir)/NEWS*) \
30         Doxyfile.in \
31         tools/logger.pl \
32         contrib/loaders
33
34 libtool: $(LIBTOOL_DEPS)
35         $(SHELL) ./config.status --recheck
36
37 docs: pdf html doxygen
38
39 Doxyfile: $(srcdir)/Doxyfile.in
40         @echo "Creating $@ from $<..."
41         @( \
42           echo "### @@@ -= DO NOT EDIT THIS FILE =- @@@ ###" && \
43           echo "### @@@ Make changes to Doxyfile.in @@@ ###" && \
44           sed -e 's,@srcdir\@,$(srcdir),' \
45             -e 's,@builddir\@,$(builddir),' \
46             -e 's,@doxygen_as_html\@,$(doxygen_as_html),' \
47             -e 's,@doxygen_as_pdf\@,$(doxygen_as_pdf),' $< \
48         ) > $@
49
50 THE_MANUAL = doxygen/latex/refman.pdf
51
52 doxygen::
53         $(MAKE) Doxyfile
54         doxygen Doxyfile 2>&1 | perl $(srcdir)/tools/logger.pl > doxygen.log
55         @if [ -f doxygen/latex/refman.tex ]; then \
56                 echo "Creating $(THE_MANUAL)..."; \
57                 $(MAKE) $(THE_MANUAL); \
58         else \
59                 echo "Skipping Doxygen PDF..."; \
60         fi
61
62 $(THE_MANUAL): %.pdf: %.tex
63         -cd $$(dirname $*) && pdflatex $$(basename $*)
64         -cd $$(dirname $*) && pdflatex $$(basename $*)
65
66 TCL_PATH = tcl
67 # command to find paths of script files, relative to TCL_PATH
68 TCL_FILES = find $(srcdir)/$(TCL_PATH) -name '*.cfg' -o -name '*.tcl' -o -name '*.txt' | \
69                 sed -e 's,^$(srcdir)/$(TCL_PATH),,'
70
71 dist-hook:
72         if test -d $(srcdir)/.git -a \( ! -e $(distdir)/ChangeLog -o -w $(distdir)/ChangeLog \) ; then \
73                 git --git-dir $(srcdir)/.git log | $(srcdir)/tools/git2cl/git2cl > $(distdir)/ChangeLog ; \
74         fi
75         for i in $$($(TCL_FILES)); do \
76                 j="$(distdir)/$(TCL_PATH)/$$i" && \
77                 mkdir -p "$$(dirname $$j)" && \
78                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
79         done
80
81 install-data-hook:
82         for i in $$($(TCL_FILES)); do \
83                 j="$(DESTDIR)$(pkgdatadir)/scripts/$$i" && \
84                 mkdir -p "$$(dirname $$j)" && \
85                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
86         done
87
88 uninstall-hook:
89         rm -rf $(DESTDIR)$(pkgdatadir)/scripts
90
91 distclean-local:
92         rm -rf Doxyfile doxygen
93         rm -f $(srcdir)/jimtcl/configure.gnu
94
95 DISTCLEANFILES = doxygen.log
96
97 MAINTAINERCLEANFILES = \
98         $(srcdir)/INSTALL \
99         $(srcdir)/configure \
100         $(srcdir)/Makefile.in \
101         $(srcdir)/depcomp \
102         $(srcdir)/config.guess \
103         $(srcdir)/config.sub \
104         $(srcdir)/config.h.in \
105         $(srcdir)/config.h.in~ \
106         $(srcdir)/compile \
107         $(srcdir)/ltmain.sh \
108         $(srcdir)/missing \
109         $(srcdir)/aclocal.m4 \
110         $(srcdir)/install-sh