1 ## Copyright (C) 1995-2013 Free Software Foundation, Inc.
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2, or (at your option)
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ## ----------------------------------- ##
17 ## The automake and aclocal scripts. ##
18 ## ----------------------------------- ##
20 bin_SCRIPTS = %D%/automake %D%/aclocal
21 CLEANFILES += $(bin_SCRIPTS)
23 # Used by maintainer checks and such.
24 automake_in = $(srcdir)/%D%/automake.in
25 aclocal_in = $(srcdir)/%D%/aclocal.in
26 automake_script = %D%/automake
27 aclocal_script = %D%/aclocal
29 AUTOMAKESOURCES = $(automake_in) $(aclocal_in)
30 TAGS_FILES += $(AUTOMAKESOURCES)
31 EXTRA_DIST += $(AUTOMAKESOURCES)
33 # Make versioned links. We only run the transform on the root name;
34 # then we make a versioned link with the transformed base name. This
35 # seemed like the most reasonable approach.
38 @for p in $(bin_SCRIPTS); do \
39 f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
40 fv="$$f-$(APIVERSION)"; \
41 rm -f "$(DESTDIR)$(bindir)/$$fv"; \
42 echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
43 $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
47 @for p in $(bin_SCRIPTS); do \
48 f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
49 fv="$$f-$(APIVERSION)"; \
50 rm -f "$(DESTDIR)$(bindir)/$$fv"; \
53 # These files depend on Makefile so they are rebuilt if $(VERSION),
54 # $(datadir) or other do_subst'ituted variables change.
55 %D%/automake: %D%/automake.in
56 %D%/aclocal: %D%/aclocal.in
57 %D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos
58 $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
60 ## Common substitutions.
61 && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
62 ## Auto-compute prototypes of perl subroutines.
63 && $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \
65 ## We can't use '$(generated_file_finalize)' here, because currently
66 ## Automake contains occurrences of unexpanded @substitutions@ in
67 ## comments, and that is perfectly legit.
68 && chmod a+x,a-w $@-t && mv -f $@-t $@
69 EXTRA_DIST += %D%/gen-perl-protos
71 # vim: ft=automake noet