1/*
2 * NOTE: this provides ast enhanced versions of INIT executables
3 */
4
5:PACKAGE: ast
6
7LICENSE = since=1990,author=gsf
8
9.SOURCE.c : ../INIT ../../lib/libpp
10
11proto :: RELEASE PROMO.mm proto.c
12
13mamake :: mamake.c LICENSE=since=1999,author=gsf
14
15ratz :: ratz.c
16
17release :: release.c LICENSE=since=1999,author=gsf
18
19sear :: sear.sh LICENSE=since=2001,author=dgk+gsf
20
21changes :: changes.sh LICENSE=since=2005,author=gsf
22
23$(LIBDIR)/sear :INSTALLDIR: ratz.c sear.ico sear32.ico sear64.ico
24
25:TEST: proto
26
27/*
28 * ../INIT/proto.c is snarfed from the standalone src
29 * this is a gross hack to allow only one copy of the source
30 */
31
32if ! "$(-mam)"
33
34../INIT/proto.c :INSTALL: .SCAN.NULL proto.c
35	if	grep '^#pragma prototyped' $(*) >/dev/null 2>/dev/null
36	then	{
37		echo "#define __PROTO__(x) x"
38		echo "#define __MANGLE__"
39		$(SED) \
40		-e '/\/\*DELAY_CONTROL\*\//,/\/\*NODELAY_CONTROL\*\//s/^#/DELAY_CONTROL /' \
41		-e '/\/\*DELAY_CONTROL\*\//s/^/#define DELAY_CONTROL # \
42	#undef	__STDC__/' \
43		-e '/\/\*NODELAY_CONTROL\*\//s/^/#undef	DELAY_CONTROL /' \
44		$(*)
45		} > a.$(tmp).c
46		$(CPP) $(CPPFLAGS) -I$(INSTALLROOT)/include/ast -DPROTO_STANDALONE -D-F$(*) -D-L -I-D -E a.$(tmp).c |
47		$(SED) -e 's%".*/src/cmd/proto/%"%' -e 's%".*/src/cmd/%"../%' -e 's%".*/src/lib/%"../../lib/%' |
48		$(PROTO) $(PROTOFLAGS:N!=-s) -f > b.$(tmp).c
49		if	test '' != '$(<:P=L*:O=N)' && $(CMP) -s b.$(tmp).c $(<:P=L*:O=N)
50		then	: no changes for $(<) :
51		elif	$(CC) -o b.$(tmp).x b.$(tmp).c
52		then	$(CP) b.$(tmp).c $(<)
53		else	: retain original $(<) :
54		fi
55		$(RM) -f ?.$(tmp).?
56	fi
57
58end
59