~vcs-imports/gawk/master

28 by Arnold D. Robbins
Move to gawk-3.1.0.
1
#
2
# Makefile.am --- automake input file for gawk
3
#
408.19.184 by Arnold D. Robbins
Changes toward release and test tarball.
4
# Copyright (C) 2000-2016 the Free Software Foundation, Inc.
28 by Arnold D. Robbins
Move to gawk-3.1.0.
5
#
6
# This file is part of GAWK, the GNU implementation of the
7
# AWK Programming Language.
8
#
9
# GAWK is free software; you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
34 by Arnold D. Robbins
Move to gawk-3.1.6.
11
# the Free Software Foundation; either version 3 of the License, or
28 by Arnold D. Robbins
Move to gawk-3.1.0.
12
# (at your option) any later version.
13
#
14
# GAWK is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
33 by Arnold D. Robbins
Move to gawk 3.1.5.
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
28 by Arnold D. Robbins
Move to gawk-3.1.0.
22
#
23
24
## process this file with automake to produce Makefile.in
25
40 by Arnold D. Robbins
Bring latest byte code gawk into git. Hurray!
26
# This variable insures that aclocal runs
31 by Arnold D. Robbins
Move to gawk-3.1.3.
27
# correctly after changing configure.ac
28 by Arnold D. Robbins
Move to gawk-3.1.0.
28
ACLOCAL_AMFLAGS = -I m4
29
30
# This insures that make flags get passed down to child makes.
31
AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
32
33
# Stuff to include in the dist that doesn't need it's own
34
# Makefile.am files
35
EXTRA_DIST = \
277 by Arnold D. Robbins
Fix vms version stuff. Get the tarball really right.
36
	ChangeLog.0 \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
37
	COPYING \
38
	INSTALL \
39
	NEWS \
187 by Arnold D. Robbins
Move most stuff in NEWS to NEWS.0.
40
	NEWS.0 \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
41
	POSIX.STD \
42
	README_d \
29 by Arnold D. Robbins
Move to gawk-3.1.1.
43
	config.guess \
44
	config.rpath  \
45
	config.sub \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
46
	depcomp \
47
	m4 \
48
	missing \
49
	missing_d \
277.1.6 by Arnold D. Robbins
Fix inclusion of po/README. Update some translations.
50
	po/README \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
51
	pc \
52
	posix \
29 by Arnold D. Robbins
Move to gawk-3.1.1.
53
	vms \
54
	ylwrap
28 by Arnold D. Robbins
Move to gawk-3.1.0.
55
56
# The order to do things in.
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
57
#
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
58
# Build in support first, since we need the support library.
59
#
33 by Arnold D. Robbins
Move to gawk 3.1.5.
60
# Build explicitly in "." in order to build gawk first, so
28 by Arnold D. Robbins
Move to gawk-3.1.0.
61
# that `make check' without a prior `make' works.
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
62
SUBDIRS = support .
63
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
64
# Build in extension before test so that
65
# 	./configure && make check
66
# works properly too.
408.21.1 by Arnold D. Robbins
Rework zOS patches; keep separate from autotools.
67
if ENABLE_EXTENSIONS
68
SUBDIRS += extension
69
endif
70
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
71
# Build in awklib after in doc, since we want to extract
72
# sample files if doc/gawk.texi changed.
408.20.120 by Arnold D. Robbins
Make building a working tarball work again.
73
SUBDIRS += extras doc awklib po test
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
74
28 by Arnold D. Robbins
Move to gawk-3.1.0.
75
# what to make and install
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
76
bin_PROGRAMS = gawk
319.2.15 by Andrew J. Schorr
Install gawkapi.h, fix is_off_limits_var, and enhance ordchr test.
77
include_HEADERS = gawkapi.h
28 by Arnold D. Robbins
Move to gawk-3.1.0.
78
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
79
# sources for both gawk and dgawk
28 by Arnold D. Robbins
Move to gawk-3.1.0.
80
base_sources = \
81
	array.c \
82
	awk.h \
83
	awkgram.y \
84
	builtin.c \
281.1.1 by john haque
Speed/memory performance improvements.
85
	cint_array.c \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
86
	cmd.h \
87
	command.y \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
88
	custom.h \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
89
	debug.c \
90
	eval.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
91
	ext.c \
92
	field.c \
34 by Arnold D. Robbins
Move to gawk-3.1.6.
93
	floatcomp.c \
35 by Arnold D. Robbins
Move to gawk-3.1.7.
94
	floatmagic.h \
