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