| 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.
|
|---|
| 27 | AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
|
|---|
| 28 |
|
|---|
| 29 | # This undocumented variable insures that aclocal runs
|
|---|
| 30 | # correctly after changing configure.ac
|
|---|
| 31 | ACLOCAL_AMFLAGS = -I m4
|
|---|
| 32 |
|
|---|
| 33 | # This insures that make flags get passed down to child makes.
|
|---|
| 34 | AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
|
|---|
| 35 |
|
|---|
| 36 | # Stuff to include in the dist that doesn't need it's own
|
|---|
| 37 | # Makefile.am files
|
|---|
| 38 | EXTRA_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.
|
|---|
| 70 | SUBDIRS = \
|
|---|
| 71 | . \
|
|---|
| 72 | awklib \
|
|---|
| 73 | doc \
|
|---|
| 74 | po \
|
|---|
| 75 | test
|
|---|
| 76 |
|
|---|
| 77 | # what to make and install
|
|---|
| 78 | bin_PROGRAMS = gawk pgawk
|
|---|
| 79 |
|
|---|
| 80 | # sources for both gawk and pgawk
|
|---|
| 81 | base_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 |
|
|---|
| 112 | gawk_SOURCES = $(base_sources) eval.c profile.c
|
|---|
| 113 | pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
|
|---|
| 114 |
|
|---|
| 115 | # Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
|
|---|
| 116 | LDADD = $(LIBINTL) $(SOCKET_LIBS)
|
|---|
| 117 |
|
|---|
| 118 | # Directory for gawk's data files. Automake supplies datadir.
|
|---|
| 119 | pkgdatadir = $(datadir)/awk
|
|---|
| 120 |
|
|---|
| 121 | # stuff for compiling gawk/pgawk
|
|---|
| 122 | DEFPATH="\".$(PATH_SEPARATOR)$(pkgdatadir)\""
|
|---|
| 123 |
|
|---|
| 124 | DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
|
|---|
| 125 |
|
|---|
| 126 | AM_CPPFLAGS =
|
|---|
| 127 |
|
|---|
| 128 | # Get rid of core files when cleaning
|
|---|
| 129 | CLEANFILES = core core.*
|
|---|
| 130 |
|
|---|
| 131 | MAINTAINERCLEANFILES = version.c awkgram.c
|
|---|
| 132 |
|
|---|
| 133 | # We want hard links for install-exec-hook, below
|
|---|
| 134 | LN= ln
|
|---|
| 135 |
|
|---|
| 136 | SUFFIXES = .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.)
|
|---|
| 146 | install-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
|
|---|
| 155 | uninstall-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 |
|
|---|
| 160 | uninstall-recursive: uninstall-links
|
|---|
| 161 |
|
|---|
| 162 | # force there to be a gawk executable before running tests
|
|---|
| 163 | check-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.
|
|---|
| 167 | dist-hook:
|
|---|
| 168 | cd $(distdir)/extension ; rm -f *.o *.so
|
|---|
| 169 |
|
|---|
| 170 | # Special rules for individual files
|
|---|
| 171 | awkgram.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.
|
|---|
| 179 | efence: gawk
|
|---|
| 180 | $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence
|
|---|
| 181 |
|
|---|
| 182 | diffout:
|
|---|
| 183 | @$(MAKE) -C test $@
|
|---|