~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
#
1814.1.138 by Arnold D. Robbins
Update copyright year in a bunch of files.
4
# Copyright (C) 2000-2023 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
1285 by Arnold D. Robbins
Squashed commit of the following:
30
AM_CFLAGS = @CFLAGS@
31
AM_LDFLAGS = @LDFLAGS@
28 by Arnold D. Robbins
Move to gawk-3.1.0.
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 \
1146.1.3 by Arnold D. Robbins
Ensure that ChangeLog.1 gets into the distribution.
37
	ChangeLog.1 \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
38
	COPYING \
39
	INSTALL \
40
	NEWS \
187 by Arnold D. Robbins
Move most stuff in NEWS to NEWS.0.
41
	NEWS.0 \
1087 by Arnold D. Robbins
Include NEWS.1 in what gets distributed.
42
	NEWS.1 \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
43
	POSIX.STD \
44
	README_d \
45
	m4 \
46
	missing_d \
277.1.6 by Arnold D. Robbins
Fix inclusion of po/README. Update some translations.
47
	po/README \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
48
	pc \
49
	posix \
1472.1.60 by Arnold D. Robbins
Get make distcheck working.
50
	vms
28 by Arnold D. Robbins
Move to gawk-3.1.0.
51
52
# The order to do things in.
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
53
#
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
54
# Build in support first, since we need the support library.
55
#
33 by Arnold D. Robbins
Move to gawk 3.1.5.
56
# Build explicitly in "." in order to build gawk first, so
28 by Arnold D. Robbins
Move to gawk-3.1.0.
57
# that `make check' without a prior `make' works.
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
58
SUBDIRS = support .
59
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
60
# Build in extension before test so that
61
# 	./configure && make check
62
# works properly too.
408.21.1 by Arnold D. Robbins
Rework zOS patches; keep separate from autotools.
63
if ENABLE_EXTENSIONS
64
SUBDIRS += extension
65
endif
66
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
67
# Build in awklib after in doc, since we want to extract
68
# sample files if doc/gawk.texi changed.
408.20.120 by Arnold D. Robbins
Make building a working tarball work again.
69
SUBDIRS += extras doc awklib po test
408.19.49 by Arnold D. Robbins
Fix build ordering issues.
70
28 by Arnold D. Robbins
Move to gawk-3.1.0.
71
# what to make and install
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
72
bin_PROGRAMS = gawk
1677 by Arnold D. Robbins
Add gawkbug script and man page.
73
bin_SCRIPTS = gawkbug
319.2.15 by Andrew J. Schorr
Install gawkapi.h, fix is_off_limits_var, and enhance ordchr test.
74
include_HEADERS = gawkapi.h
1285 by Arnold D. Robbins
Squashed commit of the following:
75
BUILT_SOURCES = $(srcdir)/pc/Makefile.tst
28 by Arnold D. Robbins
Move to gawk-3.1.0.
76
1677 by Arnold D. Robbins
Add gawkbug script and man page.
77
# sources for gawk
28 by Arnold D. Robbins
Move to gawk-3.1.0.
78
base_sources = \
79
	array.c \
80
	awk.h \
81
	awkgram.y \
82
	builtin.c \
281.1.1 by john haque
Speed/memory performance improvements.
83
	cint_array.c \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
84
	cmd.h \
85
	command.y \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
86
	custom.h \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
87
	debug.c \
88
	eval.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
89
	ext.c \
90
	field.c \
34 by Arnold D. Robbins
Move to gawk-3.1.6.
91
	floatcomp.c \
35 by Arnold D. Robbins
Move to gawk-3.1.7.
92
	floatmagic.h \
319.2.13 by Andrew J. Schorr
First working version of new API mechanism (probably has memory leaks).
93
	gawkapi.c \
319.2.15 by Andrew J. Schorr
Install gawkapi.h, fix is_off_limits_var, and enhance ordchr test.
94
	gawkapi.h \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
95
	gawkmisc.c \
29 by Arnold D. Robbins
Move to gawk-3.1.1.
96
	gettext.h \
281.1.1 by john haque
Speed/memory performance improvements.
97
	int_array.c \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
98
	interpret.h \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
99
	io.c \
100
	main.c \
300 by john haque
Add infrastructure for MPFR/GMP support.
101
	mpfr.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
102
	msg.c \
103
	node.c \
408.4.25 by Arnold D. Robbins
Move FAKE_FD_VALUE to shared header.
104
	nonposix.h \