319.2.13 by Andrew J. Schorr
First working version of new API mechanism (probably has memory leaks).
95
	gawkapi.c \
319.2.15 by Andrew J. Schorr
Install gawkapi.h, fix is_off_limits_var, and enhance ordchr test.
96
	gawkapi.h \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
97
	gawkmisc.c \
29 by Arnold D. Robbins
Move to gawk-3.1.1.
98
	gettext.h \
281.1.1 by john haque
Speed/memory performance improvements.
99
	int_array.c \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
100
	interpret.h \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
101
	io.c \
32 by Arnold D. Robbins
Move to gawk-3.1.4.
102
	mbsupport.h \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
103
	main.c \
300 by john haque
Add infrastructure for MPFR/GMP support.
104
	mpfr.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
105
	msg.c \
106
	node.c \
408.4.25 by Arnold D. Robbins
Move FAKE_FD_VALUE to shared header.
107
	nonposix.h \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
108
	profile.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
109
	protos.h \
110
	re.c \
111
	replace.c \
281.1.1 by john haque
Speed/memory performance improvements.
112
	str_array.c \
113
	symbol.c \
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
114
	version.c
28 by Arnold D. Robbins
Move to gawk-3.1.0.
115
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
116
gawk_SOURCES = $(base_sources)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
117
33 by Arnold D. Robbins
Move to gawk 3.1.5.
118
# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
119
LDADD = support/libsupport.a \
120
	$(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) $(LIBREADLINE) $(LIBMPFR)
29 by Arnold D. Robbins
Move to gawk-3.1.1.
121
33 by Arnold D. Robbins
Move to gawk 3.1.5.
122
# Directory for gawk's data files. Automake supplies datadir.
123
pkgdatadir = $(datadir)/awk
28 by Arnold D. Robbins
Move to gawk-3.1.0.
124
125
# stuff for compiling gawk/pgawk
36 by Arnold D. Robbins
Move to 3.1.8.
126
DEFPATH='".$(PATH_SEPARATOR)$(pkgdatadir)"'
127
299.2.1 by Andrew J. Schorr
- Add new environment variable AWKLIBPATH to use when searching for shared
128
# shared library support:
319.2.70 by Andrew J. Schorr
Minor configure.ac/Makefile.am change for more elegant shared library support.
129
SHLIBEXT = "\"$(GAWKLIBEXT)"\"
299.2.1 by Andrew J. Schorr
- Add new environment variable AWKLIBPATH to use when searching for shared
130
DEFLIBPATH="\"$(pkgextensiondir)\""
131
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
132
DEFS= -DDEFPATH=$(DEFPATH) -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"$(datadir)/locale"' -I"$(srcdir)/support"
32 by Arnold D. Robbins
Move to gawk-3.1.4.
133
134
# Get rid of core files when cleaning
135
CLEANFILES = core core.*
28 by Arnold D. Robbins
Move to gawk-3.1.0.
136
137
# We want hard links for install-exec-hook, below
138
LN= ln
139
408.5.238 by Arnold D. Robbins
Revert previous patch; instead define RM.
140
# For some make's, e.g. OpenBSD, that don't define this
141
RM = rm -f
142
32 by Arnold D. Robbins
Move to gawk-3.1.4.
143
# First, add a link from gawk to gawk-X.Y.Z.
144
#
145
# For GNU systems where gawk is awk, add a link to awk.
146
# (This is done universally, which may not always be right, but
147
# there's no easy way to distinguish GNU from non-GNU systems.)
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
148
#
149
# Use the transform, in case --program-prefix=XXX
28 by Arnold D. Robbins
Move to gawk-3.1.0.
150
install-exec-hook:
32 by Arnold D. Robbins
Move to gawk-3.1.4.
151
	(cd $(DESTDIR)$(bindir); \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
152
	name=`echo gawk | sed '$(transform)'` ; \
153
	$(LN) $${name}$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
408.5.333 by Arnold D. Robbins
OS/2 fixes.
154
	if [ ! -f awk$(EXEEXT) ]; \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
155
	then	$(LN_S) $${name}$(EXEEXT) awk$(EXEEXT); \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
156
	fi; exit 0)
157
158
# Undo the above when uninstalling
159
uninstall-links:
160
	(cd $(DESTDIR)$(bindir); \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
161
	name=`echo gawk | sed '$(transform)'` ; \
162
	if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) $${name}$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
163
	rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
