perl 3.0 patch #28 (combined patch)
[p5sagit/p5-mst-13.2.git] / x2p / Makefile.SH
CommitLineData
a687059c 1case "$0" in
2*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
3esac
8d063cd8 4case $CONFIG in
5'')
6 if test ! -f config.sh; then
7 ln ../config.sh . || \
8 ln ../../config.sh . || \
9 ln ../../../config.sh . || \
10 (echo "Can't find config.sh."; exit 1)
11 fi
378cc40b 12 . ./config.sh
8d063cd8 13 ;;
14esac
a1cc2bdc 15case "$mallocsrc" in
16'') ;;
17*) mallocsrc="../$mallocsrc";;
18esac
8d063cd8 19echo "Extracting x2p/Makefile (with variable substitutions)"
20cat >Makefile <<!GROK!THIS!
6eb13c3b 21# $Header: Makefile.SH,v 3.0.1.5 90/08/13 22:41:05 lwall Locked $
8d063cd8 22#
23# $Log: Makefile.SH,v $
6eb13c3b 24# Revision 3.0.1.5 90/08/13 22:41:05 lwall
25# patch28: shift/reduce count was off for a2p's Makefile
26#
449aadca 27# Revision 3.0.1.4 90/03/01 10:28:09 lwall
28# patch9: a2p didn't allow logical expressions everywhere it should
29#
d8f2e4cc 30# Revision 3.0.1.3 89/12/21 20:29:00 lwall
31# patch7: Configure now lets you pick between yacc or bison
32#
0d3e774c 33# Revision 3.0.1.2 89/11/17 15:49:55 lwall
d8f2e4cc 34# patch: in x2p/Makefile.SH, removed reference to nm library
0d3e774c 35#
03a14243 36# Revision 3.0.1.1 89/10/26 23:29:11 lwall
37# patch1: in x2p/Makefile.SH, added dependency on ../config.sh
38#
a687059c 39# Revision 3.0 89/10/18 15:33:52 lwall
40# 3.0 baseline
41#
42# Revision 2.0.1.2 88/09/07 17:13:30 lwall
43# patch14: added redirection of stderr to /dev/null
44#
45# Revision 2.0.1.1 88/07/11 23:13:39 root
46# patch2: now expects more shift/reduce errors
47#
378cc40b 48# Revision 2.0 88/06/05 00:15:31 root
49# Baseline version 2.0.
8d063cd8 50#
51#
52
53CC = $cc
d8f2e4cc 54YACC = $yacc
8d063cd8 55bin = $bin
56lib = $lib
57mansrc = $mansrc
58manext = $manext
a687059c 59CFLAGS = $ccflags $optimize
8d063cd8 60LDFLAGS = $ldflags
61SMALL = $small
62LARGE = $large $split
a1cc2bdc 63mallocsrc = $mallocsrc
64mallocobj = $mallocobj
8d063cd8 65
0d3e774c 66libs = $libs -lm
8d063cd8 67!GROK!THIS!
68
69cat >>Makefile <<'!NO!SUBS!'
70
71public = a2p s2p
72
73private =
74
75manpages = a2p.man s2p.man
76
77util =
78
79sh = Makefile.SH makedepend.SH
80
81h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
82
a1cc2bdc 83c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 84
a1cc2bdc 85obj = hash.o $(mallocobj) str.o util.o walk.o
8d063cd8 86
87lintflags = -phbvxac
88
89addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
90
91# grrr
92SHELL = /bin/sh
93
94.c.o:
95 $(CC) -c $(CFLAGS) $(LARGE) $*.c
96
97all: $(public) $(private) $(util)
98 touch all
99
100a2p: $(obj) a2p.o
a687059c 101 $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
8d063cd8 102
103a2p.c: a2p.y
6eb13c3b 104 @ echo Expect 226 shift/reduce conflicts...
d8f2e4cc 105 $(YACC) a2p.y
8d063cd8 106 mv y.tab.c a2p.c
107
378cc40b 108a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
8d063cd8 109 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
110
8d063cd8 111install: a2p s2p
112# won't work with csh
113 export PATH || exit 1
378cc40b 114 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
a687059c 115 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
8d063cd8 116 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
117 cd $(bin); \
118for pub in $(public); do \
378cc40b 119chmod +x `basename $$pub`; \
8d063cd8 120done
378cc40b 121# chmod +x makedir
122# - ./makedir `filexp $(lib)`
8d063cd8 123# - \
124#if test `pwd` != `filexp $(lib)`; then \
125#cp $(private) `filexp $(lib)`; \
126#fi
127# cd `filexp $(lib)`; \
128#for priv in $(private); do \
378cc40b 129#chmod +x `basename $$priv`; \
8d063cd8 130#done
131 - if test `pwd` != $(mansrc); then \
132for page in $(manpages); do \
133cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
134done; \
135fi
136
137clean:
138 rm -f *.o
139
140realclean:
141 rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
142
143# The following lint has practically everything turned on. Unfortunately,
144# you have to wade through a lot of mumbo jumbo that can't be suppressed.
145# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
146# for that spot.
147
148lint:
149 lint $(lintflags) $(defs) $(c) > a2p.fuzz
150
151depend: ../makedepend
152 ../makedepend
153
154clist:
155 echo $(c) | tr ' ' '\012' >.clist
156
157hlist:
158 echo $(h) | tr ' ' '\012' >.hlist
159
160shlist:
161 echo $(sh) | tr ' ' '\012' >.shlist
162
03a14243 163config.sh: ../config.sh
164 rm -f config.sh
165 ln ../config.sh .
166
8d063cd8 167# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
168$(obj):
169 @ echo "You haven't done a "'"make depend" yet!'; exit 1
170makedepend: makedepend.SH
171 /bin/sh makedepend.SH
172!NO!SUBS!
173$eunicefix Makefile
174case `pwd` in
175*SH)
176 $rm -f ../Makefile
177 ln Makefile ../Makefile
178 ;;
179esac