This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 4.0 patch 9: patch #4, continued
[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 . || \
7e1cf235 8 ln -s ../config.sh . || \
8d063cd8
LW
9 ln ../../config.sh . || \
10 ln ../../../config.sh . || \
11 (echo "Can't find config.sh."; exit 1)
fe14fcc3 12 fi 2>/dev/null
378cc40b 13 . ./config.sh
8d063cd8
LW
14 ;;
15esac
a1cc2bdc
AR
16case "$mallocsrc" in
17'') ;;
18*) mallocsrc="../$mallocsrc";;
19esac
8d063cd8
LW
20echo "Extracting x2p/Makefile (with variable substitutions)"
21cat >Makefile <<!GROK!THIS!
d48672a2 22# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:12:14 $
8d063cd8
LW
23#
24# $Log: Makefile.SH,v $
d48672a2
LW
25# Revision 4.0.1.1 91/06/07 12:12:14 lwall
26# patch4: cflags now emits entire cc command except for the filename
27#
fe14fcc3
LW
28# Revision 4.0 91/03/20 01:57:03 lwall
29# 4.0 baseline.
8d063cd8
LW
30#
31#
32
33CC = $cc
d8f2e4cc 34YACC = $yacc
8d063cd8
LW
35bin = $bin
36lib = $lib
37mansrc = $mansrc
38manext = $manext
8d063cd8
LW
39LDFLAGS = $ldflags
40SMALL = $small
41LARGE = $large $split
a1cc2bdc
AR
42mallocsrc = $mallocsrc
43mallocobj = $mallocobj
8d063cd8 44
b6ccd89c 45libs = $libs
8d063cd8
LW
46!GROK!THIS!
47
48cat >>Makefile <<'!NO!SUBS!'
49
d48672a2
LW
50CCCMD = `sh cflags $@`
51
fe14fcc3 52public = a2p s2p find2perl
8d063cd8
LW
53
54private =
55
56manpages = a2p.man s2p.man
57
58util =
59
60sh = Makefile.SH makedepend.SH
61
62h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
63
a1cc2bdc 64c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 65
a1cc2bdc 66obj = hash.o $(mallocobj) str.o util.o walk.o
8d063cd8
LW
67
68lintflags = -phbvxac
69
70addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
71
72# grrr
73SHELL = /bin/sh
74
75.c.o:
d48672a2 76 $(CCCMD) $*.c
8d063cd8
LW
77
78all: $(public) $(private) $(util)
79 touch all
80
81a2p: $(obj) a2p.o
d48672a2 82 $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
8d063cd8
LW
83
84a2p.c: a2p.y
6eb13c3b 85 @ echo Expect 226 shift/reduce conflicts...
d8f2e4cc 86 $(YACC) a2p.y
8d063cd8
LW
87 mv y.tab.c a2p.c
88
b6ccd89c 89a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
d48672a2 90 $(CCCMD) $(LARGE) a2p.c
8d063cd8 91
8d063cd8
LW
92install: a2p s2p
93# won't work with csh
94 export PATH || exit 1
378cc40b 95 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
a687059c 96 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
8d063cd8
LW
97 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
98 cd $(bin); \
99for pub in $(public); do \
378cc40b 100chmod +x `basename $$pub`; \
8d063cd8 101done
8d063cd8
LW
102 - if test `pwd` != $(mansrc); then \
103for page in $(manpages); do \
104cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
105done; \
106fi
107
108clean:
5303340c 109 rm -f a2p *.o
8d063cd8 110
b6ccd89c 111realclean: clean
d48672a2 112 rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
8d063cd8
LW
113
114# The following lint has practically everything turned on. Unfortunately,
115# you have to wade through a lot of mumbo jumbo that can't be suppressed.
116# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
117# for that spot.
118
119lint:
120 lint $(lintflags) $(defs) $(c) > a2p.fuzz
121
122depend: ../makedepend
123 ../makedepend
124
125clist:
126 echo $(c) | tr ' ' '\012' >.clist
127
128hlist:
129 echo $(h) | tr ' ' '\012' >.hlist
130
131shlist:
132 echo $(sh) | tr ' ' '\012' >.shlist
133
03a14243
LW
134config.sh: ../config.sh
135 rm -f config.sh
136 ln ../config.sh .
137
8d063cd8
LW
138# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
139$(obj):
140 @ echo "You haven't done a "'"make depend" yet!'; exit 1
141makedepend: makedepend.SH
142 /bin/sh makedepend.SH
143!NO!SUBS!
144$eunicefix Makefile
145case `pwd` in
146*SH)
147 $rm -f ../Makefile
148 ln Makefile ../Makefile
149 ;;
150esac