source: trunk/essentials/sys-apps/gawk/Makefile.am@ 3453

Last change on this file since 3453 was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 4.4 KB
Line 
1#
2# Makefile.am --- automake input file for gawk
3#
4# Copyright (C) 2000-2005 the Free Software Foundation, Inc.
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
11# the Free Software Foundation; either version 2 of the License, or
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
21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22#
23
24## process this file with automake to produce Makefile.in
25
26# Automatic de-ANSI-fication if needed, make .bz2 files also.
27AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
28
29# This undocumented variable insures that aclocal runs
30# correctly after changing configure.ac
31ACLOCAL_AMFLAGS = -I m4
32
33# This insures that make flags get passed down to child makes.
34AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
35
36# Stuff to include in the dist that doesn't need it's own
37# Makefile.am files
38EXTRA_DIST = \
39 COPYING \
40 FUTURES \
41 INSTALL \
42 LIMITATIONS \
43 NEWS \
44 POSIX.STD \
45 PROBLEMS \
46 README_d \
47 bisonfix.awk \
48 config.guess \
49 config.rpath \
50 config.sub \
51 depcomp \
52 extension \
53 m4 \
54 missing \
55 missing_d \
56 pc \
57 posix \
58 regcomp.c \
59 regex_internal.c \
60 regex_internal.h \
61 regexec.c \
62 unsupported \
63 version.in \
64 vms \
65 ylwrap
66
67# The order to do things in.
68# Build explicitly in "." in order to build gawk first, so
69# that `make check' without a prior `make' works.
70SUBDIRS = \
71 . \
72 awklib \
73 doc \
74 po \
75 test
76
77# what to make and install
78bin_PROGRAMS = gawk pgawk
79
80# sources for both gawk and pgawk
81base_sources = \
82 array.c \
83 awk.h \
84 awkgram.y \
85 builtin.c \
86 custom.h \
87 dfa.c \
88 dfa.h \
89 ext.c \
90 field.c \
91 gawkmisc.c \
92 getopt.c \
93 getopt.h \
94 getopt1.c \
95 getopt_int.h \
96 gettext.h \
97 hard-locale.h \
98 io.c \
99 mbsupport.h \
100 main.c \
101 msg.c \
102 node.c \
103 protos.h \
104 random.c \
105 random.h \
106 re.c \
107 regex.c \
108 regex.h \
109 replace.c \
110 version.c
111
112gawk_SOURCES = $(base_sources) eval.c profile.c
113pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
114
115# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
116LDADD = $(LIBINTL) $(SOCKET_LIBS)
117
118# Directory for gawk's data files. Automake supplies datadir.
119pkgdatadir = $(datadir)/awk
120
121# stuff for compiling gawk/pgawk
122DEFPATH="\".$(PATH_SEPARATOR)$(pkgdatadir)\""
123
124DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
125
126AM_CPPFLAGS =
127
128# Get rid of core files when cleaning
129CLEANFILES = core core.*
130
131MAINTAINERCLEANFILES = version.c awkgram.c
132
133# We want hard links for install-exec-hook, below
134LN= ln
135
136SUFFIXES = .i
137.c.i:
138 $(COMPILE) -E $< > $@
139
140# First, add a link from gawk to gawk-X.Y.Z.
141# Same for pgawk.
142#
143# For GNU systems where gawk is awk, add a link to awk.
144# (This is done universally, which may not always be right, but
145# there's no easy way to distinguish GNU from non-GNU systems.)
146install-exec-hook:
147 (cd $(DESTDIR)$(bindir); \
148 $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
149 $(LN) pgawk$(EXEEXT) pgawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
150 if [ ! -f awk$(EXEEXT) ]; \
151 then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \
152 fi; exit 0)
153
154# Undo the above when uninstalling
155uninstall-links:
156 (cd $(DESTDIR)$(bindir); \
157 if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \
158 rm -f gawk-$(VERSION)$(EXEEXT) pgawk-$(VERSION)$(EXEEXT); exit 0)
159
160uninstall-recursive: uninstall-links
161
162# force there to be a gawk executable before running tests
163check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
164
165# A little extra clean up when making distributions.
166# FIXME: most of this rule should go away upon switching to libtool.
167dist-hook:
168 cd $(distdir)/extension ; rm -f *.o *.so
169
170# Special rules for individual files
171awkgram.c: awkgram.y
172 $(YACC) $(AM_YFLAGS) $(YFLAGS) $<
173 awk -f $(srcdir)/bisonfix.awk y.tab.c > $*.c && rm y.tab.c
174 if test -f y.tab.h; then \
175 if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
176 else :; fi
177
178# This is for my development & testing.
179efence: gawk
180 $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence
181
182diffout:
183 @$(MAKE) -C test $@
Note: See TracBrowser for help on using the repository browser.