summaryrefslogtreecommitdiffstats
path: root/contrib/awk/Makefile.in
blob: 2b464168c73973e98edd377824977c41490501e5 (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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# Makefile for GNU Awk.
#
# Copyright (C) 1986, 1988-2000 the Free Software Foundation, Inc.
# 
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
# 
# GAWK 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 of the License, or
# (at your option) any later version.
# 
# GAWK 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA

@SET_MAKE@

MAKEINFO = makeinfo --no-split

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
YACC = @YACC@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

ALLOCA = @ALLOCA@

LN = ln
LN_S = @LN_S@

exec_prefix = @exec_prefix@
prefix = @prefix@
binprefix =
manprefix =

bindir = @bindir@
libdir = @libdir@
manexta = 1
mandir = @mandir@/man$(manexta)
manext = .$(manexta)
infodir = @infodir@
datadir = @datadir@/awk
libexecdir = @libexecdir@/awk

DEFPATH = ".:$(datadir)"

SHELL = /bin/sh
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
COMPFLAGS = -DGAWK -I. -I$(srcdir) $(CPPFLAGS) @DEFS@ $(CFLAGS)

# object files
AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \
	missing.o msg.o node.o re.o version.o

ALLOBJS = $(AWKOBJS) awktab.o

# LIBOBJS
#	GNU and other stuff that gawk uses as library routines.
LIBOBJS= getopt.o getopt1.o regex.o dfa.o random.o $(ALLOCA)

# source and documentation files
SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \
	missing.c msg.c node.c re.c version.c

ALLSRC= $(SRC) awktab.c

AWKSRC= awk.h awk.y custom.h $(ALLSRC) patchlevel.h protos.h random.h

LIBSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c random.c

COPIES = missing/system.c missing/tzset.c \
	missing/memcmp.c missing/memcpy.c missing/memset.c \
	missing/strncasecmp.c missing/strchr.c \
	missing/strerror.c missing/strtod.c \
	missing/strftime.c missing/strftime.3 

DOCS= doc/gawk.1 doc/gawk.texi doc/texinfo.tex

TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \
	  doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \
	  doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs

MISC =	NEWS COPYING FUTURES Makefile.in PROBLEMS README PORTS POSIX.STD \
	configure configure.in acconfig.h configh.in ACKNOWLEDGMENT \
	ChangeLog INSTALL LIMITATIONS install-sh mkinstalldirs aclocal.m4 \
	stamp-h.in

OTHERS= doc pc atari vms README_d posix awklib

ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info*

MAKEFILEIN = Makefile.in awklib/Makefile.in doc/Makefile.in test/Makefile.in

# Release of gawk.  There can be no leading or trailing white space here!
REL=3.0

# clear out suffixes list
.SUFFIXES:
.SUFFIXES: .c .o

.c.o:
	$(CC) -c $(COMPFLAGS) $<

# rules to build gawk
all:	gawk awklib/all doc/all

# stuff to make sure that configure has been run.
$(srcdir)/configure:	configure.in aclocal.m4
	cd $(srcdir) && autoconf

# autoheader might not change confh.in, so touch a stamp file
$(srcdir)/configh.in:	stamp-h.in
$(srcdir)/stamp-h.in:	configure.in aclocal.m4 acconfig.h
	cd $(srcdir) && autoheader
	date > $(srcdir)/stamp-h.in

config.h:	stamp-h
stamp-h:	configh.in config.status
	$(SHELL) ./config.status

Makefile:	$(MAKEFILEIN) config.status
	$(SHELL) ./config.status

config.status:	configure
	$(SHELL) ./config.status --recheck

# Note: if you need something at both compile time and link time, like -pg,
# you will have to edit the Makefile manually to set LDFLAGS.
gawk:	$(ALLOBJS) $(LIBOBJS) $(REOBJS)
	$(CC) -o gawk $(CFLAGS) $(LDFLAGS) $(ALLOBJS) $(LIBOBJS) $(REOBJS) $(LIBS)

$(ALLOBJS):	awk.h dfa.h regex.h config.h custom.h

$(LIBOBJS):	config.h custom.h

# SunOS make's (at least) VPATH doesn't do subdirectories...
# Solaris make doesn't allow $< in the actual rule
gawkmisc.o:	$(srcdir)/atari/gawkmisc.atr \
		$(srcdir)/pc/gawkmisc.pc $(srcdir)/posix/gawkmisc.c \
		$(srcdir)/vms/gawkmisc.vms
	$(CC) -c $(COMPFLAGS) -DDEFPATH='$(DEFPATH)' $(srcdir)/gawkmisc.c

getopt.o:	getopt.h

getopt1.o:	getopt.h

builtin.o: random.h

main.o:	patchlevel.h

awktab.c:	awk.y
	$(YACC) -v $(srcdir)/awk.y && \
	if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \
	sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \
	rm ytab.c

# VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason
awktab.o:	awktab.c awk.h
	$(CC) -c $(COMPFLAGS) $(srcdir)/awktab.c

alloca.o:	alloca.c

install:	gawk info installdirs
	-rm -f $(bindir)/gawk
	fullname=gawk-$(REL).`./gawk '{print $$3}' $(srcdir)/patchlevel.h` ; \
	$(INSTALL_PROGRAM) gawk $(bindir)/$$fullname ; \
	(cd $(bindir); $(LN) $$fullname gawk)
	(cd $(bindir); \
	if [ ! -f awk ]; \
	then	$(LN_S) gawk awk; \
	fi; exit 0)
	cd doc && $(MAKE) install
	cd awklib && $(MAKE) install

installdirs: mkinstalldirs
	$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
		$(libdir) $(infodir) $(mandir) $(libexecdir)

install-strip:
	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install

uninstall:
	(cd $(bindir); \
	if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi)
	(fullname=gawk-$(REL).`gawk '{print $$3}' $(srcdir)/patchlevel.h` ; \
	cd $(bindir); \
	if cmp gawk $$fullname; then rm -f gawk; fi ; \
	rm -f $(bindir)/$$fullname)
	cd doc && $(MAKE) uninstall
	cd awklib && $(MAKE) uninstall
	-rmdir $(datadir) $(libexecdir)

# auxiliary rules for release maintenance
lint:	$(ALLSRC)
	lint -hcbax $(COMPFLAGS) $(ALLSRC)

xref:
	cxref -c $(COMPFLAGS) $(ALLSRC) | grep -v '	/' >xref

mostlyclean:
	: mostly clean does nothing for gawk
	: use "make clean" to really clean things out

clean:
	rm -rf gawk *.o core */core y.output
	cd doc && $(MAKE) clean
	cd test && $(MAKE) clean
	cd awklib && $(MAKE) clean

local-distclean:
	rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output \
		gmon.out make.out config.h config.status config.cache \
		config.log stamp-h tags TAGS *~

distclean: clean local-distclean
	cd doc && $(MAKE) distclean
	cd awklib && $(MAKE) distclean
	cd test && $(MAKE) distclean

maintainer-clean: clean local-distclean
	@echo "This command is intended for maintainers to use; it"
	@echo "deletes files that may require special tools to rebuild."
	rm -f awktab.c
	cd doc && $(MAKE) maintainer-clean
	cd test && $(MAKE) maintainer-clean
	cd awklib && $(MAKE) maintainer-clean

clobber:	maintainer-clean

TAGS:
	etags $(AWKSRC)

tags:
	ctags $(AWKSRC)

dvi:	$(srcdir)/doc/gawk.texi
	cd doc && $(MAKE) dvi

info:	$(srcdir)/doc/gawk.texi
	cd doc && $(MAKE) info

doc/all:
	cd doc && $(MAKE) all

awklib/all: gawk
	cd awklib && $(MAKE) CFLAGS="$(CFLAGS)" all

dist:	$(AWKSRC) $(LIBSRC) $(DOCS) $(MISC) $(COPIES) awklib/stamp-eg info distclean
	-rm -rf gawk-$(REL)*
	dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
	mkdir $$dir && \
	cp -pr $(AWKSRC) $(LIBSRC) $(MISC) $$dir && \
	mkdir $$dir/missing && \
	cp -p $(COPIES) $$dir/missing && \
	for i in $(OTHERS); \
	do \
		cp -pr $$i $$dir ; \
	done && \
	cp -pr test $$dir && \
	find $$dir -type d -exec chmod 777 {} ';' && \
	find $$dir -print | doschk && \
	tar -cf - $$dir | gzip > $$dir.tar.gz && \
	rm -fr $$dir

awklib/stamp-eg:
	cd awklib ; $(MAKE) stamp-eg

check:	gawk
	cd test; $(MAKE) -k

test:	check

OpenPOWER on IntegriCloud