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