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