164
165
uninstall-recursive: uninstall-links
166
167
# force there to be a gawk executable before running tests
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
168
check-local: gawk$(EXEEXT)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
169
170
# A little extra clean up when making distributions.
277.1.55 by Arnold D. Robbins
Generate pc/config.h at make dist time.
171
# And additional set up for the pc directory.
731.11.352 by Arnold D. Robbins
Major improvements to test infrastructure.
172
dist-hook: pc/Makefile.tst
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
173
	cd "$(distdir)"/extension ; rm -f *.o *.so
174
	cd "$(srcdir)"/pc ; \
408.5.61 by Arnold D. Robbins
More changes to dist-hook.
175
	chmod u+w config.h ; \
408.5.59 by Arnold D. Robbins
Fix creation of pc/config.h.
176
	sed -n -f configpk.sed < ../configure.ac > /tmp/tmp.sed ; \
177
	sed -f config.sed < ../configh.in > /tmp/config.tmp ; \
178
	sed -f /tmp/tmp.sed < /tmp/config.tmp > config.h ; \
408.5.238 by Arnold D. Robbins
Revert previous patch; instead define RM.
179
	$(RM) /tmp/tmp.sed /tmp/config.tmp
408.5.61 by Arnold D. Robbins
More changes to dist-hook.
180
	pwd
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
181
	chmod u+w "$(distdir)"/pc/config.h
182
	cp "$(srcdir)"/pc/config.h "$(distdir)"/pc/config.h
28 by Arnold D. Robbins
Move to gawk-3.1.0.
183
184
# Special rules for individual files
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
185
28 by Arnold D. Robbins
Move to gawk-3.1.0.
186
awkgram.c: awkgram.y
731.11.151 by Arnold D. Robbins
Revise build to use bison for both grammars in a parallel-safe way.
187
	$(YACC) -o $@ $(AM_YFLAGS) $(YFLAGS) $<
188
	sed 's/parse error/syntax error/g' < $@ > $@.tmp && mv $@.tmp $@
28 by Arnold D. Robbins
Move to gawk-3.1.0.
189
731.11.151 by Arnold D. Robbins
Revise build to use bison for both grammars in a parallel-safe way.
190
command.c: command.y
731.11.149 by Arnold D. Robbins
Serialize running bison in parallel builds.
191
	$(YACC) -o $@ -p zz $<
192
	sed 's/parse error/syntax error/g' < $@ > $@.tmp && mv $@.tmp $@
40 by Arnold D. Robbins
Bring latest byte code gawk into git. Hurray!
193
731.11.352 by Arnold D. Robbins
Major improvements to test infrastructure.
194
pc/Makefile.tst: test/Makefile.in
731.18.10 by Arnold D. Robbins
Fix building pc/Makefile.tst. Make gawk 4.2.1a tarball.
195
	awk -f "$(top_srcdir)"/pc/GenMakefileTst.awk ../test/Makefile.in > pc/Makefile.tst
731.11.352 by Arnold D. Robbins
Major improvements to test infrastructure.
196
30 by Arnold D. Robbins
Move to gawk-3.1.2.
197
# This is for my development & testing.
198
efence: gawk
408.13.129 by Arnold D. Robbins
Fix efence target, whitepsace in ChangeLog.
199
	$(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LDADD) $(LIBS) -lefence
32 by Arnold D. Robbins
Move to gawk-3.1.4.
200
34 by Arnold D. Robbins
Move to gawk-3.1.6.
201
diffout valgrind-scan:
202
	@cd test && $(MAKE) $(AM_MAKEFLAGS) $@
203
204
valgrind:
205
	cd test; rm -f log.[0-9]*; \
286.1.20 by Andrew J. Schorr
Fix valgrind targets to respect environment settings and work with for shared library tests.
206
	make check VALGRIND="valgrind --leak-check=full --log-file=log.%p"; \
34 by Arnold D. Robbins
Move to gawk-3.1.6.
207
	make valgrind-scan
286.1.15 by Andrew J. Schorr
Add valgrind-noleak target.
208
209
valgrind-noleak:
210
	cd test; rm -f log.[0-9]*; \
286.1.20 by Andrew J. Schorr
Fix valgrind targets to respect environment settings and work with for shared library tests.
211
	make check VALGRIND="valgrind --leak-check=no --log-file=log.%p"; \
286.1.15 by Andrew J. Schorr
Add valgrind-noleak target.
212
	make valgrind-scan
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
213
214
spell:
215
	cd "$(srcdir)"/doc ; $(MAKE) spell