# /****************************************************************
# Copyright (C) Lucent Technologies 1997
# All Rights Reserved
# 
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that the copyright notice and this
# permission notice and warranty disclaimer appear in supporting
# documentation, and that the name Lucent Technologies or any of
# its entities not be used in advertising or publicity pertaining
# to distribution of the software without specific, written prior
# permission.
# 
# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
# ****************************************************************/
#	Copyright Daniel K. Allen, 1997-2003.
#
# 12 Aug 1997 - Ported to MPW by Dan Allen.
#  9 Nov 1997 - Updated for the 21 Aug 1997 version of awk.
# 13 Dec 1997 - Added gestalt calls to automatically do PPC or 68K builds.
#	25 Mar 1999 - Removed gestalt calls.  PPC is the future, sadly.
#  2 Jun 2000 - Added test target.
# 18 Apr 2001 - Sets version string.
# 20 Apr 2001 - Traceback symbols added to build.

CFLAGS = -w off -opt speed -typecheck relaxed -traceback
YACC = yacc
YFLAGS = -d
OFILES = b.c.o main.c.o parse.c.o proctab.c.o tran.c.o lib.c.o run.c.o lex.c.o missing95.c.o
LIBS = "{PPCLibraries}InterfaceLib" "{PPCLibraries}MathLib" "{PPCLibraries}StdCLib" "{PPCLibraries}StdCRuntime.o" "{PPCLibraries}PPCCRuntime.o" "{PPCLibraries}PPCToolLibs.o"

awk  awk.r
	Rez -o awk awk.r -a -t MPST -c 'MPS '
	SetVersion awk -t vers -sv 2 -sr 0 -stage release -verstring "awk 2.123 (18 Aug 2003)"  dev:null

awk  ytab.c.o {OFILES}
	PPCLink -o awk ytab.c.o {OFILES} {LIBS} -d
	SetFile awk -d . -m . -t MPST -c 'MPS '

proctab.c 	maketab
	maketab > proctab.c

maketab  maketab.c.o
	PPCLink -o maketab maketab.c.o {LIBS}
	SetFile maketab -d . -m . -t MPST -c 'MPS '

.c.o  .c
	MRC {Default}.c {CFLAGS}

{OFILES} lexyy.c.o  awk.h proto.h

clean 
	rm -i awk maketab proctab.c ytab.c.o maketab.c.o {OFILES} foo

test  awk
	awk -f cvt.awk < ports.txt > foo
	awk -f environ.awk
