source: trunk/third/perl/Makefile.SH @ 9055

Revision 9055, 8.9 KB checked in by ghudson, 28 years ago (diff)
Communicate DESTDIR to installperl.
Line 
1case $CONFIG in
2'')
3    if test ! -f config.sh; then
4        ln ../config.sh . || \
5        ln ../../config.sh . || \
6        ln ../../../config.sh . || \
7        (echo "Can't find config.sh."; exit 1)
8    fi 2>/dev/null
9    . ./config.sh
10    ;;
11esac
12case "$0" in
13*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
14esac
15
16case "$d_symlink" in
17*define*) sln='ln -s' ;;
18*) sln='ln';;
19esac
20
21case "$d_dosuid" in
22*define*) suidperl='suidperl' ;;
23*) suidperl='';;
24esac
25
26echo "Extracting Makefile (with variable substitutions)"
27rm -f Makefile
28cat >Makefile <<!GROK!THIS!
29# $RCSfile: Makefile.SH,v $$Revision: 1.2 $$Date: 1996-10-05 18:28:05 $
30#
31# $Log: not supported by cvs2svn $
32# Revision 1.1.1.1  1996/10/02 06:39:56  ghudson
33# Import of perl 4.036
34#
35# Revision 4.0.1.4  92/06/08  11:40:43  lwall
36# patch20: cray didn't give enough memory to /bin/sh
37# patch20: various and sundry fixes
38#
39# Revision 4.0.1.3  91/11/05  15:48:11  lwall
40# patch11: saberized perl
41# patch11: added support for dbz
42#
43# Revision 4.0.1.2  91/06/07  10:14:43  lwall
44# patch4: cflags now emits entire cc command except for the filename
45# patch4: alternate make programs are now semi-supported
46# patch4: uperl.o no longer tries to link in libraries prematurely
47# patch4: installperl now installs x2p stuff too
48#
49# Revision 4.0.1.1  91/04/11  17:30:39  lwall
50# patch1: C flags are now settable on a per-file basis
51#
52# Revision 4.0  91/03/20  00:58:54  lwall
53# 4.0 baseline.
54#
55#
56
57CC = $cc
58YACC = $yacc
59bin = $installbin
60scriptdir = $scriptdir
61privlib = $installprivlib
62mansrc = $mansrc
63manext = $manext
64LDFLAGS = $ldflags
65CLDFLAGS = $ldflags
66SMALL = $small
67LARGE = $large $split
68mallocsrc = $mallocsrc
69mallocobj = $mallocobj
70SLN = $sln
71RMS = rm -f
72
73libs = $libs $cryptlib
74
75public = perl taintperl $suidperl
76
77shellflags = $shellflags
78
79# To use an alternate make, set $altmake in config.sh.
80MAKE = ${altmake-make}
81
82!GROK!THIS!
83
84cat >>Makefile <<'!NO!SUBS!'
85
86CCCMD = `sh $(shellflags) cflags $@`
87
88private =
89
90scripts = h2ph
91
92manpages = perl.man h2ph.man
93
94util =
95
96sh = Makefile.SH makedepend.SH h2ph.SH
97
98h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
99h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
100
101h = $(h1) $(h2)
102
103c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
104c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
105c3 = stab.c str.c toke.c util.c usersub.c
106
107c = $(c1) $(c2) $(c3)
108
109s1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
110s2 = eval.c form.c hash.c perl.c regcomp.c regexec.c
111s3 = stab.c str.c toke.c util.c usersub.c perly.c
112
113saber = $(s1) $(s2) $(s3)
114
115obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
116obj2 = eval.o form.o $(mallocobj) perl.o regcomp.o regexec.o
117obj3 = stab.o str.o toke.o util.o
118
119obj = $(obj1) $(obj2) $(obj3)
120
121tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
122tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
123tobj3 = tstab.o tstr.o ttoke.o tutil.o
124
125tobj = $(tobj1) $(tobj2) $(tobj3)
126
127lintflags = -hbvxac
128
129addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
130
131# grrr
132SHELL = /bin/sh
133
134.c.o:
135        $(CCCMD) $*.c
136
137all: $(public) $(private) $(util) uperl.o $(scripts)
138        cd x2p; $(MAKE) all
139        touch all
140
141# This is the standard version that contains no "taint" checks and is
142# used for all scripts that aren't set-id or running under something set-id.
143# The $& notation is tells Sequent machines that it can do a parallel make,
144# and is harmless otherwise.
145
146perl: $& perly.o $(obj) hash.o usersub.o
147        $(CC) $(LARGE) $(CLDFLAGS) $(obj) hash.o perly.o usersub.o $(libs) -o perl
148
149# This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
150
151dbzperl: $& perly.o $(obj) zhash.o usersub.o
152        $(CC) $(LARGE) $(CLDFLAGS) $(obj) zhash.o /usr/lib/dbz.o perly.o usersub.o $(libs) -o dbzperl
153
154zhash.o: hash.c $(h)
155        $(RMS) zhash.c
156        $(SLN) hash.c zhash.c
157        $(CCCMD) -DWANT_DBZ zhash.c
158        $(RMS) zhash.c
159
160uperl.o: $& perly.o $(obj) hash.o
161        -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o
162
163saber: $(saber)
164        # load $(saber)
165        # load /lib/libm.a
166
167# This version, if specified in Configure, does ONLY those scripts which need
168# set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
169# checks as well as the special code to validate that the script in question
170# has been invoked correctly.
171
172suidperl: $& tperly.o sperl.o $(tobj) usersub.o
173        $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
174            -o suidperl
175
176# This version interprets scripts that are already set-id either via a wrapper
177# or through the kernel allowing set-id scripts (bad idea).  Taintperl must
178# NOT be setuid to root or anything else.  The only difference between it
179# and normal perl is the presence of the "taint" checks.
180
181taintperl: $& tperly.o tperl.o $(tobj) usersub.o
182        $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
183            -o taintperl
184
185# Replicating all this junk is yucky, but I don't see a portable way to fix it.
186
187tperly.o: perly.c perly.h $(h)
188        $(RMS) tperly.c
189        $(SLN) perly.c tperly.c
190        $(CCCMD) -DTAINT tperly.c
191        $(RMS) tperly.c
192
193tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
194        $(RMS) tperl.c
195        $(SLN) perl.c tperl.c
196        $(CCCMD) -DTAINT tperl.c
197        $(RMS) tperl.c
198
199sperl.o: perl.c perly.h patchlevel.h $(h)
200        $(RMS) sperl.c
201        $(SLN) perl.c sperl.c
202        $(CCCMD) -DTAINT -DIAMSUID sperl.c
203        $(RMS) sperl.c
204
205tarray.o: array.c $(h)
206        $(RMS) tarray.c
207        $(SLN) array.c tarray.c
208        $(CCCMD) -DTAINT tarray.c
209        $(RMS) tarray.c
210
211tcmd.o: cmd.c $(h)
212        $(RMS) tcmd.c
213        $(SLN) cmd.c tcmd.c
214        $(CCCMD) -DTAINT tcmd.c
215        $(RMS) tcmd.c
216
217tcons.o: cons.c $(h) perly.h
218        $(RMS) tcons.c
219        $(SLN) cons.c tcons.c
220        $(CCCMD) -DTAINT tcons.c
221        $(RMS) tcons.c
222
223tconsarg.o: consarg.c $(h)
224        $(RMS) tconsarg.c
225        $(SLN) consarg.c tconsarg.c
226        $(CCCMD) -DTAINT tconsarg.c
227        $(RMS) tconsarg.c
228
229tdoarg.o: doarg.c $(h)
230        $(RMS) tdoarg.c
231        $(SLN) doarg.c tdoarg.c
232        $(CCCMD) -DTAINT tdoarg.c
233        $(RMS) tdoarg.c
234
235tdoio.o: doio.c $(h)
236        $(RMS) tdoio.c
237        $(SLN) doio.c tdoio.c
238        $(CCCMD) -DTAINT tdoio.c
239        $(RMS) tdoio.c
240
241tdolist.o: dolist.c $(h)
242        $(RMS) tdolist.c
243        $(SLN) dolist.c tdolist.c
244        $(CCCMD) -DTAINT tdolist.c
245        $(RMS) tdolist.c
246
247tdump.o: dump.c $(h)
248        $(RMS) tdump.c
249        $(SLN) dump.c tdump.c
250        $(CCCMD) -DTAINT tdump.c
251        $(RMS) tdump.c
252
253teval.o: eval.c $(h)
254        $(RMS) teval.c
255        $(SLN) eval.c teval.c
256        $(CCCMD) -DTAINT teval.c
257        $(RMS) teval.c
258
259tform.o: form.c $(h)
260        $(RMS) tform.c
261        $(SLN) form.c tform.c
262        $(CCCMD) -DTAINT tform.c
263        $(RMS) tform.c
264
265thash.o: hash.c $(h)
266        $(RMS) thash.c
267        $(SLN) hash.c thash.c
268        $(CCCMD) -DTAINT thash.c
269        $(RMS) thash.c
270
271tregcomp.o: regcomp.c $(h)
272        $(RMS) tregcomp.c
273        $(SLN) regcomp.c tregcomp.c
274        $(CCCMD) -DTAINT tregcomp.c
275        $(RMS) tregcomp.c
276
277tregexec.o: regexec.c $(h)
278        $(RMS) tregexec.c
279        $(SLN) regexec.c tregexec.c
280        $(CCCMD) -DTAINT tregexec.c
281        $(RMS) tregexec.c
282
283tstab.o: stab.c $(h)
284        $(RMS) tstab.c
285        $(SLN) stab.c tstab.c
286        $(CCCMD) -DTAINT tstab.c
287        $(RMS) tstab.c
288
289tstr.o: str.c $(h) perly.h
290        $(RMS) tstr.c
291        $(SLN) str.c tstr.c
292        $(CCCMD) -DTAINT tstr.c
293        $(RMS) tstr.c
294
295ttoke.o: toke.c $(h) perly.h
296        $(RMS) ttoke.c
297        $(SLN) toke.c ttoke.c
298        $(CCCMD) -DTAINT ttoke.c
299        $(RMS) ttoke.c
300
301tutil.o: util.c $(h)
302        $(RMS) tutil.c
303        $(SLN) util.c tutil.c
304        $(CCCMD) -DTAINT tutil.c
305        $(RMS) tutil.c
306
307perly.h: perly.c
308        @ echo Dummy dependency for dumb parallel make
309        touch perly.h
310
311perly.c: perly.y perly.fixer
312        @ \
313case "$(YACC)" in \
314    *bison*) echo 'Expect' 25 shift/reduce and 59 reduce/reduce conflicts;; \
315    *) echo 'Expect' 27 shift/reduce and 57 reduce/reduce conflicts;; \
316esac
317        $(YACC) -d perly.y
318        sh $(shellflags) ./perly.fixer y.tab.c perly.c
319        mv y.tab.h perly.h
320        echo 'extern YYSTYPE yylval;' >>perly.h
321
322perly.o: perly.c perly.h $(h)
323        $(CCCMD) perly.c
324
325install: all
326        DESTDIR=${DESTDIR} ./perl installperl
327
328clean:
329        rm -f *.o all perl taintperl suidperl perly.c
330        cd x2p; $(MAKE) clean
331
332realclean: clean
333        cd x2p; $(MAKE) realclean
334        rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
335        rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
336        rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
337        rm -f c2ph pstruct
338
339# The following lint has practically everything turned on.  Unfortunately,
340# you have to wade through a lot of mumbo jumbo that can't be suppressed.
341# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
342# for that spot.
343
344lint: perly.c $(c)
345        lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
346
347depend: makedepend
348        - test -f perly.h || cp /dev/null perly.h
349        ./makedepend
350        - test -s perly.h || /bin/rm -f perly.h
351        cd x2p; $(MAKE) depend
352
353test: perl
354        - cd t && chmod +x TEST */*.t
355        - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty
356
357clist:
358        echo $(c) | tr ' ' '\012' >.clist
359
360hlist:
361        echo $(h) | tr ' ' '\012' >.hlist
362
363shlist:
364        echo $(sh) | tr ' ' '\012' >.shlist
365
366# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
367$(obj) hash.o:
368        @ echo "You haven't done a "'"make depend" yet!'; exit 1
369makedepend: makedepend.SH
370        /bin/sh $(shellflags) makedepend.SH
371!NO!SUBS!
372$eunicefix Makefile
373case `pwd` in
374*SH)
375    $rm -f ../Makefile
376    ln Makefile ../Makefile
377    ;;
378esac
379rm -f makefile
Note: See TracBrowser for help on using the repository browser.