2057.1.73 by Arnold D. Robbins
Squashed commit of the following:
105
	printf.c \
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
106
	profile.c \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
107
	protos.h \
108
	re.c \
109
	replace.c \
281.1.1 by john haque
Speed/memory performance improvements.
110
	str_array.c \
111
	symbol.c \
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
112
	version.c
28 by Arnold D. Robbins
Move to gawk-3.1.0.
113
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
114
gawk_SOURCES = $(base_sources)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
115
33 by Arnold D. Robbins
Move to gawk 3.1.5.
116
# 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.
117
LDADD = support/libsupport.a \
1720.1.11 by Arnold D. Robbins
Squashed commit of the following:
118
	$(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) $(LIBREADLINE) $(LIBMPFR) \
119
	$(LDFLAGS)
29 by Arnold D. Robbins
Move to gawk-3.1.1.
120
33 by Arnold D. Robbins
Move to gawk 3.1.5.
121
# Directory for gawk's data files. Automake supplies datadir.
122
pkgdatadir = $(datadir)/awk
28 by Arnold D. Robbins
Move to gawk-3.1.0.
123
124
# stuff for compiling gawk/pgawk
36 by Arnold D. Robbins
Move to 3.1.8.
125
DEFPATH='".$(PATH_SEPARATOR)$(pkgdatadir)"'
126
299.2.1 by Andrew J. Schorr
- Add new environment variable AWKLIBPATH to use when searching for shared
127
# shared library support:
319.2.70 by Andrew J. Schorr
Minor configure.ac/Makefile.am change for more elegant shared library support.
128
SHLIBEXT = "\"$(GAWKLIBEXT)"\"
299.2.1 by Andrew J. Schorr
- Add new environment variable AWKLIBPATH to use when searching for shared
129
DEFLIBPATH="\"$(pkgextensiondir)\""
130
731.1.10 by Arnold D. Robbins
Add small regex fix. Add support directory.
131
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.
132
133
# Get rid of core files when cleaning
1677 by Arnold D. Robbins
Add gawkbug script and man page.
134
CLEANFILES = core core.* $(bin_SCRIPTS)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
135
136
# We want hard links for install-exec-hook, below
137
LN= ln
138
1677 by Arnold D. Robbins
Add gawkbug script and man page.
139
# Make copies...
140
CP= cp
141
408.5.238 by Arnold D. Robbins
Revert previous patch; instead define RM.
142
# For some make's, e.g. OpenBSD, that don't define this
143
RM = rm -f
144
1814.1.42 by Arnold D. Robbins
Improve debuggability, mainly for maintainers.
145
# For debugging
146
DEBUG = -gdwarf-4 -g3
147
32 by Arnold D. Robbins
Move to gawk-3.1.4.
148
# First, add a link from gawk to gawk-X.Y.Z.
149
#
150
# For GNU systems where gawk is awk, add a link to awk.
151
# (This is done universally, which may not always be right, but
152
# 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.
153
#
154
# Use the transform, in case --program-prefix=XXX
28 by Arnold D. Robbins
Move to gawk-3.1.0.
155
install-exec-hook:
32 by Arnold D. Robbins
Move to gawk-3.1.4.
156
	(cd $(DESTDIR)$(bindir); \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
157
	name=`echo gawk | sed '$(transform)'` ; \
1814.1.67 by Arnold D. Robbins
Fix install-exec-hook for POSIX mode in GNU make.
158
	if [ ! -f gawk-$(VERSION)$(EXEEXT) ]; \
159
	then	$(LN) $${name}$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
160
	fi; \
408.5.333 by Arnold D. Robbins
OS/2 fixes.
161
	if [ ! -f awk$(EXEEXT) ]; \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
162
	then	$(LN_S) $${name}$(EXEEXT) awk$(EXEEXT); \
28 by Arnold D. Robbins
Move to gawk-3.1.0.
163
	fi; exit 0)
