1/*
2 * expression library
3 */
4
5:PACKAGE: ast
6
7LICENSE = since=1989,author=gsf
8
9CCFLAGS = $(CC.OPTIMIZE) $(CC.SUFFIX.DYNAMIC:@?$(CC.DLL)??)
10
11/* NOTE: --mam bug in -I for exparse.c if exparse.y not first */
12
13expr 2.0 :LIBRARY: RELEASE expr.h exlib.h exgram.h exparse.y \
14		excc.c excontext.c exdata.c exeval.c exexpr.c \
15		exerror.c exopen.c exrewind.c extoken.c extype.c \
16		exnospace.c exstash.c exzero.c
17
18/* internal compiler error: in gen_lowpart_general, at rtlhooks.c:59 */
19"*.i386*" :NOOPTIMIZE: exeval.c exzero.c
20
21exop.h : exparse.h
22	{
23	echo 'static const char* exop[] = {'
24	echo '	"MINTOKEN",'
25	$(SED) -e '1,/MINTOKEN/d' -e '/MAXTOKEN/,$d' -e 's/^[ 	]*//' -e 's/^#[ 	]*define[ 	]*//' -e 's/[= 	].*//' -e 's/.*/	"&",/'
26	echo '	"MAXTOKEN",'
27	echo '};'
28	} < $(*) > $(<)
29
30$(INCLUDEDIR) :INSTALLPROTO: expr.h
31
32$(INCLUDEDIR) :INSTALLDIR: exparse.h
33
34:YYPREFIX: ex ast.h exparse.y
35
36/*
37 * NOTE: the solaris yacc botches the yyact[] indices (large positive)
38 */
39
40YACC.BOTCH.PATTERN = ',[0-9][0-9][0-9][0-9][0-9]*,'
41
42YACC.BOTCH.FIX : .VIRTUAL .FORCE .AFTER
43	if	$(GREP) -c $(YACC.BOTCH.PATTERN) $(<<:N=*.c) >/dev/null
44	then	: $(YACC) is botched : yyact indices are bogus :
45		$(CP) $(<<:N=*.c:/^/O/:T=F) $(<<:N=*.c)
46		$(CP) $(<<:N=*.h:/^/O/:T=F) $(<<:N=*.h)
47	else	for i in $(<<:N=*.h) $(<<:N=*.c)
48		do	$(SED) -e '1i\
49/* : : generated by a yacc that works -- solaris take note : : */' -e '/^[ 	]*#[ 	]*[il][di][en][ne][t]*[ 	]["0-9].*/s,,/* & */,' -e '/^[ 	]*#[ 	]*include[ 	]*"exlib\.h"/i\
50#ifndef gettxt\
51#define gettxt(h,t)	(t)\
52#endif' $i > O$i
53		done
54	fi
55
56%.c %.h : %.y YACC.BOTCH.FIX
57
58:SAVE: Oexparse.c Oexparse.h
59