Commit | Line | Data |
599a829f |
1 | #! /bin/sh |
2000072c |
2 | case $CONFIGDOTSH in |
2304df62 |
3 | '') |
4 | if 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 | elif test -f ../../../../config.sh; then TOP=../../../..; |
9 | else |
10 | echo "Can't find config.sh."; exit 1 |
11 | fi |
12 | . $TOP/config.sh |
13 | ;; |
14 | esac |
15 | : This forces SH files to create target in same directory as SH file. |
16 | : This is so that make depend always knows where to find SH derivatives. |
17 | case "$0" in |
18 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
19 | esac |
20 | |
2304df62 |
21 | case "$d_dosuid" in |
22 | *define*) suidperl='suidperl' ;; |
23 | *) suidperl='';; |
24 | esac |
25 | |
d5d19f97 |
26 | linklibperl='$(LIBPERL)' |
3c321fdc |
27 | shrpldflags='$(LDDLFLAGS)' |
6ee623d5 |
28 | ldlibpth='' |
d96ebe2e |
29 | case "$useshrplib" in |
30 | true) |
6ee623d5 |
31 | # Prefix all runs of 'miniperl' and 'perl' with |
5cf1d1f1 |
32 | # $ldlibpth so that ./perl finds *this* shared libperl. |
c1b49bc0 |
33 | case "$LD_LIBRARY_PATH" in |
34 | '') |
35 | ldlibpth="LD_LIBRARY_PATH=`pwd`";; |
36 | *) |
37 | ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";; |
38 | esac |
6ee623d5 |
39 | |
d5d19f97 |
40 | pldlflags="$cccdlflags" |
d96ebe2e |
41 | case "${osname}${osvers}" in |
42 | next4*) |
3c321fdc |
43 | ld=libtool |
44 | lddlflags="-dynamic -undefined warning -framework System \ |
45 | -compatibility_version 1 -current_version $patchlevel \ |
46 | -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@" |
6ee623d5 |
47 | ;; |
f556e5b9 |
48 | rhapsody*|darwin*) |
49 | shrpldflags="${ldflags} -dynamiclib \ |
50 | -compatibility_version 1 \ |
51 | -current_version \ |
52 | ${api_version}.${api_subversion} \ |
53 | -image_base 0x4be00000 \ |
54 | -install_name \$(shrpdir)/\$@" |
55 | ;; |
5cf1d1f1 |
56 | cygwin*) |
8736538c |
57 | linklibperl="-lperl" |
58 | ;; |
73d40b3e |
59 | sunos*) |
d5d19f97 |
60 | linklibperl="-lperl" |
61 | ;; |
43039de7 |
62 | netbsd*|freebsd[234]*|openbsd*) |
099685bc |
63 | linklibperl="-L. -lperl" |
64 | ;; |
3c321fdc |
65 | aix*) |
66 | shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" |
1553ab04 |
67 | case "$osvers" in |
549a6b10 |
68 | 3*) shrpldflags="$shrpldflags -e _nostart" |
1553ab04 |
69 | ;; |
549a6b10 |
70 | *) shrpldflags="$shrpldflags -b noentry" |
1553ab04 |
71 | ;; |
72 | esac |
9c839522 |
73 | shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib" |
549a6b10 |
74 | linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl" |
3c321fdc |
75 | ;; |
1c7d1a19 |
76 | hpux*) |
77 | linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl" |
46193409 |
78 | ;; |
655635e8 |
79 | esac |
5cf1d1f1 |
80 | case "$ldlibpthname" in |
81 | '') ;; |
82 | *) |
83 | case "$osname" in |
84 | os2) |
85 | ldlibpth='' |
86 | ;; |
5cf1d1f1 |
87 | *) |
88 | eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\"" |
89 | ;; |
90 | esac |
c1b49bc0 |
91 | # Strip off any trailing :'s |
92 | ldlibpth=`echo $ldlibpth | sed 's/:*$//'` |
5cf1d1f1 |
93 | ;; |
94 | esac |
d5d19f97 |
95 | ;; |
f0efd8cf |
96 | *) pldlflags='' |
d96ebe2e |
97 | ;; |
ecfc5424 |
98 | esac |
99 | |
a0d0e21e |
100 | : Prepare dependency lists for Makefile. |
101 | dynamic_list=' ' |
102 | for f in $dynamic_ext; do |
103 | : the dependency named here will never exist |
ecfc5424 |
104 | base=`echo "$f" | sed 's/.*\///'` |
75f92628 |
105 | dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext" |
a0d0e21e |
106 | done |
107 | |
108 | static_list=' ' |
a0d0e21e |
109 | for f in $static_ext; do |
110 | base=`echo "$f" | sed 's/.*\///'` |
cd4d8a96 |
111 | static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)" |
a0d0e21e |
112 | done |
113 | |
4318d5a0 |
114 | nonxs_list=' ' |
115 | for f in $nonxs_ext; do |
116 | base=`echo "$f" | sed 's/.*\///'` |
117 | nonxs_list="$nonxs_list ext/$f/pm_to_blib" |
118 | done |
119 | |
2304df62 |
120 | echo "Extracting Makefile (with variable substitutions)" |
655635e8 |
121 | $spitshell >Makefile <<!GROK!THIS! |
a0d0e21e |
122 | # Makefile.SH |
85e6fe83 |
123 | # This file is derived from Makefile.SH. Any changes made here will |
124 | # be lost the next time you run Configure. |
655635e8 |
125 | # Makefile is used to generate $firstmakefile. The only difference |
126 | # is that $firstmakefile has the dependencies filled in at the end. |
2304df62 |
127 | # |
fed7345c |
128 | # |
2304df62 |
129 | # I now supply perly.c with the kits, so don't remake perly.c without byacc |
130 | BYACC = $byacc |
131 | CC = $cc |
232e078e |
132 | LD = $ld |
16d20bd9 |
133 | |
2304df62 |
134 | LDFLAGS = $ldflags |
135 | CLDFLAGS = $ldflags |
85e6fe83 |
136 | |
2304df62 |
137 | mallocsrc = $mallocsrc |
138 | mallocobj = $mallocobj |
85e6fe83 |
139 | LNS = $lns |
2304df62 |
140 | RMS = rm -f |
85e6fe83 |
141 | ranlib = $ranlib |
142 | |
16d20bd9 |
143 | # The following are mentioned only to make metaconfig include the |
144 | # appropriate questions in Configure. If you want to change these, |
8e07c86e |
145 | # edit config.sh instead, or specify --man1dir=/wherever on |
16d20bd9 |
146 | # installman commandline. |
147 | bin = $installbin |
148 | scriptdir = $scriptdir |
d96ebe2e |
149 | shrpdir = $archlibexp/CORE |
16d20bd9 |
150 | privlib = $installprivlib |
151 | man1dir = $man1dir |
152 | man1ext = $man1ext |
153 | man3dir = $man3dir |
154 | man3ext = $man3ext |
155 | |
85e6fe83 |
156 | # The following are used to build and install shared libraries for |
157 | # dynamic loading. |
158 | LDDLFLAGS = $lddlflags |
3c321fdc |
159 | SHRPLDFLAGS = $shrpldflags |
85e6fe83 |
160 | CCDLFLAGS = $ccdlflags |
a0d0e21e |
161 | DLSUFFIX = .$dlext |
ecfc5424 |
162 | PLDLFLAGS = $pldlflags |
d96ebe2e |
163 | LIBPERL = $libperl |
d5d19f97 |
164 | LLIBPERL= $linklibperl |
ecfc5424 |
165 | SHRPENV = $shrpenv |
a0d0e21e |
166 | |
6ee623d5 |
167 | # The following is used to include the current directory in |
5cf1d1f1 |
168 | # the dynamic loader path you are building a shared libperl. |
6ee623d5 |
169 | LDLIBPTH = $ldlibpth |
170 | |
a0d0e21e |
171 | dynamic_ext = $dynamic_list |
172 | static_ext = $static_list |
4318d5a0 |
173 | nonxs_ext = $nonxs_list |
174 | ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext) |
cd4d8a96 |
175 | DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT) |
2304df62 |
176 | |
9c839522 |
177 | libs = $perllibs $cryptlib |
2304df62 |
178 | |
909b3858 |
179 | public = perl $suidperl utilities translators |
2304df62 |
180 | |
181 | shellflags = $shellflags |
182 | |
d96ebe2e |
183 | # This is set to MAKE=$make if your $make command doesn't |
184 | # do it for you. |
185 | $make_set_make |
4633a7c4 |
186 | |
dfe9444c |
187 | # These variables may need to be manually set for non-Unix systems. |
ccc7f9b3 |
188 | AR = $full_ar |
dfe9444c |
189 | EXE_EXT = $_exe |
190 | LIB_EXT = $_a |
191 | OBJ_EXT = $_o |
192 | PATH_SEP = $p_ |
4633a7c4 |
193 | |
194 | FIRSTMAKEFILE = $firstmakefile |
195 | |
196 | # Any special object files needed by this architecture, e.g. os2/os2.obj |
197 | ARCHOBJS = $archobjs |
198 | |
cd4d8a96 |
199 | .SUFFIXES: .c \$(OBJ_EXT) |
200 | |
d96ebe2e |
201 | # grrr |
202 | SHELL = $sh |
655635e8 |
203 | |
28e8609d |
204 | # how to tr(anslate) newlines |
205 | TRNL = '$trnl' |
206 | |
b7b35fc2 |
207 | # not used by Makefile but by installperl; |
208 | # mentioned here so that metaconfig picks it up |
209 | INSTALL_USR_BIN_PERL = $installusrbinperl |
210 | |
2304df62 |
211 | !GROK!THIS! |
212 | |
85e6fe83 |
213 | ## In the following dollars and backticks do not need the extra backslash. |
2304df62 |
214 | $spitshell >>Makefile <<'!NO!SUBS!' |
215 | |
d96ebe2e |
216 | CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@` |
2304df62 |
217 | |
fed7345c |
218 | private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm |
2304df62 |
219 | |
4633a7c4 |
220 | # Files to be built with variable substitution before miniperl |
221 | # is available. |
222 | sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \ |
4755096e |
223 | makedir.SH myconfig.SH writemain.SH pod/Makefile.SH |
4633a7c4 |
224 | |
3ebb1980 |
225 | shextract = Makefile cflags config.h makeaperl makedepend \ |
4755096e |
226 | makedir myconfig writemain pod/Makefile |
4633a7c4 |
227 | |
228 | # Files to be built with variable substitution after miniperl is |
229 | # available. Dependencies handled manually below (for now). |
2304df62 |
230 | |
efb12ca0 |
231 | pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \ |
4755096e |
232 | pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL \ |
233 | pod/buildtoc.PL |
4633a7c4 |
234 | |
4755096e |
235 | # lib/lib.pm is not listed here because it has a rule of its own. |
efb12ca0 |
236 | plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \ |
4755096e |
237 | pod/pod2usage pod/podchecker pod/podselect \ |
238 | pod/buildtoc |
4633a7c4 |
239 | |
4755096e |
240 | addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct |
2304df62 |
241 | |
fed7345c |
242 | h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h |
a0d0e21e |
243 | h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h |
6f4183fe |
244 | h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h |
219f41b1 |
245 | h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h |
4438c4b7 |
246 | h5 = utf8.h warnings.h |
33b839e2 |
247 | h = $(h1) $(h2) $(h3) $(h4) $(h5) |
2304df62 |
248 | |
e8edd1e6 |
249 | c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c |
a0ed51b3 |
250 | c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c |
09bef843 |
251 | c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c |
6f4183fe |
252 | c4 = globals.c perlio.c perlapi.c |
2304df62 |
253 | |
09bef843 |
254 | c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c |
2304df62 |
255 | |
e8edd1e6 |
256 | obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) |
cd4d8a96 |
257 | obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT) |
6f4183fe |
258 | obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) |
655635e8 |
259 | |
4633a7c4 |
260 | obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
2304df62 |
261 | |
a0d0e21e |
262 | # Once perl has been Configure'd and built ok you build different |
263 | # perl variants (Debugging, Embedded, Multiplicity etc) by saying: |
d96ebe2e |
264 | # make clean; make LIBPERL=libperl<type>.a |
a0d0e21e |
265 | # where <type> is some combination of 'd' and(or) 'e' or 'm'. |
266 | # See cflags to understand how this works. |
267 | # |
d96ebe2e |
268 | # This mechanism is getting clunky and might not even work any more. |
269 | # EMBEDDING is on by default, and MULTIPLICITY doesn't work. |
270 | # |
a0d0e21e |
271 | |
2304df62 |
272 | lintflags = -hbvxac |
273 | |
cd4d8a96 |
274 | .c$(OBJ_EXT): |
d96ebe2e |
275 | $(CCCMD) $(PLDLFLAGS) $*.c |
2304df62 |
276 | |
b1a1e9f1 |
277 | all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext) |
248e23d9 |
278 | @echo " "; |
279 | @echo " Everything is up to date. 'make test' to run test suite." |
909b3858 |
280 | |
6ee623d5 |
281 | compile: all |
282 | echo "testing compilation" > testcompile; |
283 | cd utils; $(MAKE) compile; |
284 | cd x2p; $(MAKE) compile; |
285 | cd pod; $(MAKE) compile; |
286 | |
909b3858 |
287 | translators: miniperl lib/Config.pm FORCE |
6ee623d5 |
288 | @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all |
8e07c86e |
289 | |
4755096e |
290 | utilities: miniperl lib/Config.pm $(plextract) lib/lib.pm FORCE |
6ee623d5 |
291 | @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all |
909b3858 |
292 | |
293 | |
16d20bd9 |
294 | # This is now done by installman only if you actually want the man pages. |
295 | # @echo " "; echo " Making docs"; cd pod; $(MAKE) all; |
85e6fe83 |
296 | |
297 | # Phony target to force checking subdirectories. |
e50aee73 |
298 | # Apparently some makes require an action for the FORCE target. |
85e6fe83 |
299 | FORCE: |
4633a7c4 |
300 | @sh -c true |
85e6fe83 |
301 | |
bd0dd1d8 |
302 | opmini$(OBJ_EXT): op.c |
0548b47c |
303 | $(RMS) opmini.c |
304 | $(LNS) op.c opmini.c |
305 | $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB opmini.c |
306 | $(RMS) opmini.c |
bd0dd1d8 |
307 | |
517e7c64 |
308 | miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h |
92c28edd |
309 | $(CCCMD) $(PLDLFLAGS) $*.c |
ecfc5424 |
310 | |
92c28edd |
311 | perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) |
e8827f64 |
312 | sh writemain $(DYNALOADER) $(static_ext) > writemain.tmp |
92c28edd |
313 | sh mv-if-diff writemain.tmp perlmain.c |
85e6fe83 |
314 | |
cd4d8a96 |
315 | perlmain$(OBJ_EXT): perlmain.c |
92c28edd |
316 | $(CCCMD) $(PLDLFLAGS) $*.c |
85e6fe83 |
317 | |
a0d0e21e |
318 | # The file ext.libs is a list of libraries that must be linked in |
319 | # for static extensions, e.g. -lm -lgdbm, etc. The individual |
320 | # static extension Makefile's add to it. |
fed7345c |
321 | ext.libs: $(static_ext) |
a0d0e21e |
322 | -@test -f ext.libs || touch ext.libs |
85e6fe83 |
323 | |
ecfc5424 |
324 | !NO!SUBS! |
599a829f |
325 | |
f561ce17 |
326 | # if test -f .patch ; then $spitshell >>Makefile <<'!NO!SUBS!' |
327 | # patchlevel.h: .patch |
328 | # perl fix_pl || (make -f Makefile.micro && ./microperl fix_pl) |
329 | # $(SHELL) Makefile.SH |
52ff2102 |
330 | # fi |
331 | # |
332 | # !NO!SUBS! |
517e7c64 |
333 | |
d96ebe2e |
334 | # How to build libperl. This is still rather convoluted. |
599a829f |
335 | # Load up custom Makefile.SH fragment for shared loading and executables: |
8736538c |
336 | case "$osname" in |
8736538c |
337 | *) |
338 | Makefile_s="$osname/Makefile.SHs" |
339 | ;; |
340 | esac |
341 | |
549a6b10 |
342 | case "$osname" in |
343 | aix) |
344 | $spitshell >>Makefile <<!GROK!THIS! |
9c839522 |
345 | LIBS = $perllibs |
5f9d9a17 |
346 | # In AIX we need to change this for building Perl itself from |
347 | # its earlier definition (which is for building external |
348 | # extensions *after* Perl has been built and installed) |
349 | CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'` |
549a6b10 |
350 | |
351 | !GROK!THIS! |
352 | case "$useshrplib" in |
353 | define|true|[yY]*) |
354 | $spitshell >>Makefile <<'!NO!SUBS!' |
355 | |
356 | LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT) |
357 | MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) |
358 | |
359 | $(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj) |
360 | $(RMS) $(LIBPERL_NONSHR) |
361 | $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj) |
362 | |
bd0dd1d8 |
363 | $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) |
a7089531 |
364 | $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \ |
365 | opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS) |
549a6b10 |
366 | |
367 | MINIPERLEXP = $(MINIPERL_NONSHR) |
368 | |
369 | LIBPERLEXPORT = perl.exp |
370 | |
371 | !NO!SUBS! |
372 | |
373 | ;; |
374 | *) |
375 | $spitshell >>Makefile <<'!NO!SUBS!' |
376 | MINIPERLEXP = miniperl$(EXE_EXT) |
377 | |
378 | PERLEXPORT = perl.exp |
379 | |
380 | !NO!SUBS! |
381 | ;; |
382 | esac |
383 | $spitshell >>Makefile <<'!NO!SUBS!' |
384 | perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) |
385 | ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp |
386 | sh mv-if-diff perl.exp.tmp perl.exp |
387 | |
388 | !NO!SUBS! |
389 | ;; |
2c2d71f5 |
390 | os2) |
391 | $spitshell >>Makefile <<'!NO!SUBS!' |
392 | MINIPERLEXP = miniperl |
393 | |
394 | perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map |
395 | ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp |
396 | sh mv-if-diff perl.exp.tmp perl5.def |
397 | |
398 | !NO!SUBS! |
399 | ;; |
549a6b10 |
400 | esac |
401 | |
8736538c |
402 | if test -r $Makefile_s ; then |
403 | . $Makefile_s |
d96ebe2e |
404 | $spitshell >>Makefile <<!GROK!THIS! |
cd4d8a96 |
405 | |
8736538c |
406 | Makefile: $Makefile_s |
cd4d8a96 |
407 | !GROK!THIS! |
408 | else |
f0efd8cf |
409 | $spitshell >>Makefile <<'!NO!SUBS!' |
549a6b10 |
410 | $(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT) |
9c9e9f08 |
411 | !NO!SUBS! |
d96ebe2e |
412 | case "$useshrplib" in |
413 | true) |
414 | $spitshell >>Makefile <<'!NO!SUBS!' |
3c321fdc |
415 | $(LD) $(SHRPLDFLAGS) -o $@ perl$(OBJ_EXT) $(obj) |
416 | !NO!SUBS! |
417 | case "$osname" in |
418 | aix) |
419 | $spitshell >>Makefile <<'!NO!SUBS!' |
28e8609d |
420 | rm -f libperl$(OBJ_EXT) |
3c321fdc |
421 | mv $@ libperl$(OBJ_EXT) |
422 | $(AR) qv $(LIBPERL) libperl$(OBJ_EXT) |
ecfc5424 |
423 | !NO!SUBS! |
3c321fdc |
424 | ;; |
425 | esac |
d96ebe2e |
426 | ;; |
427 | *) |
428 | $spitshell >>Makefile <<'!NO!SUBS!' |
429 | rm -f $(LIBPERL) |
430 | $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj) |
431 | @$(ranlib) $(LIBPERL) |
655635e8 |
432 | !NO!SUBS! |
d96ebe2e |
433 | ;; |
434 | esac |
599a829f |
435 | $spitshell >>Makefile <<'!NO!SUBS!' |
436 | |
437 | # How to build executables. |
438 | |
439 | # The $& notation tells Sequent machines that it can do a parallel make, |
440 | # and is harmless otherwise. |
441 | # The miniperl -w -MExporter line is a basic cheap test to catch errors |
442 | # before make goes on to run preplibrary and then MakeMaker on extensions. |
443 | # This is very handy because later errors are often caused by miniperl |
444 | # build problems but that's not obvious to the novice. |
445 | # The Module used here must not depend on Config or any extensions. |
446 | |
ecfb2188 |
447 | !NO!SUBS! |
448 | |
449 | case "${osname}${osvers}" in |
535d2540 |
450 | next4*) |
ecfb2188 |
451 | $spitshell >>Makefile <<'!NO!SUBS!' |
bd0dd1d8 |
452 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) |
ecfb2188 |
453 | $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ |
454 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs) |
bd0dd1d8 |
455 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 |
456 | !NO!SUBS! |
457 | ;; |
535d2540 |
458 | aix*) |
459 | $spitshell >>Makefile <<'!NO!SUBS!' |
460 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) |
461 | $(CC) -o miniperl $(CLDFLAGS) \ |
462 | `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ |
463 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs) |
464 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
465 | !NO!SUBS! |
466 | ;; |
ecfb2188 |
467 | *) |
468 | $spitshell >>Makefile <<'!NO!SUBS!' |
bd0dd1d8 |
469 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) |
5869b1f1 |
470 | $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \ |
a7089531 |
471 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs) |
bd0dd1d8 |
472 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 |
473 | !NO!SUBS! |
474 | ;; |
475 | esac |
476 | |
477 | $spitshell >>Makefile <<'!NO!SUBS!' |
599a829f |
478 | |
549a6b10 |
479 | perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
5869b1f1 |
480 | $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f |
481 | |
549a6b10 |
482 | pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
5869b1f1 |
483 | $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f |
484 | |
549a6b10 |
485 | purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
5869b1f1 |
486 | $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
dbadb36a |
487 | |
549a6b10 |
488 | quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
5869b1f1 |
489 | $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 |
490 | |
491 | # This version, if specified in Configure, does ONLY those scripts which need |
492 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" |
493 | # checks as well as the special code to validate that the script in question |
494 | # has been invoked correctly. |
495 | |
549a6b10 |
496 | suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
5869b1f1 |
497 | $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 |
498 | |
599a829f |
499 | !NO!SUBS! |
500 | |
501 | fi |
502 | |
503 | $spitshell >>Makefile <<'!NO!SUBS!' |
504 | |
cd4d8a96 |
505 | sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h) |
2304df62 |
506 | $(RMS) sperl.c |
85e6fe83 |
507 | $(LNS) perl.c sperl.c |
d96ebe2e |
508 | $(CCCMD) -DIAMSUID sperl.c |
2304df62 |
509 | $(RMS) sperl.c |
510 | |
fec02dd3 |
511 | # We have to call our ./makedir because Ultrix 4.3 make can't handle the line |
512 | # test -d lib/auto || mkdir lib/auto |
513 | # |
8374d37a |
514 | preplibrary: miniperl lib/Config.pm |
cd4d8a96 |
515 | @sh ./makedir lib/auto |
a0d0e21e |
516 | @echo " AutoSplitting perl library" |
92c28edd |
517 | $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \ |
518 | autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm |
2304df62 |
519 | |
75f92628 |
520 | # Take care to avoid modifying lib/Config.pm without reason |
fb73857a |
521 | # (If trying to create a new port and having problems with the configpm script, |
522 | # try 'make minitest' and/or commenting out the tests at the end of configpm.) |
06605284 |
523 | lib/Config.pm: config.sh miniperl configpm lib/re.pm |
e8827f64 |
524 | $(LDLIBPTH) ./miniperl configpm configpm.tmp |
92c28edd |
525 | sh mv-if-diff configpm.tmp $@ |
2304df62 |
526 | |
92c28edd |
527 | lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm |
e8827f64 |
528 | $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp |
92c28edd |
529 | sh mv-if-diff minimod.tmp $@ |
fed7345c |
530 | |
92c28edd |
531 | lib/re.pm: ext/re/re.pm |
ceb0239c |
532 | rm -f $@ |
92c28edd |
533 | cat ext/re/re.pm > $@ |
7cfc0d09 |
534 | |
06605284 |
535 | $(plextract): miniperl lib/Config.pm |
92c28edd |
536 | $(LDLIBPTH) ./miniperl -Ilib $@.PL |
72b3d9b4 |
537 | |
4755096e |
538 | lib/lib.pm: miniperl lib/Config.pm |
539 | $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL |
540 | |
b1a1e9f1 |
541 | extra.pods: miniperl |
fec93702 |
542 | -@test -f extra.pods && rm -f `cat extra.pods` |
72b3d9b4 |
543 | -@rm -f extra.pods |
b4bc034f |
544 | -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \ |
72b3d9b4 |
545 | nx=`echo $$x | sed -e "s/README\.//"`; \ |
40096396 |
546 | cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \ |
72b3d9b4 |
547 | echo "pod/perl"$$nx".pod" >> extra.pods ; \ |
548 | done |
40096396 |
549 | -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods |
72b3d9b4 |
550 | |
f556e5b9 |
551 | install-strip: |
552 | $(MAKE) STRIPFLAGS=-s install |
553 | |
4ad019ef |
554 | install: |
c458b76c |
555 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) |
c77385cf |
556 | |
4ad019ef |
557 | install-verbose: |
558 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V |
c458b76c |
559 | |
4ad019ef |
560 | install-silent: |
8d0b2130 |
561 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S |
4ad019ef |
562 | |
563 | no-install: |
564 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n |
16d20bd9 |
565 | |
b1a1e9f1 |
566 | install.perl: all installperl |
6ee623d5 |
567 | if [ -n "$(COMPILE)" ]; \ |
568 | then \ |
569 | cd utils; $(MAKE) compile; \ |
570 | cd ../x2p; $(MAKE) compile; \ |
571 | cd ../pod; $(MAKE) compile; \ |
83673e1f |
572 | else :; \ |
6ee623d5 |
573 | fi |
c77385cf |
574 | $(LDLIBPTH) ./perl installperl $(INSTALLFLAGS) $(STRIPFLAGS) |
a0d0e21e |
575 | |
b1a1e9f1 |
576 | install.man: all installman |
c77385cf |
577 | $(LDLIBPTH) ./perl installman $(INSTALLFLAGS) |
16d20bd9 |
578 | |
84902520 |
579 | # XXX Experimental. Hardwired values, but useful for testing. |
580 | # Eventually Configure could ask for some of these values. |
581 | install.html: all installhtml |
40096396 |
582 | -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd .. |
6ee623d5 |
583 | $(LDLIBPTH) ./perl installhtml \ |
84902520 |
584 | --podroot=. --podpath=. --recurse \ |
585 | --htmldir=$(privlib)/html \ |
586 | --htmlroot=$(privlib)/html \ |
587 | --splithead=pod/perlipc \ |
588 | --splititem=pod/perlfunc \ |
589 | --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \ |
590 | --verbose |
591 | |
16d20bd9 |
592 | |
a0d0e21e |
593 | # I now supply perly.c with the kits, so the following section is |
56febc5e |
594 | # used only if you force byacc to run by saying |
595 | # make run_byacc |
596 | # Since we patch up the byacc output, the perly.fixer script needs |
597 | # to run with precisely the same version of byacc as I use. You |
598 | # normally shouldn't remake perly.[ch]. |
599 | |
232e078e |
600 | run_byacc: FORCE |
56febc5e |
601 | $(BYACC) -d perly.y |
28f14321 |
602 | -chmod 664 perly.c |
56febc5e |
603 | sh $(shellflags) ./perly.fixer y.tab.c perly.c |
55497cff |
604 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
605 | -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
ebb99254 |
606 | sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h |
55497cff |
607 | cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h |
fb73857a |
608 | chmod 664 vms/perly_c.vms vms/perly_h.vms |
609 | perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms |
56febc5e |
610 | |
611 | # We don't want to regenerate perly.c and perly.h, but they might |
612 | # appear out-of-date after a patch is applied or a new distribution is |
613 | # made. |
92c28edd |
614 | perly.c: perly.y |
b233458b |
615 | -@sh -c true |
616 | |
92c28edd |
617 | perly.h: perly.y |
b233458b |
618 | -@sh -c true |
619 | |
bd656b61 |
620 | # No compat3.sym here since and including the 5.004_50. |
e4d5a464 |
621 | # No interp.sym since 5.005_03. |
22c35a8c |
622 | SYM = global.sym globvar.sym perlio.sym pp.sym |
419eaf7b |
623 | |
22c35a8c |
624 | SYMH = perlvars.h intrpvar.h thrdvar.h |
419eaf7b |
625 | |
dae78bb1 |
626 | CHMOD_W = chmod +w |
627 | |
a8581515 |
628 | # The following files are generated automatically |
c83f8f39 |
629 | # keywords.pl: keywords.h |
630 | # opcode.pl: opcode.h opnames.h pp_proto.h pp.sym |
631 | # [* embed.pl needs pp.sym generated by opcode.pl! *] |
632 | # embed.pl: proto.h embed.h embedvar.h global.sym objXSUB.h |
633 | # perlapi.h perlapi.c pod/perlintern.pod |
634 | # pod/perlapi.pod |
635 | # bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c |
636 | # ext/B/B/Asmdata.pm |
637 | # regcomp.pl: regnodes.h |
638 | # warnings.pl: warnings.h lib/warnings.pm |
e50aee73 |
639 | # The correct versions should be already supplied with the perl kit, |
640 | # in case you don't have perl available. |
e1354ed6 |
641 | # To force them to be regenerated, type |
e50aee73 |
642 | # make regen_headers |
e1354ed6 |
643 | |
b4d4469a |
644 | AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \ |
645 | embed.h embedvar.h global.sym \ |
646 | pod/perlintern.pod pod/perlapi.pod \ |
c83f8f39 |
647 | objXSUB.h perlapi.h perlapi.c ext/ByteLoader/byterun.h \ |
648 | ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \ |
649 | warnings.h lib/warnings.pm |
e1354ed6 |
650 | |
e50aee73 |
651 | regen_headers: FORCE |
b4d4469a |
652 | -$(CHMOD_W) $(AUTOGEN_FILES) |
653 | -perl keywords.pl |
654 | -perl opcode.pl |
655 | -perl embed.pl |
656 | -perl bytecode.pl |
657 | -perl regcomp.pl |
658 | -perl warnings.pl |
8e07c86e |
659 | |
4755096e |
660 | regen_pods: FORCE |
661 | -cd pod; $(LDLIBPTH) make regen_pods |
662 | |
a0d0e21e |
663 | # Extensions: |
4318d5a0 |
664 | # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will |
665 | # automatically get built. There should ordinarily be no need to change |
666 | # any of this part of makefile. |
a0d0e21e |
667 | # |
668 | # The dummy dependency is a place holder in case $(dynamic_ext) or |
669 | # $(static_ext) is empty. |
670 | # |
671 | # DynaLoader may be needed for extensions that use Makefile.PL. |
672 | |
673 | $(DYNALOADER): miniperl preplibrary FORCE |
92c28edd |
674 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e |
675 | |
676 | d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE |
92c28edd |
677 | @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e |
678 | |
679 | s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE |
92c28edd |
680 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
2304df62 |
681 | |
4318d5a0 |
682 | n_dummy $(nonxs_ext): miniperl preplibrary $(DYNALOADER) FORCE |
92c28edd |
683 | @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
4318d5a0 |
684 | |
17b893d8 |
685 | clean: _tidy _mopup |
70af249b |
686 | |
2edbd6da |
687 | realclean: _realcleaner _mopup |
4e2a5f63 |
688 | @echo "Note that make realclean does not delete config.sh or Policy.sh" |
70af249b |
689 | |
b37ebb13 |
690 | _clobber: |
4e2a5f63 |
691 | rm -f config.sh cppstdin Policy.sh |
b37ebb13 |
692 | |
693 | clobber: _realcleaner _mopup _clobber |
70af249b |
694 | |
695 | distclean: clobber |
696 | |
2edbd6da |
697 | # Like distclean but also removes emacs backups and *.orig. |
b37ebb13 |
698 | veryclean: _verycleaner _mopup _clobber |
699 | -@rm -f Obsolete Wanted |
2edbd6da |
700 | |
70af249b |
701 | # Do not 'make _mopup' directly. |
702 | _mopup: |
cd4d8a96 |
703 | rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c |
72b3d9b4 |
704 | -@test -f extra.pods && rm -f `cat extra.pods` |
b4bc034f |
705 | -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod |
ac83e8b0 |
706 | -rm -f perl.exp ext.libs extra.pods opmini.o |
d96ebe2e |
707 | -rm -f perl.export perl.dll perl.libexp perl.map perl.def |
1cfa4ec7 |
708 | -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap |
e708dd94 |
709 | rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl |
70af249b |
710 | |
711 | # Do not 'make _tidy' directly. |
712 | _tidy: |
e3f83878 |
713 | -cd pod; $(LDLIBPTH) $(MAKE) clean |
714 | -cd utils; $(LDLIBPTH) $(MAKE) clean |
715 | -cd x2p; $(LDLIBPTH) $(MAKE) clean |
4318d5a0 |
716 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
e3f83878 |
717 | $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \ |
a0d0e21e |
718 | done |
6ee623d5 |
719 | rm -f testcompile compilelog |
ff68c719 |
720 | |
2edbd6da |
721 | _cleaner1: |
4633a7c4 |
722 | -cd os2; rm -f Makefile |
2edbd6da |
723 | -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) |
724 | -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) |
725 | -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) |
4318d5a0 |
726 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
2edbd6da |
727 | $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \ |
a0d0e21e |
728 | done |
2edbd6da |
729 | |
730 | _cleaner2: |
9fba8746 |
731 | rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) |
a0d0e21e |
732 | rm -rf $(addedbyconf) |
cd4d8a96 |
733 | rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old |
fed7345c |
734 | rm -f $(private) |
a0d0e21e |
735 | rm -rf lib/auto |
181ea953 |
736 | rm -f lib/.exists lib/*/.exists |
16d20bd9 |
737 | rm -f h2ph.man pstruct |
a0d0e21e |
738 | rm -rf .config |
6ee623d5 |
739 | rm -f testcompile compilelog |
9e1f4cb5 |
740 | -rmdir lib/B lib/Data lib/Encode lib/IO/Socket lib/IO lib/Sys lib/Thread |
ecfc5424 |
741 | |
2edbd6da |
742 | _realcleaner: |
743 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean |
744 | @$(LDLIBPTH) $(MAKE) _cleaner2 |
745 | |
746 | _verycleaner: |
747 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean |
748 | @$(LDLIBPTH) $(MAKE) _cleaner2 |
c94787a5 |
749 | -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig |
2edbd6da |
750 | |
2304df62 |
751 | # The following lint has practically everything turned on. Unfortunately, |
752 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. |
753 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message |
754 | # for that spot. |
755 | |
756 | lint: perly.c $(c) |
757 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz |
758 | |
fb73857a |
759 | # Need to unset during recursion to go out of loop. |
760 | # The README below ensures that the dependency list is never empty and |
761 | # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding. |
cd4d8a96 |
762 | |
84902520 |
763 | MAKEDEPEND = Makefile makedepend |
cd4d8a96 |
764 | |
fb73857a |
765 | $(FIRSTMAKEFILE): README $(MAKEDEPEND) |
cd4d8a96 |
766 | $(MAKE) depend MAKEDEPEND= |
a0d0e21e |
767 | |
599a829f |
768 | config.h: config_h.SH config.sh |
655635e8 |
769 | $(SHELL) config_h.SH |
770 | |
a0d0e21e |
771 | # When done, touch perlmain.c so that it doesn't get remade each time. |
2304df62 |
772 | depend: makedepend |
fb73857a |
773 | sh ./makedepend MAKE=$(MAKE) |
a0d0e21e |
774 | - test -s perlmain.c && touch perlmain.c |
2304df62 |
775 | cd x2p; $(MAKE) depend |
776 | |
cd4d8a96 |
777 | # Cannot postpone this until $firstmakefile is ready ;-) |
92c28edd |
778 | makedepend: makedepend.SH config.sh |
779 | sh ./makedepend.SH |
cd4d8a96 |
780 | |
d6a255e6 |
781 | # Cannot delegate rebuilding of t/perl to make to allow interlaced |
782 | # test and minitest |
783 | test-prep: miniperl perl preplibrary utilities $(dynamic_ext) $(nonxs_ext) $(TEST_PERL_DLL) |
3e3baf6d |
784 | cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT)) |
785 | |
994e9bc0 |
786 | # Second branch is for testing without a tty or controling terminal. |
787 | # See t/op/stat.t |
3e3baf6d |
788 | test check: test-prep |
994e9bc0 |
789 | if (true </dev/tty) >/dev/null 2>&1; then \ |
790 | cd t && $(LDLIBPTH) ./perl TEST </dev/tty; \ |
791 | else \ |
792 | cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST; \ |
793 | fi |
9fba8746 |
794 | @echo "Ran tests" > t/rantests |
3e3baf6d |
795 | |
a0ed51b3 |
796 | utest ucheck: test-prep |
994e9bc0 |
797 | if (true </dev/tty) >/dev/null 2>&1; then \ |
798 | cd t && $(LDLIBPTH) ./perl UTEST </dev/tty; \ |
799 | else \ |
800 | cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl UTEST; \ |
801 | fi |
a0ed51b3 |
802 | |
3e3baf6d |
803 | # For testing without a tty or controling terminal. See t/op/stat.t |
804 | test-notty: test-prep |
6ee623d5 |
805 | cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST |
2304df62 |
806 | |
d96ebe2e |
807 | # Can't depend on lib/Config.pm because that might be where miniperl |
808 | # is crashing. |
a35c6d74 |
809 | minitest: miniperl lib/re.pm |
d96ebe2e |
810 | @echo "You may see some irrelevant test failures if you have been unable" |
811 | @echo "to build lib/Config.pm." |
cd4d8a96 |
812 | - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \ |
6ee623d5 |
813 | && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t </dev/tty |
16d20bd9 |
814 | |
fb73857a |
815 | # Handy way to run perlbug -ok without having to install and run the |
84902520 |
816 | # installed perlbug. We don't re-run the tests here - we trust the user. |
fb73857a |
817 | # Please *don't* use this unless all tests pass. |
1d2dff63 |
818 | # If you want to report test failures, use "make nok" instead. |
188cd53f |
819 | ok: utilities |
92c28edd |
820 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' |
84902520 |
821 | |
105f9295 |
822 | okfile: utilities |
92c28edd |
823 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok |
105f9295 |
824 | |
1d2dff63 |
825 | nok: utilities |
92c28edd |
826 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' |
1d2dff63 |
827 | |
b4e8cfaf |
828 | nokfile: utilities |
829 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok |
830 | |
85e6fe83 |
831 | clist: $(c) |
92c28edd |
832 | echo $(c) | tr ' ' $(TRNL) >.clist |
2304df62 |
833 | |
85e6fe83 |
834 | hlist: $(h) |
92c28edd |
835 | echo $(h) | tr ' ' $(TRNL) >.hlist |
2304df62 |
836 | |
85e6fe83 |
837 | shlist: $(sh) |
92c28edd |
838 | echo $(sh) | tr ' ' $(TRNL) >.shlist |
2304df62 |
839 | |
4633a7c4 |
840 | pllist: $(pl) |
92c28edd |
841 | echo $(pl) | tr ' ' $(TRNL) >.pllist |
4633a7c4 |
842 | |
92c28edd |
843 | Makefile: Makefile.SH ./config.sh |
844 | $(SHELL) Makefile.SH |
760ac839 |
845 | |
599a829f |
846 | distcheck: FORCE |
760ac839 |
847 | perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' |
848 | |
771c4874 |
849 | elc: emacs/cperl-mode.elc |
850 | |
851 | emacs/cperl-mode.elc: emacs/cperl-mode.el |
852 | -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el |
853 | |
d6a255e6 |
854 | etags: TAGS |
855 | |
856 | TAGS: emacs/cperl-mode.elc |
3ee700d1 |
857 | sh emacs/ptags |
01e22528 |
858 | |
d6a255e6 |
859 | ctags: tags |
860 | |
861 | # Let's hope make will not go into an infinite loop on case-unsensitive systems |
862 | # This may also fail if . is in the head of the path, since perl will |
863 | # require -Ilib |
864 | tags: TAGS |
865 | perl emacs/e2ctags.pl TAGS > tags |
3ee700d1 |
866 | |
2304df62 |
867 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
868 | # If this runs make out of memory, delete /usr/include lines. |
869 | !NO!SUBS! |
870 | |
85e6fe83 |
871 | $eunicefix Makefile |
2304df62 |
872 | case `pwd` in |
873 | *SH) |
85e6fe83 |
874 | $rm -f ../Makefile |
cd4d8a96 |
875 | $ln Makefile ../Makefile |
2304df62 |
876 | ;; |
877 | esac |
cd4d8a96 |
878 | $rm -f $firstmakefile |
5ff3f7a4 |
879 | |
880 | # Now do any special processing required before building. |
881 | |
882 | case "$ebcdic" in |
883 | $define) |
884 | xxx='' |
885 | echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 |
7a66b286 |
886 | case "$osname" in |
25e9a2e3 |
887 | os390|posix-bc) |
5ff3f7a4 |
888 | rm -f y.tab.c y.tab.h |
e9d08790 |
889 | # yacc must be a reentrant ("pure") Bison in BS2000 Posix! |
5ff3f7a4 |
890 | yacc -d perly.y >/dev/null 2>&1 |
891 | if cmp -s y.tab.c perly.c; then |
892 | rm -f y.tab.c |
893 | else |
894 | echo "perly.y -> perly.c" >&2 |
895 | mv -f y.tab.c perly.c |
896 | chmod u+w perly.c |
c8dba6f3 |
897 | sed -e '/^#include "perl\.h"/a\ |
898 | \ |
899 | #define yydebug PL_yydebug\ |
900 | #define yynerrs PL_yynerrs\ |
901 | #define yyerrflag PL_yyerrflag\ |
902 | #define yychar PL_yychar\ |
c8dba6f3 |
903 | #define yyval PL_yyval\ |
904 | #define yylval PL_yylval' \ |
905 | -e '/YYSTYPE *yyval;/D' \ |
906 | -e '/YYSTYPE *yylval;/D' \ |
907 | -e '/int yychar,/,/yynerrs;/D' \ |
908 | -e 's/int yydebug = 0;/yydebug = 0;/' \ |
909 | -e 's/[^_]realloc(/PerlMem_realloc(/g' \ |
910 | -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
5ff3f7a4 |
911 | -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
912 | xxx="$xxx perly.c" |
913 | fi |
914 | if cmp -s y.tab.h perly.h; then |
915 | rm -f y.tab.h |
916 | else |
917 | echo "perly.y -> perly.h" >&2 |
918 | mv -f y.tab.h perly.h |
919 | xxx="$xxx perly.h" |
920 | fi |
e9d08790 |
921 | if cd x2p |
5ff3f7a4 |
922 | then |
e9d08790 |
923 | rm -f y.tab.c y.tab.h |
5928ee40 |
924 | case "$osname" in |
925 | posix-bc) |
926 | # we are using two different yaccs in BS2000 Posix! |
927 | byacc a2p.y >/dev/null 2>&1 |
928 | ;; |
929 | *) # e.g. os390 |
930 | yacc a2p.y >/dev/null 2>&1 |
931 | ;; |
932 | esac |
e9d08790 |
933 | if cmp -s y.tab.c a2p.c |
934 | then |
935 | rm -f y.tab.c |
936 | else |
937 | echo "a2p.y -> a2p.c" >&2 |
938 | mv -f y.tab.c a2p.c |
939 | chmod u+w a2p.c |
940 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
941 | -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
942 | xxx="$xxx a2p.c" |
943 | fi |
944 | # In case somebody yacc -d:ed the a2p.y. |
945 | if test -f y.tab.h |
946 | then |
947 | if cmp -s y.tab.h a2p.h |
948 | then |
949 | rm -f y.tab.h |
950 | else |
951 | echo "a2p.h -> a2p.h" >&2 |
952 | mv -f y.tab.h a2p.h |
953 | xxx="$xxx a2p.h" |
954 | fi |
955 | fi |
956 | cd .. |
5ff3f7a4 |
957 | fi |
7a66b286 |
958 | ;; |
959 | vmesa) |
960 | # Do nothing in VM/ESA. |
961 | ;; |
aa34f189 |
962 | *) |
e9d08790 |
963 | echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
aa34f189 |
964 | ;; |
fe572743 |
965 | esac |
5ff3f7a4 |
966 | case "$xxx" in |
967 | '') echo "No parser files were regenerated. That's okay." >&2 ;; |
968 | esac |
969 | ;; |
970 | esac |
971 | |