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