# Copyright (C) 1986, 1988-1992 the Free Software Foundation, Inc.
# This file is part of GAWK, the GNU implementation of the
# AWK Progamming 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 GAWK; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# User tunable macros -- CHANGE THESE IN Makefile.in RATHER THAN IN
# Makefile, OR configure WILL OVERWRITE YOUR CHANGES
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man
/man1
# CFLAGS: options to the C compiler
# -g include dbx/sdb info
# -pg include new (gmon) profiling info
# The provided "configure" is used to turn a config file (samples in
# the "config" directory into commands to edit config.in into
# a suitable config.h and to edit Makefile.in into Makefile.
# To port GAWK, create an appropriate config file using the ones in
# the config directory as examples and using the comments in config.in
DEBUG
= #-DMALLOCDEBUG #-DDEBUG #-DFUNC_TRACE #-DMPROF
WARN
= #-W -Wunused -Wimplicit -Wreturn-type -Wcomment # for gcc only
# Parser to use on grammar - any one of the following will work
# Set LIBS to any libraries that are machine specific
# Cray 2 running Unicos 5.0.7
##MAKE_LIBNET## LIBS = -lnet
# Systems with alloca in /lib/libPW.a
##MAKE_ALLOCA_PW## LIBS = -lPW
# ALLOCA - only needed if you use bison
# Set equal to alloca.o if your system is S5 and you don't have
# alloca. Uncomment one of the rules below to make alloca.o from
# either alloca.s or alloca.c.
# This should have already been done automatically by configure.
# Some systems have alloca in libPW.a, so LIBS=-lPW may work, too.
##MAKE_ALLOCA_C## ALLOCA= alloca.o
##MAKE_ALLOCA_S## ALLOCA= alloca.o
##MAKE_VMS-Posix## FLAGS = -UVMS -D__STDC__=0
# HP/Apollo running cc version 6.7 or earlier
##MAKE_Apollo## FLAGS = -U__STDC__ -A run,sys5.3
##MAKE_Apollo## LIBS = -A sys,any
# SGI IRIX 4.0.5 cc flags
##MAKE_SGI## FLAGS = -cckr
# Use -s -Xlinker -object flags when you are satisfied that
# that the program compiles correctly
##MAKE_NeXT## FLAGS = -DGFMT_WORKAROUND #-s -Xlinker -object
CFLAGS
= -DGAWK
$(FLAGS
) $(DEBUG
) $(LINKSTATIC
) $(PROFILE
) $(OPTIMIZE
) $(WARN
)
AWKOBJS
= main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
node.o version.o missing.o re.o getopt.o getopt1.o
ALLOBJS
= $(AWKOBJS
) awktab.o
# GNU stuff that gawk uses as library routines.
GNUOBJS
= regex.o dfa.o
$(ALLOCA
)
# source and documentation files
SRC
= main.c eval.c builtin.c msg.c version.c \
iop.c io.c field.c array.c node.c missing.c re.c getopt.c getopt1.c
AWKSRC
= awk.h awk.y
$(ALLSRC
) patchlevel.h protos.h config.in getopt.h
GNUSRC
= alloca.c alloca.s dfa.c dfa.h regex.c regex.h
COPIES
= missing
/system.c missing
/tzset.c \
missing
/memcmp.c missing
/memcpy.c missing
/memset.c \
missing
/random.c missing
/strncasecmp.c missing
/strchr.c \
missing
/strerror.c missing
/strtod.c \
missing
/strftime.c missing
/strftime
.3
SUPPORT
= support
/texindex.c support
/texinfo.
tex
DOCS
= gawk
.1 gawk.texi gawk.
info
TEXFILES
= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
MISC
= NEWS COPYING FUTURES Makefile.
* PROBLEMS README
* PORTS POSIX \
mungeconf configure ACKNOWLEDGMENT LIMITATIONS
OTHERS
= pc/* atari
/* vms
/*
ALLDOC
= gawk.
dvi $(TEXFILES
) gawk.
info*
# Release of gawk. There can be no leading or trailing white space here!
gawk
: $(ALLOBJS
) $(GNUOBJS
) $(REOBJS
)
$(CC
) -o gawk
$(CFLAGS
) $(ALLOBJS
) $(GNUOBJS
) $(REOBJS
) -lm
$(LIBS
)
$(AWKOBJS
) regex.o dfa.o
: awk.h dfa.h regex.h
##MAKE_VMS-Posix## mv ytab.c awktab.c
##MAKE_VMS-Posix## dummy.awk_tab.target:
sed
'/^extern char .malloc(), .realloc();$$/d' y.tab.c
>awktab.c
@echo You must provide a config.h
!
@echo Run
\".
/configure
\" to build it for known systems
@echo or copy config.in to config.h and edit it.
; exit
1
cp gawk
$(bindir) && chmod
755 $(bindir)/gawk
cp gawk
.1 $(mandir)/gawk
$(manext) && chmod
644 $(mandir)/gawk
$(manext)
cp gawk.
info* $(infodir) && chmod
644 $(infodir)/gawk.
info*
rm -f
$(bindir)/gawk
$(mandir)/gawk
$(manext) $(infodir)/gawk.
info*
# ALLOCA: uncomment this if your system (notably System V boxen)
# does not have alloca in /lib/libc.a or /lib/libPW.a
# If your machine is not supported by the assembly version of alloca.s,
# use the C version which follows instead. It uses the default rules to
# One of these rules should have already been selected by running configure.
##MAKE_ALLOCA_S## alloca.o: alloca.s
##MAKE_ALLOCA_S## /lib/cpp < alloca.s | sed '/^#/d' > t.s
##MAKE_ALLOCA_S## as t.s -o alloca.o
##MAKE_ALLOCA_C## alloca.o: alloca.c
# auxiliary rules for release maintenance
lint
-hcbax
$(FLAGS
) $(ALLSRC
)
cxref
-c
$(FLAGS
) $(ALLSRC
) | grep
-v
' /' >xref
rm -f Makefile
*.orig
*.rej
*/*.orig
*/*.rej awk.output gmon.out \
make.out y.output config.h
rm -f gawk awktab.c Makefile config.h
rm -f
$(ALLDOC
) gawk.log config.h
tex gawk.texi
; texindex gawk.??
tex gawk.texi
; texindex gawk.??
dist: $(AWKSRC
) $(GNUSRC
) $(DOCS
) $(MISC
) $(COPIES
) $(SUPPORT
) distclean
dir=gawk-
$(REL
).
`gawk '{print $$3}' patchlevel.h` && \
cp
-p
$(AWKSRC
) $(GNUSRC
) $(DOCS
) gawk.info-
* $(MISC
) $$dir && \
mkdir
$$dir/missing
&& cp
-p
$(COPIES
) $$dir/missing
&& \
mkdir
$$dir/atari
&& cp
-p atari
/* $$dir/atari
&& \
mkdir
$$dir/pc && cp
-p
pc/* $$dir/pc && \
mkdir
$$dir/vms
&& cp
-p vms
/* $$dir/vms
&& \
mkdir
$$dir/config
&& cp
-p config
/* $$dir/config
&& \
mkdir
$$dir/support
&& cp
-p support
/* $$dir/support
&& \
cd
$$dir && chmod u
+w .
test missing atari
pc vms config support
&& \
tar -cf
- $$dir | gzip
> $$dir.
tar.z
&& \
gawk-doc-
$(REL
).
tar.z
: gawk.
info gawk.
dvi gawk
.1
-rm -rf gawk-doc-
$(REL
) gawk-doc-
$(REL
).
tar.z
cp
-p gawk.
dvi gawk-doc-
$(REL
)
nroff
-man gawk
.1 > gawk-doc-
$(REL
)/gawk
.1.pr
tar -cf
- gawk-doc-
$(REL
) | gzip
> gawk-doc-
$(REL
).
tar.z
gawk-ps-
$(REL
).
tar.z
: gawk.
dvi gawk
.1
-rm -rf gawk-ps-
$(REL
) gawk-ps-
$(REL
).
tar.z
dvips
-o
!cat gawk.
dvi > gawk-ps-
$(REL
)/gawk.postscript
pstroff
-man gawk
.1 > gawk-ps-
$(REL
)/gawk
.1.ps
tar -cf
- gawk-ps-
$(REL
) | gzip
> gawk-ps-
$(REL
).
tar.z
release
: dist gawk-doc-
$(REL
).
tar.z gawk-ps-
$(REL
).
tar.z