summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: c49d1e9e2c2a81e4ac3c038ba64c377e9c907266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
## Process this file with automake to create Makefile.in

## Makefile for Automake.

# Copyright (C) 1995-2013 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

## Might be updated later.
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
EXTRA_DIST =
TAGS_FILES =
dist_noinst_DATA =
nodist_noinst_DATA =
dist_noinst_SCRIPTS =
nodist_noinst_SCRIPTS =

## ------------ ##
##  Top level.  ##
## ------------ ##

# We want a handful of substitutions to be fully-expanded by make;
# then use config.status to substitute the remainder where a single
# expansion is sufficient.  We use a funny notation here to avoid
# configure substitutions in our text.
do_subst = ( sed \
  -e "s,[@]configure_input[@],Generated from $$in; do not edit by hand.,g" \
  -e 's,[@]datadir[@],$(datadir),g' \
  -e 's,[@]amdir[@],$(amdir),g' \
  -e 's,[@]bindir[@],$(bindir),g' \
  -e 's,[@]docdir[@],$(docdir),g' \
  -e 's,[@]pkgvdatadir[@],$(pkgvdatadir),g' \
  -e 's,[@]scriptdir[@],$(scriptdir),g' \
  -e 's,[@]automake_acdir[@],$(automake_acdir),g' \
  -e 's,[@]system_acdir[@],$(system_acdir),g' \
## Hack to avoid a spurious substitution in the Automake script (part 1).
  -e 's,[@]am__isrc[@],!!@!!am__isrc!!@!!,g' \
  | $(SHELL) ./config.status --file=- \
## Hack to avoid a spurious substitution in the Automake script (part 2).
  | sed -e 's,!!@!!am__isrc!!@!!,@''am__isrc@,g' \
  )

# Generated  files shouldn't contain unexpanded '@substitutions@', and
# should be made read-only, to prevent them from being edited by mistake
# instead of the file the are generated from.
generated_file_finalize = $(AM_V_at) \
  if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
    echo "$@ contains unexpanded substitution (see lines above)"; \
    exit 1; \
  fi; \
  chmod a-w $@-t && mv -f $@-t $@

bin_SCRIPTS = automake aclocal

CLEANFILES += $(bin_SCRIPTS)
AUTOMAKESOURCES = automake.in aclocal.in

TAGS_FILES += $(AUTOMAKESOURCES)

EXTRA_DIST += \
  $(AUTOMAKESOURCES) \
  bootstrap.sh \
  GNUmakefile \
  HACKING \
  PLANS

# For some tests or targets, we need to have the just-build automake and
# aclocal scripts avaiable on PATH.
extend_PATH = \
  { PATH='$(abs_builddir)/t/wrap'$(PATH_SEPARATOR)$$PATH && export PATH; }

# Make versioned links.  We only run the transform on the root name;
# then we make a versioned link with the transformed base name.  This
# seemed like the most reasonable approach.
install-exec-hook:
	@$(POST_INSTALL)
	@for p in $(bin_SCRIPTS); do \
	  f=`echo $$p | sed '$(transform)'`; \
	  fv="$$f-$(APIVERSION)"; \
	  rm -f "$(DESTDIR)$(bindir)/$$fv"; \
	  echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
	  $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
	done

uninstall-hook:
	@for p in $(bin_SCRIPTS); do \
	  f=`echo $$p | sed '$(transform)'`; \
	  fv="$$f-$(APIVERSION)"; \
	  rm -f "$(DESTDIR)$(bindir)/$$fv"; \
	done

# These files depend on Makefile so they are rebuilt if $(VERSION),
# $(datadir) or other do_subst'ituted variables change.
automake: automake.in
aclocal: aclocal.in
automake aclocal: Makefile lib/gen-perl-protos
	$(AM_V_GEN)rm -f $@ $@-t $@-t2 \
## Common substitutions.
	  && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
## Auto-compute prototypes of perl subroutines.
	  && $(PERL) -w $(srcdir)/lib/gen-perl-protos $@-t > $@-t2 \
	  && mv -f $@-t2 $@-t \
## We can't use '$(generated_file_finalize)' here, because currently
## Automake contains occurrences of unexpanded @substitutions@ in
## comments, and that is perfectly legit.
	  && chmod a+x,a-w $@-t && mv -f $@-t $@
EXTRA_DIST += lib/gen-perl-protos

# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.
# Make sure we also update this copy.
INSTALL: lib/INSTALL
	$(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@

# We don't use the default name for the autom4te cache directory,
# so we need this.
maintainer-clean-local:
	rm -rf .autom4te.cache

# So that automake won't complain about the missing ChangeLog.
# The real rule for ChangeLog generation is now in maintainer/maint.mk
# (as it is maintainer-specific).
ChangeLog:

# Third-party, obsolescent or experimental stuff.
EXTRA_DIST += \
  contrib/check-html.am \
  contrib/multilib/README \
  contrib/multilib/config-ml.in \
  contrib/multilib/symlink-tree \
  contrib/multilib/multilib.am \
  contrib/multilib/multi.m4 \
  contrib/README

# Older files, kept mostly for historical interest.
EXTRA_DIST += \
  old/ChangeLog-tests \
  old/ChangeLog.96 \
  old/ChangeLog.98 \
  old/ChangeLog.00 \
  old/ChangeLog.01 \
  old/ChangeLog.02 \
  old/ChangeLog.03 \
  old/ChangeLog.04 \
  old/ChangeLog.09 \
  old/ChangeLog.11 \
  old/TODO

# Maintainer-specific files and scripts.
EXTRA_DIST += \
  maintainer/am-ft \
  maintainer/am-xft \
  maintainer/rename-tests \
  maintainer/maint.mk \
  maintainer/syntax-checks.mk

# Most work delegated to sub-dir makefile fragments.
include $(srcdir)/doc/Makefile.inc
include $(srcdir)/lib/Makefile.inc
include $(srcdir)/lib/Automake/Makefile.inc
include $(srcdir)/lib/am/Makefile.inc
include $(srcdir)/m4/Makefile.inc
include $(srcdir)/t/Makefile.inc

# vim: ft=automake noet