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