1 ## Process this file with Automake to produce Makefile.in
3 dist_bin_SCRIPTS = bin/stow bin/chkstow
4 info_TEXINFOS = doc/stow.texi
5 dist_man_MANS = doc/stow.8
8 doc/manual.html doc/manual.pdf \
9 ChangeLog doc/ChangeLog.OLD
11 # Would be nice to include the split page HTML version of the manual
12 # in the distribution, but automake doesn't support wildcards and I'm
13 # loathe to explicitly list every single page here :-(
14 #nobase_dist_doc_DATA = doc/stow.html/*.html
16 pmdir = $(libdir)/perl5
17 dist_pm_DATA = lib/Stow.pm
18 pmstowdir = $(pmdir)/Stow
19 dist_pmstow_DATA = lib/Stow/Util.pm
21 TEXINFO_TEX = doc/texinfo.tex
22 export TEXI2DVI_BUILD_MODE = clean
23 AM_MAKEINFOFLAGS = -I $(srcdir)
25 # We require this -I parameter to ensure that the include of the
26 # default ignore list in the manual works. Unfortunately this is
27 # the only way to do it:
29 # http://article.gmane.org/gmane.comp.sysutils.automake.bugs/4334/match=passing+parameters
31 # even though it annoyingly produces a warning with the -Wall option
32 # to AM_INIT_AUTOMAKE which has to be silenced via -Wno-override.
33 TEXI2DVI = texi2dvi $(AM_MAKEINFOFLAGS)
35 DEFAULT_IGNORE_LIST = $(srcdir)/default-ignore-list
37 TESTS_DIR = $(srcdir)/t
38 TESTS_OUT = tmp-testing-trees
39 TESTS_ENVIRONMENT = $(PERL) -I$(srcdir)/bin -I$(srcdir)/lib -I$(TESTS_DIR)
41 # This is a kind of hack; TESTS needs to be set to ensure that the
42 # `check-am' target makes check-TESTS, but we override check-TESTS
43 # so it doesn't really matter what it's set to, as long as it already
44 # exists (otherwise automake will try to build it).
47 # GNU autotools standardised on the 'check' target, but CPAN (and the
48 # rest of the world) standardised on the 'test' target.
51 # required in vpath mode to ensure $build/t/ exists
52 check_DATA = $(TESTS_OUT)
54 # Test::Harness produces cleaner output than automake's default test
55 # harness, albeit without the pretty colours provided by the
56 # `color-tests' AM_INIT_AUTOMAKE option. This also dodges having to
57 # set TESTS to the full list of tests, which is good because automake
58 # doesn't support wildcards, and so it would be too easy to forget to
59 # add a new one to the list.
61 # Note that automake's `check' rule cannot be overridden
62 # for some weird reason:
64 # http://thread.gmane.org/gmane.comp.sysutils.automake.general/13040/focus=13041
66 # so we override check-TESTS instead which is where the real work is
67 # done anyway. Unfortunately this produces a warning with the -Wall
68 # option to AM_INIT_AUTOMAKE which has to be silenced via
72 $(TESTS_ENVIRONMENT) -MTest::Harness -e 'runtests(@ARGV)' "$${dir#./}"/*.t
77 CPAN_FILES = MANIFEST MANIFEST.SKIP Build.PL META.yml META.json
79 bin/stow.in bin/chkstow.in lib/Stow.pm.in \
80 $(TESTS) t/testutil.pm \
82 $(DEFAULT_IGNORE_LIST) \
84 CLEANFILES = $(bin_SCRIPTS) $(dist_pm_DATA)
86 # clean up auto-generated files
88 -rm -rf $(TESTS_OUT) \
89 bin/stow bin/chkstow doc/stow.8 ChangeLog \
92 # this is more explicit and reliable than the config file trick
93 edit = sed -e 's|[@]PERL[@]|$(PERL)|g' \
94 -e 's|[@]VERSION[@]|$(VERSION)|g'
96 bin/stow: bin/stow.in Makefile
97 [ -d bin ] || mkdir bin # required in vpath mode
101 bin/chkstow: bin/chkstow.in Makefile
102 [ -d bin ] || mkdir bin # required in vpath mode
106 lib/Stow.pm: lib/Stow.pm.in Makefile $(DEFAULT_IGNORE_LIST)
107 [ -d lib ] || mkdir lib # required in vpath mode
108 ( $(edit) < $<; cat $(DEFAULT_IGNORE_LIST) ) > $@
110 ##############################################################################
111 # The below rules are only used by the developer.
112 ##############################################################################
114 # It's conventional to generate $project.info, but it's also nicer to
115 # generate manual.html and manual.pdf (which ultimately go somewhere
116 # like /usr/share/doc/stow/) rather than stow.html and stow.pdf, to
117 # make it obvious that these files contain the manual. So we have to
118 # jump through a few extra hoops. We preserve timestamps to avoid any
119 # unnecessary rebuilds, since not everyone has texinfo installed.
120 doc/manual.texi: doc/stow.texi doc/version.texi
121 [ -d doc ] || mkdir doc # required in vpath mode
122 cp --preserve=timestamps $< $@
124 doc/manual.pdf: doc/stow.pdf doc/version.texi
125 [ -d doc ] || mkdir doc # required in vpath mode
126 cp --preserve=timestamps $< $@
128 # It's easier to calculate the absolute path to $(srcdir) rather than
129 # the relative path to it from the doc/ build subdirectory.
130 doc/manual.html: doc/manual.texi
132 srcdir=$$( cd $(srcdir); pwd ); \
133 cd doc && texi2html -I $$srcdir -expandinfo -menu -monolithic -verbose manual.texi
135 doc/stow.8: bin/stow Makefile
136 [ -d doc ] || mkdir doc # required in vpath mode
140 ChangeLog: doc/ChangeLog.OLD Makefile
141 @if [ -d .git ]; then \
144 --format="format:%ad %aN <%aE>%n%n * %w(70,0,4)%s%+b%n" \
147 | sed 's/^\([A-Z]\)\t/ \1 /'; \
151 echo "Not in a git repository; can't update ChangeLog."; \