164
165
# Undo the above when uninstalling
166
uninstall-links:
167
	(cd $(DESTDIR)$(bindir); \
408.13.161 by Arnold D. Robbins
Take --program-prefix into account for the installation symlinks.
168
	name=`echo gawk | sed '$(transform)'` ; \
169
	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.
170
	rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
171
172
uninstall-recursive: uninstall-links
173
174
# force there to be a gawk executable before running tests
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
175
check-local: gawk$(EXEEXT)
28 by Arnold D. Robbins
Move to gawk-3.1.0.
176
177
# A little extra clean up when making distributions.
1285 by Arnold D. Robbins
Squashed commit of the following:
178
dist-hook:
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
179
	cd "$(distdir)"/extension ; rm -f *.o *.so
180
	cd "$(srcdir)"/pc ; \
408.5.61 by Arnold D. Robbins
More changes to dist-hook.
181
	chmod u+w config.h ; \
408.5.59 by Arnold D. Robbins
Fix creation of pc/config.h.
182
	sed -n -f configpk.sed < ../configure.ac > /tmp/tmp.sed ; \
183
	sed -f config.sed < ../configh.in > /tmp/config.tmp ; \
184
	sed -f /tmp/tmp.sed < /tmp/config.tmp > config.h ; \
408.5.238 by Arnold D. Robbins
Revert previous patch; instead define RM.
185
	$(RM) /tmp/tmp.sed /tmp/config.tmp
408.5.61 by Arnold D. Robbins
More changes to dist-hook.
186
	pwd
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
187
	chmod u+w "$(distdir)"/pc/config.h
188
	cp "$(srcdir)"/pc/config.h "$(distdir)"/pc/config.h
28 by Arnold D. Robbins
Move to gawk-3.1.0.
189
190
# Special rules for individual files
291 by Arnold D. Robbins
The grand merge: dgawk and pgawk folded into gawk.
191
1285 by Arnold D. Robbins
Squashed commit of the following:
192
$(srcdir)/awkgram.c: awkgram.y
731.11.151 by Arnold D. Robbins
Revise build to use bison for both grammars in a parallel-safe way.
193
	$(YACC) -o $@ $(AM_YFLAGS) $(YFLAGS) $<
194
	sed 's/parse error/syntax error/g' < $@ > $@.tmp && mv $@.tmp $@
28 by Arnold D. Robbins
Move to gawk-3.1.0.
195
1285 by Arnold D. Robbins
Squashed commit of the following:
196
$(srcdir)/command.c: command.y
731.11.149 by Arnold D. Robbins
Serialize running bison in parallel builds.
197
	$(YACC) -o $@ -p zz $<
198
	sed 's/parse error/syntax error/g' < $@ > $@.tmp && mv $@.tmp $@
40 by Arnold D. Robbins
Bring latest byte code gawk into git. Hurray!
199
1285 by Arnold D. Robbins
Squashed commit of the following:
200
$(srcdir)/pc/Makefile.tst: test/Makefile.in pc/Makefile.tst.prologue pc/GenMakefileTst.awk
201
	$(AM_V_GEN)$(MKDIR_P) "$(srcdir)"/pc && \
202
	cat "$(srcdir)"/pc/Makefile.tst.prologue > "$(srcdir)"/pc/Makefile.tst && \
203
	$(AWK) -f "$(srcdir)"/pc/GenMakefileTst.awk "$(srcdir)"/test/Makefile.in >> "$(srcdir)"/pc/Makefile.tst
731.11.352 by Arnold D. Robbins
Major improvements to test infrastructure.
204
30 by Arnold D. Robbins
Move to gawk-3.1.2.
205
# This is for my development & testing.
206
efence: gawk
1285 by Arnold D. Robbins
Squashed commit of the following:
207
	$(CC) $(AM_LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LDADD) $(LIBS) -lefence
32 by Arnold D. Robbins
Move to gawk-3.1.4.
208
1303 by Arnold D. Robbins
Updates for z/OS.
209
diffout valgrind-scan zos-diffout:
34 by Arnold D. Robbins
Move to gawk-3.1.6.
210
	@cd test && $(MAKE) $(AM_MAKEFLAGS) $@
211
212
valgrind:
213
	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.
214
	make check VALGRIND="valgrind --leak-check=full --log-file=log.%p"; \
34 by Arnold D. Robbins
Move to gawk-3.1.6.
215
	make valgrind-scan
286.1.15 by Andrew J. Schorr
Add valgrind-noleak target.
216
217
valgrind-noleak:
218
	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.
219
	make check VALGRIND="valgrind --leak-check=no --log-file=log.%p"; \
286.1.15 by Andrew J. Schorr
Add valgrind-noleak target.
220
	make valgrind-scan
408.19.251 by Arnold D. Robbins
Doc updates, add 'spell' target for make.
221
222
spell:
223
	cd "$(srcdir)"/doc ; $(MAKE) spell
731.18.28 by Arnold D. Robbins
Remove .deps directory upon make distclean.
224
225
distclean-local:
226
	rm -fr .deps