# 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