Move TCL script files -- Step 2 of 2:
[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 = foreign 1.6
4
5 nobase_dist_pkgdata_DATA = \
6         contrib/libdcc/dcc_stdio.c \
7         contrib/libdcc/dcc_stdio.h \
8         contrib/libdcc/example.c \
9         contrib/libdcc/README \
10         contrib/openocd.udev
11
12 SUBDIRS = src doc
13
14 EXTRA_DIST = \
15         Doxyfile.in \
16         tools/logger.pl
17
18 docs: pdf html doxygen
19
20 Doxyfile: $(srcdir)/Doxyfile.in
21         @echo "Creating $@ from $<..."
22         @( \
23           echo "### @@@ -= DO NOT EDIT THIS FILE =- @@@ ###" && \
24           echo "### @@@ Make changes to Doxyfile.in @@@ ###" && \
25           sed -e 's,@srcdir\@,$(srcdir),' $< \
26         ) > $@
27
28 doxygen::
29         $(MAKE) Doxyfile
30         doxygen Doxyfile 2>&1 | perl $(srcdir)/tools/logger.pl > doxygen.log
31
32 TCL_PATH = tcl
33 # command to find paths of script files, relative to TCL_PATH
34 TCL_FILES := find $(srcdir)/$(TCL_PATH) -name '*.cfg' -o -name '*.tcl' | \
35                 sed -e 's,^$(srcdir)/$(TCL_PATH),,'
36
37 dist-hook:
38         for i in $$($(TCL_FILES)); do \
39                 j="$(distdir)/$(TCL_PATH)/$$i" && \
40                 mkdir -p "$$(dirname $$j)" && \
41                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
42         done
43
44 install-data-hook:
45         for i in $$($(TCL_FILES)); do \
46                 j="$(DESTDIR)$(pkgdatadir)/scripts/$$i" && \
47                 mkdir -p "$$(dirname $$j)" && \
48                 $(INSTALL_DATA) $(srcdir)/$(TCL_PATH)/$$i $$j; \
49         done
50
51 uninstall-hook:
52         rm -rf $(DESTDIR)$(pkgdatadir)/scripts
53
54
55 distclean-local:
56         rm -rf Doxyfile doxygen
57
58 DISTCLEANFILES = doxygen.log
59
60 MAINTAINERCLEANFILES = \
61         configure \
62         Makefile.in \
63         depcomp \
64         config.guess \
65         config.sub \
66         config.h.in \
67         config.h.in~ \
68         compile \
69         ltmain.sh \
70         missing \
71         aclocal.m4 \
72         install-sh