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