target/adi_v5_swd: remove double space from swd_cmd() parameters
[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/license-rules.txt \
54         LICENSES/preferred/BSD-1-Clause \
55         LICENSES/preferred/BSD-2-Clause \
56         LICENSES/preferred/BSD-3-Clause \
57         LICENSES/preferred/GFDL-1.2 \
58         LICENSES/preferred/gfdl-1.2.texi.readme \
59         LICENSES/preferred/GPL-2.0 \
60         LICENSES/stand-alone/GPL-3.0 \
61         tools/logger.pl \
62         tools/rlink_make_speed_table \
63         tools/st7_dtc_as \
64         contrib
65
66 libtool: $(LIBTOOL_DEPS)
67         $(SHELL) ./config.status --recheck
68
69 docs: pdf html doxygen
70
71 Doxyfile: $(srcdir)/Doxyfile.in
72         @echo "Creating $@ from $<..."
73         @( \
74           echo "### @@@ -= DO NOT EDIT THIS FILE =- @@@ ###" && \
75           echo "### @@@ Make changes to Doxyfile.in @@@ ###" && \
76           sed -e 's,@srcdir\@,$(srcdir),' \
77             -e 's,@builddir\@,$(builddir),' \
78             -e 's,@doxygen_as_html\@,$(doxygen_as_html),' \
79             -e 's,@doxygen_as_pdf\@,$(doxygen_as_pdf),' $< \
80         ) > $@
81
82 THE_MANUAL = doxygen/latex/refman.pdf
83
84 doxygen::
85         $(MAKE) Doxyfile
86         doxygen Doxyfile 2>&1 | perl $(srcdir)/tools/logger.pl > doxygen.log
87         @if [ -f doxygen/latex/refman.tex ]; then \
88                 echo "Creating $(THE_MANUAL)..."; \
89                 $(MAKE) $(THE_MANUAL); \
90         else \
91                 echo "Skipping Doxygen PDF..."; \
92         fi
93
94 $(THE_MANUAL): %.pdf: %.tex
95         -cd $$(dirname $*) && pdflatex $$(basename $*)
96         -cd $$(dirname $*) && pdflatex $$(basename $*)
97
98 TCL_PATH = tcl
99 # command to find paths of script files, relative to TCL_PATH
100 TCL_FILES = find $(srcdir)/$(TCL_PATH) -name '*.cfg' -o -name '*.tcl' -o -name '*.txt' | \
101                 sed -e 's,^$(srcdir)/$(TCL_PATH),,'
102
103 dist-hook:
104         if test -d $(srcdir)/.git -a \( ! -e $(distdir)/ChangeLog -o -w $(distdir)/ChangeLog \) ; then \
105                 git --git-dir $(srcdir)/.git log | $(srcdir)/tools/git2cl/git2cl > $(distdir)/ChangeLog ; \
106         fi
107         for i in $$($(TCL_FILES)); do \
108                 j="$(distdir)/$(TCL_PATH)/$$i" && \
109                 mkdir -p "$$(dirname $$j)" && \
110                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
111         done
112
113 install-data-hook:
114         for i in $$($(TCL_FILES)); do \
115                 j="$(DESTDIR)$(pkgdatadir)/scripts/$$i" && \
116                 mkdir -p "$$(dirname $$j)" && \
117                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
118         done
119
120 uninstall-hook:
121         rm -rf $(DESTDIR)$(pkgdatadir)/scripts
122
123 distclean-local:
124         rm -rf Doxyfile doxygen
125         rm -f $(srcdir)/jimtcl/configure.gnu
126 # FIXME: workaround for jimtcl 0.80 only. Remove from jimtcl 0.81
127         rm -f jimtcl/examples.api/Makefile
128
129 DISTCLEANFILES = doxygen.log
130
131 METASOURCES = AUTO
132
133 BUILT_SOURCES =
134 CLEANFILES =
135
136 MAINTAINERCLEANFILES = \
137         %D%/INSTALL \
138         %D%/configure \
139         %D%/Makefile.in \
140         %D%/depcomp \
141         %D%/config.guess \
142         %D%/config.sub \
143         %D%/config.h.in \
144         %D%/config.h.in~ \
145         %D%/compile \
146         %D%/ltmain.sh \
147         %D%/missing \
148         %D%/aclocal.m4 \
149         %D%/install-sh \
150         %D%/texinfo.tex
151
152 include src/Makefile.am
153 include doc/Makefile.am