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