LICENSES: add the GFDL-1.2 license
[fw/openocd] / 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 # do not run Jim Tcl tests (esp. during distcheck)
9 check-recursive: SUBDIRS :=
10
11 nobase_dist_pkgdata_DATA = \
12         contrib/libdcc/dcc_stdio.c \
13         contrib/libdcc/dcc_stdio.h \
14         contrib/libdcc/example.c \
15         contrib/libdcc/README \
16         contrib/60-openocd.rules
17
18 SUBDIRS =
19 DIST_SUBDIRS =
20 bin_PROGRAMS =
21 noinst_LTLIBRARIES =
22 info_TEXINFOS =
23 dist_man_MANS =
24 EXTRA_DIST =
25
26 if INTERNAL_JIMTCL
27 SUBDIRS += jimtcl
28 DIST_SUBDIRS += jimtcl
29 endif
30
31 # common flags used in openocd build
32 AM_CFLAGS = $(GCC_WARNINGS)
33
34 AM_CPPFLAGS = $(HOST_CPPFLAGS)\
35                           -I$(top_srcdir)/src \
36                           -I$(top_builddir)/src \
37                           -I$(top_srcdir)/src/helper \
38                           -DPKGDATADIR=\"$(pkgdatadir)\" \
39                           -DBINDIR=\"$(bindir)\"
40
41 if INTERNAL_JIMTCL
42 AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
43                            -I$(top_builddir)/jimtcl
44 endif
45 EXTRA_DIST += \
46         BUGS \
47         HACKING \
48         NEWTAPS \
49         README.Windows \
50         README.macOS \
51         $(EXTRA_DIST_NEWS) \
52         Doxyfile.in \
53         LICENSES/preferred/GFDL-1.2 \
54         LICENSES/preferred/gfdl-1.2.texi.readme \
55         LICENSES/preferred/GPL-2.0 \
56         LICENSES/stand-alone/GPL-3.0 \
57         tools/logger.pl \
58         tools/rlink_make_speed_table \
59         tools/st7_dtc_as \
60         contrib
61
62 libtool: $(LIBTOOL_DEPS)
63         $(SHELL) ./config.status --recheck
64
65 docs: pdf html doxygen
66
67 Doxyfile: $(srcdir)/Doxyfile.in
68         @echo "Creating $@ from $<..."
69         @( \
70           echo "### @@@ -= DO NOT EDIT THIS FILE =- @@@ ###" && \
71           echo "### @@@ Make changes to Doxyfile.in @@@ ###" && \
72           sed -e 's,@srcdir\@,$(srcdir),' \
73             -e 's,@builddir\@,$(builddir),' \
74             -e 's,@doxygen_as_html\@,$(doxygen_as_html),' \
75             -e 's,@doxygen_as_pdf\@,$(doxygen_as_pdf),' $< \
76         ) > $@
77
78 THE_MANUAL = doxygen/latex/refman.pdf
79
80 doxygen::
81         $(MAKE) Doxyfile
82         doxygen Doxyfile 2>&1 | perl $(srcdir)/tools/logger.pl > doxygen.log
83         @if [ -f doxygen/latex/refman.tex ]; then \
84                 echo "Creating $(THE_MANUAL)..."; \
85                 $(MAKE) $(THE_MANUAL); \
86         else \
87                 echo "Skipping Doxygen PDF..."; \
88         fi
89
90 $(THE_MANUAL): %.pdf: %.tex
91         -cd $$(dirname $*) && pdflatex $$(basename $*)
92         -cd $$(dirname $*) && pdflatex $$(basename $*)
93
94 TCL_PATH = tcl
95 # command to find paths of script files, relative to TCL_PATH
96 TCL_FILES = find $(srcdir)/$(TCL_PATH) -name '*.cfg' -o -name '*.tcl' -o -name '*.txt' | \
97                 sed -e 's,^$(srcdir)/$(TCL_PATH),,'
98
99 dist-hook:
100         if test -d $(srcdir)/.git -a \( ! -e $(distdir)/ChangeLog -o -w $(distdir)/ChangeLog \) ; then \
101                 git --git-dir $(srcdir)/.git log | $(srcdir)/tools/git2cl/git2cl > $(distdir)/ChangeLog ; \
102         fi
103         for i in $$($(TCL_FILES)); do \
104                 j="$(distdir)/$(TCL_PATH)/$$i" && \
105                 mkdir -p "$$(dirname $$j)" && \
106                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
107         done
108
109 install-data-hook:
110         for i in $$($(TCL_FILES)); do \
111                 j="$(DESTDIR)$(pkgdatadir)/scripts/$$i" && \
112                 mkdir -p "$$(dirname $$j)" && \
113                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
114         done
115
116 uninstall-hook:
117         rm -rf $(DESTDIR)$(pkgdatadir)/scripts
118
119 distclean-local:
120         rm -rf Doxyfile doxygen
121         rm -f $(srcdir)/jimtcl/configure.gnu
122 # FIXME: workaround for jimtcl 0.80 only. Remove from jimtcl 0.81
123         rm -f jimtcl/examples.api/Makefile
124
125 DISTCLEANFILES = doxygen.log
126
127 METASOURCES = AUTO
128
129 BUILT_SOURCES =
130 CLEANFILES =
131
132 MAINTAINERCLEANFILES = \
133         %D%/INSTALL \
134         %D%/configure \
135         %D%/Makefile.in \
136         %D%/depcomp \
137         %D%/config.guess \
138         %D%/config.sub \
139         %D%/config.h.in \
140         %D%/config.h.in~ \
141         %D%/compile \
142         %D%/ltmain.sh \
143         %D%/missing \
144         %D%/aclocal.m4 \
145         %D%/install-sh \
146         %D%/texinfo.tex
147
148 include src/Makefile.am
149 include doc/Makefile.am