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