test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / bin / local.mk
blob4232448b5955e0096b0dac955a920ebfd10bdc89
1 ## -*- makefile-automake -*-
2 ## Copyright (C) 1995-2024 Free Software Foundation, Inc.
3 ##
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program. If not, see <https://www.gnu.org/licenses/>.
17 ## ----------------------------------- ##
18 ## The automake and aclocal scripts. ##
19 ## ----------------------------------- ##
21 bin_SCRIPTS = %D%/automake %D%/aclocal
22 nodist_noinst_SCRIPTS += \
23 %D%/aclocal-$(APIVERSION) \
24 %D%/automake-$(APIVERSION)
26 CLEANFILES += \
27 $(bin_SCRIPTS) \
28 %D%/aclocal-$(APIVERSION) \
29 %D%/automake-$(APIVERSION)
31 # Used by maintainer checks and such.
32 automake_in = $(srcdir)/%D%/automake.in
33 aclocal_in = $(srcdir)/%D%/aclocal.in
34 automake_script = %D%/automake
35 aclocal_script = %D%/aclocal
37 AUTOMAKESOURCES = $(automake_in) $(aclocal_in)
38 TAGS_FILES += $(AUTOMAKESOURCES)
39 EXTRA_DIST += $(AUTOMAKESOURCES)
41 # Make versioned links. We only run the transform on the root name;
42 # then we make a versioned link with the transformed base name. This
43 # seemed like the most reasonable approach.
44 install-exec-hook:
45 @$(POST_INSTALL)
46 @for p in $(bin_SCRIPTS); do \
47 f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
48 fv="$$f-$(APIVERSION)"; \
49 rm -f "$(DESTDIR)$(bindir)/$$fv"; \
50 echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
51 $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
52 done
54 uninstall-hook:
55 @for p in $(bin_SCRIPTS); do \
56 f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
57 fv="$$f-$(APIVERSION)"; \
58 rm -f "$(DESTDIR)$(bindir)/$$fv"; \
59 done
61 # These files depend on Makefile so they are rebuilt if $(VERSION),
62 # $(datadir) or other do_subst'ituted variables change.
63 %D%/automake: %D%/automake.in
64 %D%/aclocal: %D%/aclocal.in
65 %D%/automake %D%/aclocal: Makefile
66 $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
67 && $(MKDIR_P) $(@D) \
68 ## Common substitutions.
69 && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
70 ## We can't use '$(generated_file_finalize)' here, because currently
71 ## Automake contains occurrences of unexpanded @substitutions@ in
72 ## comments, and that is perfectly legit.
73 && chmod a+x,a-w $@-t && mv -f $@-t $@
75 %D%/aclocal-$(APIVERSION): %D%/aclocal
76 $(AM_V_GEN) rm -f $@; \
77 $(LN) %D%/aclocal $@
79 %D%/automake-$(APIVERSION): %D%/automake
80 $(AM_V_GEN) rm -f $@; \
81 $(LN) %D%/automake $@
83 # vim: ft=automake noet