Commit | Line | Data |
---|---|---|
2304df62 AD |
1 | case $CONFIG in |
2 | '') | |
3 | if test -f config.sh; then TOP=.; | |
4 | elif test -f ../config.sh; then TOP=..; | |
5 | elif test -f ../../config.sh; then TOP=../..; | |
6 | elif test -f ../../../config.sh; then TOP=../../..; | |
7 | elif test -f ../../../../config.sh; then TOP=../../../..; | |
8 | else | |
9 | echo "Can't find config.sh."; exit 1 | |
10 | fi | |
11 | . $TOP/config.sh | |
12 | ;; | |
13 | esac | |
14 | : This forces SH files to create target in same directory as SH file. | |
15 | : This is so that make depend always knows where to find SH derivatives. | |
16 | case "$0" in | |
17 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
18 | esac | |
19 | ||
20 | case "$d_symlink" in | |
21 | *define*) sln='ln -s' ;; | |
22 | *) sln='ln';; | |
23 | esac | |
24 | ||
25 | case "$d_dosuid" in | |
26 | *define*) suidperl='suidperl' ;; | |
27 | *) suidperl='';; | |
28 | esac | |
29 | ||
30 | echo "Extracting Makefile (with variable substitutions)" | |
31 | : This section of the file will have variable substitutions done on it. | |
32 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. | |
33 | : Protect any dollar signs and backticks that you do not want interpreted | |
34 | : by putting a backslash in front. You may delete these comments. | |
35 | $spitshell >Makefile <<!GROK!THIS! | |
36 | # : Makefile.SH,v 15738Revision: 4.1 15738Date: 92/08/07 17:18:08 $ | |
37 | # | |
38 | # $Log: Makefile.SH,v $ | |
39 | # Revision 4.1 92/08/07 17:18:08 lwall | |
40 | # Stage 6 Snapshot | |
41 | # | |
42 | # Revision 4.0.1.4 92/06/08 11:40:43 lwall | |
43 | # patch20: cray didn't give enough memory to /bin/sh | |
44 | # patch20: various and sundry fixes | |
45 | # | |
46 | # Revision 4.0.1.3 91/11/05 15:48:11 lwall | |
47 | # patch11: saberized perl | |
48 | # patch11: added support for dbz | |
49 | # | |
50 | # Revision 4.0.1.2 91/06/07 10:14:43 lwall | |
51 | # patch4: cflags now emits entire cc command except for the filename | |
52 | # patch4: alternate make programs are now semi-supported | |
53 | # patch4: uperl.o no longer tries to link in libraries prematurely | |
54 | # patch4: installperl now installs x2p stuff too | |
55 | # | |
56 | # Revision 4.0.1.1 91/04/11 17:30:39 lwall | |
57 | # patch1: C flags are now settable on a per-file basis | |
58 | # | |
59 | # Revision 4.0 91/03/20 00:58:54 lwall | |
60 | # 4.0 baseline. | |
61 | # | |
62 | # | |
63 | ||
64 | # I now supply perly.c with the kits, so don't remake perly.c without byacc | |
65 | BYACC = $byacc | |
66 | CC = $cc | |
67 | bin = $installbin | |
68 | scriptdir = $scriptdir | |
69 | privlib = $installprivlib | |
70 | mansrc = $mansrc | |
71 | manext = $manext | |
72 | LDFLAGS = $ldflags | |
73 | CLDFLAGS = $ldflags | |
74 | SMALL = $small | |
75 | LARGE = $large $split | |
76 | mallocsrc = $mallocsrc | |
77 | mallocobj = $mallocobj | |
78 | dlsrc = $dlsrc | |
79 | dlobj = $dlobj | |
80 | SLN = $sln | |
81 | RMS = rm -f | |
82 | ||
83 | libs = $libs $cryptlib | |
84 | ||
85 | public = perl $suidperl | |
86 | ||
87 | shellflags = $shellflags | |
88 | ||
89 | # To use an alternate make, set $altmake in config.sh. | |
90 | MAKE = ${altmake-make} | |
91 | !GROK!THIS! | |
92 | ||
93 | : In the following dollars and backticks do not need the extra backslash. | |
94 | $spitshell >>Makefile <<'!NO!SUBS!' | |
95 | ||
96 | CCCMD = `sh $(shellflags) cflags $@` | |
97 | ||
98 | private = | |
99 | ||
100 | scripts = h2ph | |
101 | ||
102 | manpages = perl.man h2ph.man | |
103 | ||
104 | util = | |
105 | ||
106 | sh = Makefile.SH makedepend.SH h2ph.SH | |
107 | ||
108 | h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h | |
109 | h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h | |
110 | ||
111 | h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h | |
112 | h2 = embed.h form.h gv.h handy.h hv.h hvdbm.h keywords.h mg.h op.h | |
113 | h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h | |
114 | h4 = regexp.h scope.h sv.h unixish.h util.h | |
115 | h = $(h1) $(h2) $(h3) $(h4) | |
116 | ||
117 | c1 = av.c scope.c op.c doop.c doio.c dump.c hv.c | |
118 | c2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c | |
119 | c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c | |
120 | ||
121 | c = $(c1) $(c2) $(c3) | |
122 | ||
123 | s1 = av.c scope.c op.c doop.c doio.c dump.c hv.c | |
124 | s2 = $(mallocobj) mg.c perly.c pp.c regcomp.c regexec.c | |
125 | s3 = gv.c sv.c taint.c toke.c util.c deb.c run.c perly.c | |
126 | ||
127 | saber = $(s1) $(s2) $(s3) | |
128 | ||
129 | obj1 = av.o scope.o op.o doop.o doio.o dump.o hv.o | |
130 | obj2 = $(mallocobj) mg.o perly.o pp.o regcomp.o regexec.o | |
131 | obj3 = gv.o sv.o taint.o toke.o util.o deb.o run.o | |
132 | ||
133 | obj = $(obj1) $(obj2) $(obj3) $(dlobj) | |
134 | ||
135 | lintflags = -hbvxac | |
136 | ||
137 | addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 | |
138 | ||
139 | # grrr | |
140 | SHELL = /bin/sh | |
141 | ||
142 | .SUFFIXES: .x | |
143 | ||
144 | .c.o: | |
145 | $(CCCMD) $*.c | |
146 | ||
147 | .x.c: | |
148 | sh writemain $*.x >$*.c | |
149 | ||
150 | all: miniperl perl lib/Config.pm | |
151 | ||
152 | #all: $(public) $(private) $(util) $(scripts) | |
153 | # cd x2p; $(MAKE) all | |
154 | # touch all | |
155 | !NO!SUBS! | |
156 | ### | |
157 | ### Boilerplate for all the .xs files in the ext directory. | |
158 | ### XXX FIXME: At some point we also need to copy .pm files out of | |
159 | ### XXX the ext directory into lib. | |
160 | # Configure sets extensions to a string like | |
161 | # "ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs \ | |
162 | # ext/dbm/SDBM_File.xs ext/posix/POSIX.xs" | |
163 | extobjs=" " | |
164 | for f in $extensions | |
165 | do | |
166 | base=`basename $f .xs` | |
167 | dir=`dirname $f` | |
168 | extobjs="$extobjs $f.o" | |
169 | $spitshell >>Makefile <<!GROK!THIS! | |
170 | ||
171 | # $base extension | |
172 | $base.c: $f ext/xsubpp ext/typemap | |
173 | test -f miniperl || make miniperl | |
174 | ext/xsubpp $f >tmp | |
175 | mv tmp $base.c | |
176 | ||
177 | $base.o: $base.c | |
178 | !GROK!THIS! | |
179 | ||
180 | case $base in | |
181 | SDBM_File) $spitshell >>Makefile <<'!NO!SUBS!' | |
182 | ||
183 | lib/auto/SDBM_File/SDBM_File.so: SDBM_File.o ext/dbm/sdbm/libsdbm.a | |
184 | @- mkdir lib/auto/SDBM_File 2>/dev/null | |
185 | ld -o lib/auto/SDBM_File/SDBM_File.so SDBM_File.o ext/dbm/sdbm/libsdbm.a | |
186 | ||
187 | ext/dbm/sdbm/libsdbm.a: ext/dbm/sdbm/sdbm.c ext/dbm/sdbm/sdbm.h | |
188 | cd ext/dbm/sdbm; $(MAKE) sdbm | |
189 | !NO!SUBS! | |
190 | ;; | |
191 | POSIX) $spitshell >>Makefile <<'!NO!SUBS!' | |
192 | lib/auto/POSIX/POSIX.so: POSIX.o ext/dbm/sdbm/libsdbm.a | |
193 | @- mkdir lib/auto/POSIX 2>/dev/null | |
194 | ld -o lib/auto/POSIX/POSIX.so POSIX.o ext/dbm/sdbm/libsdbm.a | |
195 | !NO!SUBS! | |
196 | ;; | |
197 | esac | |
198 | done | |
199 | ||
200 | echo "extobjs=$extobjs" >> Makefile | |
201 | ||
202 | $spitshell >>Makefile <<'!NO!SUBS!' | |
203 | # The $& notation tells Sequent machines that it can do a parallel make, | |
204 | # and is harmless otherwise. | |
205 | ||
206 | miniperlmain.c: miniperlmain.x | |
207 | miniperlmain.o: miniperlmain.c | |
208 | miniperl: $& miniperlmain.o perl.o $(obj) | |
209 | $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o perl.o $(obj) $(libs) | |
210 | ||
211 | perlmain.c: perlmain.x | |
212 | perlmain.o: perlmain.c | |
213 | perl: $& perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o | |
214 | $(CC) $(LARGE) $(CLDFLAGS) -o perl perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o $(libs) | |
215 | ||
216 | libperl.rlb: libperl.a | |
217 | ranlib libperl.a | |
218 | touch libperl.rlb | |
219 | ||
220 | libperl.a: $& perl.o $(obj) | |
221 | ar rcuv libperl.a $(obj) | |
222 | ||
223 | # This version, if specified in Configure, does ONLY those scripts which need | |
224 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" | |
225 | # checks as well as the special code to validate that the script in question | |
226 | # has been invoked correctly. | |
227 | ||
228 | suidperl: $& sperl.o main.o libperl.rlb | |
229 | $(CC) $(LARGE) $(CLDFLAGS) sperl.o main.o libperl.a $(libs) -o suidperl | |
230 | ||
231 | lib/Config.pm: config.sh | |
232 | ./configpm | |
233 | ||
234 | saber: $(saber) | |
235 | # load $(saber) | |
236 | # load /lib/libm.a | |
237 | ||
238 | sperl.o: perl.c perly.h patchlevel.h $(h) | |
239 | $(RMS) sperl.c | |
240 | $(SLN) perl.c sperl.c | |
241 | $(CCCMD) -DIAMSUID sperl.c | |
242 | $(RMS) sperl.c | |
243 | ||
244 | dl.o: ext/dl/dl.c | |
245 | cp ext/dl/dl.c dl.c | |
246 | $(CC) -c dl.c | |
247 | ||
248 | !NO!SUBS! | |
249 | ||
250 | ### Now on to the rest of the Makefile. | |
251 | $spitshell >>Makefile <<'!NO!SUBS!' | |
252 | ||
253 | perly.h: perly.c | |
254 | @ echo Dummy dependency for dumb parallel make | |
255 | touch perly.h | |
256 | ||
257 | opcode.h: opcode.pl | |
258 | - opcode.pl | |
259 | ||
260 | embed.h: embed_h.SH global.sym interp.sym | |
261 | sh embed_h.SH | |
262 | ||
263 | perly.c: | |
264 | @ echo 'Expect' 80 shift/reduce and 62 reduce/reduce conflicts | |
265 | $(BYACC) -d perly.y | |
266 | sh $(shellflags) ./perly.fixer y.tab.c perly.c | |
267 | mv y.tab.h perly.h | |
268 | echo 'extern YYSTYPE yylval;' >>perly.h | |
269 | ||
270 | perly.o: perly.c perly.h $(h) | |
271 | $(CCCMD) perly.c | |
272 | ||
273 | install: all | |
274 | ./perl installperl | |
275 | ||
276 | clean: | |
277 | rm -f *.o all perl taintperl suidperl miniperl | |
278 | cd x2p; $(MAKE) clean | |
279 | ||
280 | realclean: clean | |
281 | cd x2p; $(MAKE) realclean | |
282 | rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man | |
283 | rm -f perly.h t/perl Makefile config.h makedepend makedir | |
284 | rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags | |
285 | rm -f c2ph pstruct | |
286 | ||
287 | # The following lint has practically everything turned on. Unfortunately, | |
288 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. | |
289 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message | |
290 | # for that spot. | |
291 | ||
292 | lint: perly.c $(c) | |
293 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz | |
294 | ||
295 | depend: makedepend | |
296 | - test -f perly.h || cp /dev/null perly.h | |
297 | ./makedepend | |
298 | - test -s perly.h || /bin/rm -f perly.h | |
299 | cd x2p; $(MAKE) depend | |
300 | ||
301 | test: perl | |
302 | - cd t && chmod +x TEST */*.t | |
303 | - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty | |
304 | ||
305 | clist: | |
306 | echo $(c) | tr ' ' '\012' >.clist | |
307 | ||
308 | hlist: | |
309 | echo $(h) | tr ' ' '\012' >.hlist | |
310 | ||
311 | shlist: | |
312 | echo $(sh) | tr ' ' '\012' >.shlist | |
313 | ||
314 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE | |
315 | # If this runs make out of memory, delete /usr/include lines. | |
316 | !NO!SUBS! | |
317 | ||
318 | $eunicefix Makefile4 | |
319 | case `pwd` in | |
320 | *SH) | |
321 | $rm -f ../Makefile4 | |
322 | ln Makefile4 ../Makefile4 | |
323 | ;; | |
324 | esac | |
325 | rm -f makefile |