Commit | Line | Data |
---|---|---|
1f00b0d6 S |
1 | #!/bin/sh |
2 | ||
a02608de | 3 | case $PERL_CONFIG_SH in |
2304df62 | 4 | '') |
66b99216 JH |
5 | if test -f config.sh |
6 | then TOP=. | |
2304df62 AD |
7 | else |
8 | echo "Can't find config.sh."; exit 1 | |
9 | fi | |
10 | . $TOP/config.sh | |
11 | ;; | |
12 | esac | |
761ee4e8 | 13 | |
5a20539c VK |
14 | case $CROSS_NAME in |
15 | '') | |
16 | Makefile=Makefile | |
17 | ;; | |
18 | *) | |
19 | # if cross-compilation, the Makefile named accordingly | |
20 | Makefile=Makefile-cross-$CROSS_NAME | |
21 | . Cross/config-${CROSS_NAME}.sh | |
22 | ;; | |
23 | esac | |
24 | ||
2304df62 AD |
25 | : This forces SH files to create target in same directory as SH file. |
26 | : This is so that make depend always knows where to find SH derivatives. | |
27 | case "$0" in | |
28 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
29 | esac | |
30 | ||
d5d19f97 | 31 | linklibperl='$(LIBPERL)' |
fe5460cc | 32 | linklibperl_nonshr='' |
3c321fdc | 33 | shrpldflags='$(LDDLFLAGS)' |
6ee623d5 | 34 | ldlibpth='' |
ac9901e0 | 35 | DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB' |
bf799c64 | 36 | DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL' |
d96ebe2e | 37 | case "$useshrplib" in |
38 | true) | |
f4db5405 | 39 | # Prefix all runs of 'miniperl' and 'perl' with |
5cf1d1f1 | 40 | # $ldlibpth so that ./perl finds *this* shared libperl. |
c1b49bc0 GS |
41 | case "$LD_LIBRARY_PATH" in |
42 | '') | |
43 | ldlibpth="LD_LIBRARY_PATH=`pwd`";; | |
44 | *) | |
45 | ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";; | |
46 | esac | |
6ee623d5 | 47 | |
d5d19f97 | 48 | pldlflags="$cccdlflags" |
07f3cc2a | 49 | static_ldflags='' |
d96ebe2e | 50 | case "${osname}${osvers}" in |
51 | next4*) | |
3c321fdc | 52 | ld=libtool |
53 | lddlflags="-dynamic -undefined warning -framework System \ | |
54 | -compatibility_version 1 -current_version $patchlevel \ | |
55 | -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@" | |
6ee623d5 | 56 | ;; |
f556e5b9 JH |
57 | rhapsody*|darwin*) |
58 | shrpldflags="${ldflags} -dynamiclib \ | |
c1e7a127 W |
59 | -compatibility_version \ |
60 | ${api_revision}.${api_version}.${api_subversion} \ | |
f556e5b9 | 61 | -current_version \ |
c1e7a127 | 62 | ${revision}.${patchlevel}.${subversion} \ |
f556e5b9 JH |
63 | -install_name \$(shrpdir)/\$@" |
64 | ;; | |
5cf1d1f1 | 65 | cygwin*) |
5f9145a3 RU |
66 | shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000" |
67 | linklibperl="-L. -lperl" | |
8736538c | 68 | ;; |
73d40b3e | 69 | sunos*) |
d5d19f97 UP |
70 | linklibperl="-lperl" |
71 | ;; | |
a774dfe6 | 72 | netbsd*|freebsd[234]*|openbsd*|dragonfly*) |
099685bc JH |
73 | linklibperl="-L. -lperl" |
74 | ;; | |
0c52c6a9 TV |
75 | interix*) |
76 | linklibperl="-L. -lperl" | |
77 | shrpldflags="$shrpldflags -Wl,--image-base,0x57000000" | |
78 | ;; | |
3c321fdc | 79 | aix*) |
21efc957 RT |
80 | case "$cc" in |
81 | gcc*) | |
82 | shrpldflags="-shared -Wl,-H512 -Wl,-T512 -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-bE:perl.exp" | |
83 | case "$osvers" in | |
84 | 3*) shrpldflags="$shrpldflags -e _nostart" | |
85 | ;; | |
86 | *) shrpldflags="$shrpldflags -Wl,-bnoentry" | |
87 | ;; | |
88 | esac | |
89 | shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib" | |
90 | linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl" | |
fe5460cc | 91 | linklibperl_nonshr='-lperl_nonshr' |
1553ab04 | 92 | ;; |
21efc957 RT |
93 | *) |
94 | shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" | |
95 | case "$osvers" in | |
96 | 3*) shrpldflags="$shrpldflags -e _nostart" | |
97 | ;; | |
98 | *) shrpldflags="$shrpldflags -b noentry" | |
99 | ;; | |
100 | esac | |
101 | shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib" | |
102 | linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl" | |
fe5460cc | 103 | linklibperl_nonshr='-lperl_nonshr' |
1553ab04 TB |
104 | ;; |
105 | esac | |
3c321fdc | 106 | ;; |
1c7d1a19 GS |
107 | hpux*) |
108 | linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl" | |
46193409 | 109 | ;; |
ac9901e0 | 110 | os390*) |
4144573e | 111 | shrpldflags='-W l,XPLINK,dll' |
ac9901e0 PP |
112 | linklibperl='libperl.x' |
113 | DPERL_EXTERNAL_GLOB='' | |
114 | ;; | |
655635e8 | 115 | esac |
5cf1d1f1 JH |
116 | case "$ldlibpthname" in |
117 | '') ;; | |
118 | *) | |
119 | case "$osname" in | |
120 | os2) | |
121 | ldlibpth='' | |
122 | ;; | |
5cf1d1f1 JH |
123 | *) |
124 | eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\"" | |
125 | ;; | |
126 | esac | |
c1b49bc0 GS |
127 | # Strip off any trailing :'s |
128 | ldlibpth=`echo $ldlibpth | sed 's/:*$//'` | |
5cf1d1f1 JH |
129 | ;; |
130 | esac | |
ecfc5424 | 131 | |
9b9c6f34 AE |
132 | case "$ldlibpth" in |
133 | # Protect any spaces | |
134 | *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;; | |
135 | esac | |
6904989c | 136 | |
9b9c6f34 AE |
137 | case "$osname" in |
138 | linux) | |
830717a7 AD |
139 | # If there is a pre-existing $libperl from a previous |
140 | # installation, Linux needs to use LD_PRELOAD to | |
141 | # override the LD_LIBRARY_PATH setting. See the | |
142 | # INSTALL file, under "Building a shared perl library". | |
143 | # If there is no pre-existing $libperl, we don't need | |
144 | # to do anything further. | |
145 | if test -f $archlib/CORE/$libperl; then | |
68e8d60a | 146 | rm -f preload |
d0ae58a5 | 147 | cat <<'EOT' > preload |
fde91635 JH |
148 | #! /bin/sh |
149 | lib=$1 | |
150 | shift | |
151 | test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD" | |
152 | exec "$@" | |
153 | EOT | |
9b9c6f34 AE |
154 | chmod 755 preload |
155 | ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl" | |
830717a7 AD |
156 | fi |
157 | ;; | |
9b9c6f34 AE |
158 | os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth" |
159 | ;; | |
60d79001 | 160 | esac |
9b9c6f34 | 161 | |
60d79001 | 162 | ;; |
9b9c6f34 AE |
163 | |
164 | *) pldlflags='' | |
07f3cc2a | 165 | static_ldflags='CCCDLFLAGS=' |
b1f5ad7d JH |
166 | ;; |
167 | esac | |
168 | ||
de4c0096 TC |
169 | : is Cwd static or dynamic |
170 | static_cwd='define' | |
04718b47 | 171 | list_util_dep='$(PERL_EXE)' |
de4c0096 TC |
172 | for f in $dynamic_ext; do |
173 | case $f in | |
174 | Cwd) static_cwd='undef' ;; | |
04718b47 | 175 | List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext |
de4c0096 TC |
176 | esac |
177 | done | |
178 | ||
a0d0e21e LW |
179 | : Prepare dependency lists for Makefile. |
180 | dynamic_list=' ' | |
ec81ed5d | 181 | dynamic_ext_re="lib/auto/re/re.$dlext" |
1179df5f | 182 | extra_dep=' |
635c6126 | 183 | ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib cpan/Pod-Escapes/pm_to_blib pod/perlfunc.pod |
1179df5f | 184 | ' |
a0d0e21e LW |
185 | for f in $dynamic_ext; do |
186 | : the dependency named here will never exist | |
ecfc5424 | 187 | base=`echo "$f" | sed 's/.*\///'` |
9f3ef600 NC |
188 | this_target="lib/auto/$f/$base.$dlext" |
189 | dynamic_list="$dynamic_list $this_target" | |
190 | ||
191 | : Parallel makes reveal that we have some interdependencies | |
192 | case $f in | |
90e91dd8 | 193 | Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep |
04718b47 | 194 | $this_target: $list_util_dep" ;; |
9f3ef600 NC |
195 | Unicode/Normalize) extra_dep="$extra_dep |
196 | $this_target: uni.data" ;; | |
197 | esac | |
a0d0e21e LW |
198 | done |
199 | ||
200 | static_list=' ' | |
a0d0e21e LW |
201 | for f in $static_ext; do |
202 | base=`echo "$f" | sed 's/.*\///'` | |
cd4d8a96 | 203 | static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)" |
54f7170d AD |
204 | : Parallel makes reveal that we have some interdependencies |
205 | this_target="lib/auto/$f/$base\$(LIB_EXT)" | |
206 | case $f in | |
207 | Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep | |
208 | $this_target: lib/auto/List/Util/Util\$(LIB_EXT)" ;; | |
209 | Unicode/Normalize) extra_dep="$extra_dep | |
210 | $this_target: uni.data" ;; | |
211 | esac | |
a0d0e21e LW |
212 | done |
213 | ||
4318d5a0 GB |
214 | nonxs_list=' ' |
215 | for f in $nonxs_ext; do | |
6c0ec79a | 216 | p=`echo "$f" | tr / -` |
a193a2db | 217 | for d in ext dist cpan; do |
321c3589 NC |
218 | if test -d $d/$p; then |
219 | nonxs_list="$nonxs_list $d/$p/pm_to_blib" | |
220 | fi | |
221 | done | |
4318d5a0 GB |
222 | done |
223 | ||
5ac1e9b2 AA |
224 | dtrace_h='' |
225 | dtrace_o='' | |
3d450a5d | 226 | minidtrace_o='' |
5ac1e9b2 AA |
227 | case "$usedtrace" in |
228 | define|true) | |
229 | dtrace_h='perldtrace.h' | |
230 | $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \ | |
3d450a5d DL |
231 | && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)' \ |
232 | && minidtrace_o='miniperldtrace$(OBJ_EXT)' | |
5ac1e9b2 AA |
233 | ;; |
234 | esac | |
235 | ||
5a20539c VK |
236 | echo "Extracting $Makefile (with variable substitutions)" |
237 | $spitshell >$Makefile <<!GROK!THIS! | |
238 | # $Makefile | |
85e6fe83 LW |
239 | # This file is derived from Makefile.SH. Any changes made here will |
240 | # be lost the next time you run Configure. | |
655635e8 | 241 | # Makefile is used to generate $firstmakefile. The only difference |
242 | # is that $firstmakefile has the dependencies filled in at the end. | |
0de566d7 | 243 | |
2304df62 | 244 | CC = $cc |
232e078e | 245 | LD = $ld |
16d20bd9 | 246 | |
2304df62 AD |
247 | LDFLAGS = $ldflags |
248 | CLDFLAGS = $ldflags | |
85e6fe83 | 249 | |
2304df62 AD |
250 | mallocsrc = $mallocsrc |
251 | mallocobj = $mallocobj | |
00e74f14 NC |
252 | madlysrc = $madlysrc |
253 | madlyobj = $madlyobj | |
85e6fe83 | 254 | LNS = $lns |
4c901d04 JH |
255 | # NOTE: some systems don't grok "cp -f". XXX Configure test needed? |
256 | CPS = $cp | |
2304df62 | 257 | RMS = rm -f |
85e6fe83 LW |
258 | ranlib = $ranlib |
259 | ||
16d20bd9 AD |
260 | # The following are mentioned only to make metaconfig include the |
261 | # appropriate questions in Configure. If you want to change these, | |
8e07c86e | 262 | # edit config.sh instead, or specify --man1dir=/wherever on |
16d20bd9 AD |
263 | # installman commandline. |
264 | bin = $installbin | |
265 | scriptdir = $scriptdir | |
d96ebe2e | 266 | shrpdir = $archlibexp/CORE |
16d20bd9 AD |
267 | privlib = $installprivlib |
268 | man1dir = $man1dir | |
269 | man1ext = $man1ext | |
270 | man3dir = $man3dir | |
271 | man3ext = $man3ext | |
272 | ||
85e6fe83 LW |
273 | # The following are used to build and install shared libraries for |
274 | # dynamic loading. | |
275 | LDDLFLAGS = $lddlflags | |
3c321fdc | 276 | SHRPLDFLAGS = $shrpldflags |
85e6fe83 | 277 | CCDLFLAGS = $ccdlflags |
a0d0e21e | 278 | DLSUFFIX = .$dlext |
ecfc5424 | 279 | PLDLFLAGS = $pldlflags |
d96ebe2e | 280 | LIBPERL = $libperl |
d5d19f97 | 281 | LLIBPERL= $linklibperl |
fe5460cc | 282 | LLIBPERL_NONSHR= $linklibperl_nonshr |
ecfc5424 | 283 | SHRPENV = $shrpenv |
a0d0e21e | 284 | |
94c41b70 AD |
285 | # Static targets are ordinarily built without CCCDLFLAGS. However, |
286 | # if building a shared libperl.so that might later be linked into | |
287 | # another application, then it might be appropriate to also build static | |
288 | # extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC | |
07f3cc2a NC |
289 | # for GNU cc). |
290 | STATIC_LDFLAGS = $static_ldflags | |
94c41b70 | 291 | |
6ee623d5 | 292 | # The following is used to include the current directory in |
5cf1d1f1 | 293 | # the dynamic loader path you are building a shared libperl. |
6ee623d5 GS |
294 | LDLIBPTH = $ldlibpth |
295 | ||
cef6ea9d JH |
296 | # Sometimes running an executable is an adventure. |
297 | RUN = $run | |
298 | ||
5a20539c VK |
299 | # These variables may need to be manually set for non-Unix systems. |
300 | AR = $full_ar | |
301 | HOST_EXE_EXT = | |
302 | EXE_EXT = $_exe | |
303 | LIB_EXT = $_a | |
304 | OBJ_EXT = $_o | |
305 | PATH_SEP = $p_ | |
306 | ||
199863e7 NC |
307 | # Macros to invoke a copy of miniperl during the build. Targets which |
308 | # are built using these macros should depend on \$(MINIPERL_EXE) | |
309 | MINIPERL_EXE = miniperl\$(EXE_EXT) | |
310 | MINIPERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib | |
311 | ||
34b80e25 JV |
312 | # Macros to invoke a copy of our fully operational perl during the build. |
313 | PERL_EXE = perl\$(EXE_EXT) | |
314 | RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) | |
315 | ||
5fb77da4 JV |
316 | # Macros to run our tests |
317 | RUN_TESTS = \$(LDLIBPTH) ./runtests | |
34b80e25 | 318 | |
a0d0e21e | 319 | dynamic_ext = $dynamic_list |
ec81ed5d | 320 | dynamic_ext_re = $dynamic_ext_re |
a0d0e21e | 321 | static_ext = $static_list |
4318d5a0 GB |
322 | nonxs_ext = $nonxs_list |
323 | ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext) | |
908fcb8b | 324 | DYNALOADER = DynaLoader\$(OBJ_EXT) |
2304df62 | 325 | |
9c839522 | 326 | libs = $perllibs $cryptlib |
2304df62 | 327 | |
34b80e25 | 328 | public = \$(PERL_EXE) utilities translators |
2304df62 AD |
329 | |
330 | shellflags = $shellflags | |
331 | ||
d96ebe2e | 332 | # This is set to MAKE=$make if your $make command doesn't |
333 | # do it for you. | |
334 | $make_set_make | |
4633a7c4 | 335 | |
1fef16b3 JH |
336 | # Mention $gmake here so it gets probed for by Configure. |
337 | ||
cfe76a0a JC |
338 | !GROK!THIS! |
339 | ||
340 | case "${osname}" in | |
09617314 | 341 | linux*|darwin) |
cfe76a0a | 342 | $spitshell >>$Makefile <<!GROK!THIS! |
4f9287d3 NC |
343 | # If you're going to use valgrind and it can't be invoked as plain valgrind |
344 | # then you'll need to change this, or override it on the make command line. | |
c7b956bb JC |
345 | VALGRIND ?= valgrind |
346 | VG_TEST ?= ./perl -e 1 2>/dev/null | |
4f9287d3 | 347 | |
cfe76a0a JC |
348 | !GROK!THIS! |
349 | ;; | |
350 | esac | |
351 | ||
352 | $spitshell >>$Makefile <<!GROK!THIS! | |
5ac1e9b2 AA |
353 | DTRACE = $dtrace |
354 | DTRACE_H = $dtrace_h | |
355 | DTRACE_O = $dtrace_o | |
3d450a5d | 356 | MINIDTRACE_O = $minidtrace_o |
5ac1e9b2 | 357 | |
4633a7c4 LW |
358 | FIRSTMAKEFILE = $firstmakefile |
359 | ||
360 | # Any special object files needed by this architecture, e.g. os2/os2.obj | |
361 | ARCHOBJS = $archobjs | |
362 | ||
89ada9f2 | 363 | .SUFFIXES: .c \$(OBJ_EXT) .i .s |
cd4d8a96 | 364 | |
d96ebe2e | 365 | # grrr |
366 | SHELL = $sh | |
655635e8 | 367 | |
28e8609d JH |
368 | # how to tr(anslate) newlines |
369 | TRNL = '$trnl' | |
370 | ||
82240bfc JH |
371 | OPTIMIZE = $optimize |
372 | ||
3343e82c JH |
373 | EXTRAS = $extras |
374 | ||
bf35c3f6 JH |
375 | INSTALLPREFIXEXP = $prefix |
376 | ||
d56c5707 | 377 | !GROK!THIS! |
b7b35fc2 | 378 | # not used by Makefile but by installperl; |
d56c5707 JH |
379 | # mentioned here so that metaconfig picks these up |
380 | # $installusrbinperl | |
381 | # $versiononly | |
b7b35fc2 | 382 | |
8170cb12 JH |
383 | case "${osname}:${osvers}" in |
384 | darwin:*) | |
5a20539c | 385 | $spitshell >>$Makefile <<EOF |
8170cb12 JH |
386 | |
387 | # Your locales are broken (osname $osname, osvers $osvers) | |
388 | # and to avoid the numerous | |
389 | # perl: warning: Setting locale failed. | |
390 | # warnings during the build process we reset the locale variables. | |
391 | ||
392 | LC_ALL=C | |
393 | LANG=C | |
394 | LANGUAGE=C | |
395 | EOF | |
396 | ;; | |
397 | esac | |
2304df62 | 398 | |
5a20539c VK |
399 | case $CROSS_NAME in |
400 | '') | |
85e6fe83 | 401 | ## In the following dollars and backticks do not need the extra backslash. |
5a20539c | 402 | $spitshell >>$Makefile <<'!NO!SUBS!' |
2304df62 | 403 | |
75550b4e | 404 | CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@` |
89ada9f2 | 405 | |
75550b4e | 406 | CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<` |
2304df62 | 407 | |
744ac0ea NC |
408 | CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl |
409 | CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl | |
5a20539c VK |
410 | |
411 | CONFIGPOD = lib/Config.pod | |
412 | ||
413 | CONFIGH = config.h | |
414 | !NO!SUBS! | |
415 | ;; | |
416 | *) | |
417 | # if cross-compilation | |
418 | $spitshell >>$Makefile <<!GROK!THIS! | |
419 | CROSS_NAME = $CROSS_NAME | |
420 | CROSS_LIB = xlib/$CROSS_NAME | |
421 | ||
422 | CCCMD = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$@\` -I\$(CROSS_LIB) | |
423 | CCCMDSRC = \`sh \$(shellflags) cflags-cross-$CROSS_NAME "optimize='\$(OPTIMIZE)'" \$<\` -I\$(CROSS_LIB) | |
424 | CONFIGPM = xlib/\$(CROSS_NAME)/Config.pm | |
425 | CONFIGPOD = xlib/\$(CROSS_NAME)/Config.pod | |
426 | CONFIGH = xconfig.h | |
427 | ||
428 | xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh | |
429 | CONFIG_SH=Cross/config-\$(CROSS_NAME).sh CONFIG_H=xconfig.h \$(SHELL) config_h.SH | |
7222c10a | 430 | #TODO \$(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib -MCross=\$(CROSS_NAME) config_h.PL "INST_VER=\$(INST_VER)" "CORE_DIR=\$(CROSS_LIB)" "CONFIG_H=xconfig.h" |
5a20539c VK |
431 | cp xconfig.h \$(CROSS_LIB)/ |
432 | cp xconfig.h \$(CROSS_LIB)/config.h | |
433 | ||
434 | !GROK!THIS! | |
435 | ;; | |
436 | esac | |
437 | ||
438 | ## In the following dollars and backticks do not need the extra backslash. | |
439 | $spitshell >>$Makefile <<'!NO!SUBS!' | |
440 | ||
5e4c4c91 | 441 | private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl |
2304df62 | 442 | |
4633a7c4 LW |
443 | # Files to be built with variable substitution before miniperl |
444 | # is available. | |
cbeaa189 | 445 | sh = Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH |
4633a7c4 | 446 | |
cbeaa189 | 447 | shextract = Makefile cflags config.h makedepend makedir myconfig pod/Makefile |
4633a7c4 | 448 | |
467132b9 | 449 | addedbyconf = UU $(shextract) pstruct |
2304df62 | 450 | |
5ad7e614 | 451 | # Unicode data files generated by mktables |
3df51b85 KW |
452 | unidatafiles = lib/unicore/Decomposition.pl lib/unicore/TestProp.pl \ |
453 | lib/unicore/CombiningClass.pl lib/unicore/Name.pl \ | |
1a234f2b | 454 | lib/unicore/UCD.pl lib/unicore/Name.pm \ |
3e344d15 | 455 | lib/unicore/Heavy.pl lib/unicore/mktables.lst |
5ad7e614 NC |
456 | |
457 | # Directories of Unicode data files generated by mktables | |
458 | unidatadirs = lib/unicore/To lib/unicore/lib | |
459 | ||
5a20539c | 460 | h1 = EXTERN.h INTERN.h XSUB.h av.h $(CONFIGH) cop.h cv.h dosish.h |
dd2155a4 DM |
461 | h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h |
462 | h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h | |
219f41b1 | 463 | h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h |
7bbf947b | 464 | h5 = utf8.h warnings.h mydtrace.h op_reg_common.h l1_char_class_tab.h |
9d9177be KW |
465 | h6 = charclass_invlists.h |
466 | h = $(h1) $(h2) $(h3) $(h4) $(h5) $(h6) | |
2304df62 | 467 | |
e1a479c5 | 468 | c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c |
00e74f14 | 469 | c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c |
26ea9e12 | 470 | c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c |
00e74f14 NC |
471 | c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c |
472 | c5 = $(madlysrc) $(mallocsrc) | |
2304df62 | 473 | |
a812f6a9 | 474 | c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c |
2304df62 | 475 | |
bf799c64 | 476 | obj0 = op$(OBJ_EXT) perl$(OBJ_EXT) |
c3ea6d28 | 477 | obj0mini = perlmini$(OBJ_EXT) opmini$(OBJ_EXT) miniperlmain$(OBJ_EXT) |
26ea9e12 | 478 | obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT) keywords$(OBJ_EXT) |
bf799c64 | 479 | 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) |
48462a74 | 480 | obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) |
655635e8 | 481 | |
c3ea6d28 | 482 | minindt_obj = $(obj0mini) $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
3d450a5d | 483 | mini_obj = $(minindt_obj) $(MINIDTRACE_O) |
bf799c64 | 484 | ndt_obj = $(obj0) $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
5ac1e9b2 | 485 | obj = $(ndt_obj) $(DTRACE_O) |
2304df62 | 486 | |
7e7cfa2d | 487 | perltoc_pod_prereqs = extra.pods pod/perl5176delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod |
7eb47696 | 488 | generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs) |
9387abf8 | 489 | generated_headers = uudmap.h bitcount.h mg_data.h |
344af494 | 490 | |
cc0b6dc4 | 491 | Icwd = -Idist/Cwd -Idist/Cwd/lib -Idist/Carp/lib |
403f501d | 492 | |
075abff3 | 493 | lintflags = \ |
5f66b61c AL |
494 | -b \ |
495 | -n \ | |
075abff3 | 496 | -p \ |
075abff3 AL |
497 | -Ncheck=%all \ |
498 | -Nlevel=4 \ | |
bb263b4e AL |
499 | -errchk=parentheses \ |
500 | -errhdr=%all \ | |
66a1b24b | 501 | -errfmt=src \ |
075abff3 | 502 | -errtags \ |
5f66b61c | 503 | -erroff=E_ASSIGN_NARROW_CONV \ |
075abff3 | 504 | -erroff=E_BAD_PTR_CAST \ |
5f66b61c AL |
505 | -erroff=E_BAD_PTR_CAST_ALIGN \ |
506 | -erroff=E_BAD_PTR_INT_COMBINATION \ | |
507 | -erroff=E_BAD_SIGN_EXTEND \ | |
075abff3 | 508 | -erroff=E_BLOCK_DECL_UNUSED \ |
5f66b61c | 509 | -erroff=E_CASE_FALLTHRU \ |
abcf5ada | 510 | -erroff=E_CONST_EXPR \ |
075abff3 | 511 | -erroff=E_CONSTANT_CONDITION \ |
abcf5ada | 512 | -erroff=E_END_OF_LOOP_CODE_NOT_REACHED \ |
5f66b61c | 513 | -erroff=E_EQUALITY_NOT_ASSIGNMENT \ |
075abff3 | 514 | -erroff=E_EXPR_NULL_EFFECT \ |
66a1b24b | 515 | -erroff=E_FALSE_LOGICAL_EXPR \ |
66a1b24b | 516 | -erroff=E_INCL_NUSD \ |
5f66b61c | 517 | -erroff=E_LOOP_EMPTY \ |
66a1b24b | 518 | -erroff=E_MAIN_PARAM \ |
5f66b61c AL |
519 | -erroff=E_POINTER_TO_OBJECT \ |
520 | -erroff=E_PTRDIFF_OVERFLOW \ | |
521 | -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L \ | |
522 | -erroff=E_STATIC_UNUSED \ | |
05c462c4 | 523 | -erroff=E_TRUE_LOGICAL_EXPR |
2304df62 | 524 | |
abcf5ada AL |
525 | splintflags = \ |
526 | -I/usr/lib/gcc/i486-linux-gnu/4.0.2/include/ \ | |
527 | -D__builtin_va_list=va_list \ | |
528 | -Dsigjmp_buf=jmp_buf \ | |
529 | -warnposix \ | |
530 | \ | |
531 | +boolint \ | |
532 | +charintliteral \ | |
533 | -fixedformalarray \ | |
534 | -mustfreefresh \ | |
535 | -nestedextern \ | |
536 | -predboolint \ | |
537 | -predboolothers \ | |
538 | -preproc \ | |
539 | -boolops \ | |
540 | -shadow \ | |
541 | -nullstate \ | |
542 | +longintegral \ | |
543 | +matchanyintegral \ | |
544 | -type \ | |
545 | \ | |
546 | +line-len 999 \ | |
547 | +weak | |
548 | ||
549 | splintfiles = $(c1) | |
550 | ||
e21c97b9 | 551 | .c$(OBJ_EXT): |
d96ebe2e | 552 | $(CCCMD) $(PLDLFLAGS) $*.c |
2304df62 | 553 | |
e21c97b9 | 554 | .c.i: |
89ada9f2 JH |
555 | $(CCCMDSRC) -E $*.c > $*.i |
556 | ||
e21c97b9 | 557 | .c.s: |
89ada9f2 JH |
558 | $(CCCMDSRC) -S $*.c |
559 | ||
a5addb16 | 560 | all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make |
51356d76 NC |
561 | @echo " "; |
562 | @echo " Everything is up to date. Type '$(MAKE) test' to run test suite." | |
563 | ||
486cd780 | 564 | .PHONY: all translators utilities |
8565263a | 565 | |
2b63e250 AD |
566 | # Both git_version.h and lib/Config_git.pl are built |
567 | # by make_patchnum.pl. | |
568 | git_version.h: lib/Config_git.pl | |
569 | ||
570 | lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl | |
199863e7 | 571 | $(MINIPERL) make_patchnum.pl |
dcff826f YO |
572 | |
573 | # make sure that we recompile perl.c if the git version changes | |
574 | perl$(OBJ_EXT): git_version.h | |
6ee623d5 | 575 | |
d1309555 NC |
576 | !NO!SUBS! |
577 | ||
939767c9 AD |
578 | # Making utilities and translators require Cwd. If we have dynamic |
579 | # loading, we only need miniperl and Cwd.$dlext. If we have static | |
580 | # loading, we need to build perl first. | |
de4c0096 TC |
581 | case "$usedl$static_cwd" in |
582 | defineundef) | |
939767c9 AD |
583 | util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE' |
584 | x2p_deps='$(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' | |
585 | ;; | |
de4c0096 TC |
586 | definedefine) |
587 | util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' | |
588 | x2p_deps='$(PERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' | |
589 | ;; | |
939767c9 AD |
590 | *) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' |
591 | x2p_deps='$(PERL_EXE) $(CONFIGPM) FORCE' | |
592 | ;; | |
593 | esac | |
594 | ||
d1309555 | 595 | $spitshell >>$Makefile <<!GROK!THIS! |
939767c9 AD |
596 | translators: $x2p_deps |
597 | @echo " "; echo " Making x2p stuff"; cd x2p; \$(LDLIBPTH) \$(MAKE) all | |
598 | ||
3eaf6950 NC |
599 | x2p/s2p: $x2p_deps |
600 | cd x2p; \$(LDLIBPTH) \$(MAKE) s2p | |
601 | ||
9f417383 NC |
602 | x2p/find2perl: $x2p_deps |
603 | cd x2p; \$(LDLIBPTH) \$(MAKE) find2perl | |
604 | ||
939767c9 | 605 | utilities: $util_deps |
d1309555 | 606 | @echo " "; echo " Making utilities"; cd utils; \$(LDLIBPTH) \$(MAKE) all |
909b3858 | 607 | |
d1309555 | 608 | !GROK!THIS! |
939767c9 | 609 | |
d1309555 | 610 | $spitshell >>$Makefile <<'!NO!SUBS!' |
909b3858 | 611 | |
16d20bd9 AD |
612 | # This is now done by installman only if you actually want the man pages. |
613 | # @echo " "; echo " Making docs"; cd pod; $(MAKE) all; | |
85e6fe83 LW |
614 | |
615 | # Phony target to force checking subdirectories. | |
e50aee73 | 616 | # Apparently some makes require an action for the FORCE target. |
869a466c | 617 | .PHONY: FORCE |
85e6fe83 | 618 | FORCE: |
4633a7c4 | 619 | @sh -c true |
aa9e9805 | 620 | !NO!SUBS! |
4ba7095c | 621 | |
aa9e9805 | 622 | for file in op perl; do |
6cdadb5a NC |
623 | if $issymlink $file.c; then |
624 | $spitshell >>$Makefile <<!GROK!THIS! | |
625 | ||
626 | # We do a copy of the $file.c instead of a symlink because gcc gets huffy | |
627 | # if we have a symlink forest to another disk (it complains about too many | |
628 | # levels of symbolic links, even if we have only two) | |
c015c5e4 | 629 | |
aa9e9805 NC |
630 | ${file}mini.c: $file.c |
631 | \$(RMS) ${file}mini.c | |
632 | \$(CPS) ${file}.c ${file}mini.c | |
6cdadb5a NC |
633 | !GROK!THIS! |
634 | else | |
635 | $spitshell >>$Makefile <<!GROK!THIS! | |
636 | ||
637 | ${file}mini.c: $file.c | |
638 | \$(RMS) ${file}mini.c | |
639 | \$(LNS) ${file}.c ${file}mini.c | |
640 | !GROK!THIS! | |
641 | fi | |
642 | ||
643 | $spitshell >>$Makefile <<!GROK!THIS! | |
bd0dd1d8 | 644 | |
aa9e9805 NC |
645 | ${file}mini\$(OBJ_EXT): ${file}mini.c |
646 | \$(CCCMD) \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c | |
647 | !GROK!THIS! | |
648 | done | |
bf799c64 | 649 | |
aa9e9805 | 650 | $spitshell >>$Makefile <<'!NO!SUBS!' |
bf799c64 | 651 | |
9387abf8 | 652 | globals$(OBJ_EXT): $(generated_headers) |
9444d213 | 653 | |
6f83ef0e | 654 | uudmap.h mg_data.h: bitcount.h |
0f13ebd5 | 655 | |
aa9e9805 | 656 | bitcount.h: generate_uudmap$(HOST_EXE_EXT) |
9387abf8 | 657 | $(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) |
6f83ef0e NC |
658 | |
659 | generate_uudmap$(OBJ_EXT): mg_raw.h | |
9444d213 | 660 | |
aa9e9805 NC |
661 | generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) |
662 | $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) | |
9444d213 | 663 | |
517e7c64 | 664 | miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h |
92c28edd | 665 | $(CCCMD) $(PLDLFLAGS) $*.c |
ecfc5424 | 666 | |
fbcaf611 NC |
667 | perlmain.c: $(MINIPERL_EXE) lib/ExtUtils/Miniperl.pm |
668 | $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' DynaLoader $(static_ext) > perlmain.c | |
85e6fe83 | 669 | |
486cd780 | 670 | perlmain$(OBJ_EXT): perlmain.c |
92c28edd | 671 | $(CCCMD) $(PLDLFLAGS) $*.c |
85e6fe83 | 672 | |
a0d0e21e LW |
673 | # The file ext.libs is a list of libraries that must be linked in |
674 | # for static extensions, e.g. -lm -lgdbm, etc. The individual | |
675 | # static extension Makefile's add to it. | |
fed7345c | 676 | ext.libs: $(static_ext) |
a0d0e21e | 677 | -@test -f ext.libs || touch ext.libs |
85e6fe83 | 678 | |
ecfc5424 | 679 | !NO!SUBS! |
599a829f | 680 | |
d96ebe2e | 681 | # How to build libperl. This is still rather convoluted. |
599a829f | 682 | # Load up custom Makefile.SH fragment for shared loading and executables: |
8736538c | 683 | case "$osname" in |
8736538c AS |
684 | *) |
685 | Makefile_s="$osname/Makefile.SHs" | |
686 | ;; | |
687 | esac | |
688 | ||
549a6b10 JH |
689 | case "$osname" in |
690 | aix) | |
5a20539c | 691 | $spitshell >>$Makefile <<!GROK!THIS! |
9c839522 | 692 | LIBS = $perllibs |
5f9d9a17 ME |
693 | # In AIX we need to change this for building Perl itself from |
694 | # its earlier definition (which is for building external | |
695 | # extensions *after* Perl has been built and installed) | |
696 | CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'` | |
549a6b10 JH |
697 | |
698 | !GROK!THIS! | |
699 | case "$useshrplib" in | |
700 | define|true|[yY]*) | |
5a20539c | 701 | $spitshell >>$Makefile <<'!NO!SUBS!' |
549a6b10 JH |
702 | |
703 | LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT) | |
704 | MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) | |
705 | ||
a643aca6 | 706 | $(LIBPERL_NONSHR): $(obj) |
549a6b10 | 707 | $(RMS) $(LIBPERL_NONSHR) |
a643aca6 | 708 | $(AR) rcu $(LIBPERL_NONSHR) $(obj) |
549a6b10 | 709 | |
bf799c64 | 710 | $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) |
a7089531 | 711 | $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \ |
bf799c64 | 712 | opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS) |
549a6b10 JH |
713 | |
714 | MINIPERLEXP = $(MINIPERL_NONSHR) | |
715 | ||
716 | LIBPERLEXPORT = perl.exp | |
717 | ||
718 | !NO!SUBS! | |
719 | ||
720 | ;; | |
721 | *) | |
5a20539c | 722 | $spitshell >>$Makefile <<'!NO!SUBS!' |
199863e7 | 723 | MINIPERLEXP = $(MINIPERL_EXE) |
549a6b10 JH |
724 | |
725 | PERLEXPORT = perl.exp | |
726 | ||
727 | !NO!SUBS! | |
728 | ;; | |
729 | esac | |
5a20539c | 730 | $spitshell >>$Makefile <<'!NO!SUBS!' |
e6807d8a | 731 | perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) |
5d4e58dc | 732 | ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp |
549a6b10 JH |
733 | |
734 | !NO!SUBS! | |
735 | ;; | |
2c2d71f5 | 736 | os2) |
5a20539c | 737 | $spitshell >>$Makefile <<'!NO!SUBS!' |
2c2d71f5 JH |
738 | MINIPERLEXP = miniperl |
739 | ||
e6807d8a | 740 | perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map |
46aae397 | 741 | ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def |
2c2d71f5 JH |
742 | |
743 | !NO!SUBS! | |
744 | ;; | |
5f9145a3 | 745 | cygwin) |
5a20539c | 746 | $spitshell >>$Makefile <<'!NO!SUBS!' |
5f9145a3 RU |
747 | cygwin.c: cygwin/cygwin.c |
748 | $(LNS) cygwin/cygwin.c | |
749 | ||
750 | LIBPERL_NONSHR = libperl$(LIB_EXT) | |
751 | ||
752 | $(LIBPERL_NONSHR): $(obj) | |
753 | $(RMS) $(LIBPERL_NONSHR) | |
754 | $(AR) rcu $(LIBPERL_NONSHR) $(obj) | |
755 | ||
756 | !NO!SUBS! | |
757 | ;; | |
549a6b10 JH |
758 | esac |
759 | ||
5f9145a3 | 760 | if test -s $Makefile_s ; then |
8736538c | 761 | . $Makefile_s |
5a20539c | 762 | $spitshell >>$Makefile <<!GROK!THIS! |
cd4d8a96 | 763 | |
8736538c | 764 | Makefile: $Makefile_s |
cd4d8a96 | 765 | !GROK!THIS! |
766 | else | |
5ac1e9b2 AA |
767 | case "$dtrace_h" in |
768 | ?*) | |
5a20539c | 769 | $spitshell >>$Makefile <<'!NO!SUBS!' |
12b81ca5 | 770 | # dtrace dicards const qualifiers from arguments, put them back |
5ac1e9b2 | 771 | $(DTRACE_H): perldtrace.d |
12b81ca5 TC |
772 | $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H).in |
773 | sed -e '/const/!s/char \*/const char */g' $(DTRACE_H).in >$(DTRACE_H) | |
774 | $(RMS) $(DTRACE_H).in | |
5ac1e9b2 AA |
775 | |
776 | mydtrace.h: $(DTRACE_H) | |
777 | ||
778 | !NO!SUBS! | |
779 | ;; | |
780 | esac | |
781 | case "$dtrace_o" in | |
782 | ?*) | |
5a20539c | 783 | $spitshell >>$Makefile <<'!NO!SUBS!' |
3d450a5d | 784 | $(DTRACE_O): perldtrace.d $(ndt_obj) |
5ac1e9b2 AA |
785 | $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj) |
786 | ||
c3ea6d28 TC |
787 | $(MINIDTRACE_O): perldtrace.d $(minindt_obj) perlmini$(OBJ_EXT) |
788 | $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT) | |
3d450a5d | 789 | |
5ac1e9b2 AA |
790 | !NO!SUBS! |
791 | ;; | |
792 | esac | |
5a20539c | 793 | $spitshell >>$Makefile <<'!NO!SUBS!' |
908fcb8b | 794 | $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT) |
9c9e9f08 | 795 | !NO!SUBS! |
d96ebe2e | 796 | case "$useshrplib" in |
797 | true) | |
5a20539c | 798 | $spitshell >>$Makefile <<'!NO!SUBS!' |
0107c41a | 799 | rm -f $@ |
908fcb8b | 800 | $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) |
3c321fdc | 801 | !NO!SUBS! |
802 | case "$osname" in | |
803 | aix) | |
5a20539c | 804 | $spitshell >>$Makefile <<'!NO!SUBS!' |
28e8609d | 805 | rm -f libperl$(OBJ_EXT) |
3c321fdc | 806 | mv $@ libperl$(OBJ_EXT) |
807 | $(AR) qv $(LIBPERL) libperl$(OBJ_EXT) | |
ecfc5424 | 808 | !NO!SUBS! |
3c321fdc | 809 | ;; |
810 | esac | |
d96ebe2e | 811 | ;; |
812 | *) | |
5a20539c | 813 | $spitshell >>$Makefile <<'!NO!SUBS!' |
d96ebe2e | 814 | rm -f $(LIBPERL) |
908fcb8b | 815 | $(AR) rcu $(LIBPERL) $(obj) $(DYNALOADER) |
d96ebe2e | 816 | @$(ranlib) $(LIBPERL) |
655635e8 | 817 | !NO!SUBS! |
d96ebe2e | 818 | ;; |
819 | esac | |
5a20539c | 820 | $spitshell >>$Makefile <<'!NO!SUBS!' |
599a829f IZ |
821 | |
822 | # How to build executables. | |
823 | ||
824 | # The $& notation tells Sequent machines that it can do a parallel make, | |
825 | # and is harmless otherwise. | |
826 | # The miniperl -w -MExporter line is a basic cheap test to catch errors | |
827 | # before make goes on to run preplibrary and then MakeMaker on extensions. | |
828 | # This is very handy because later errors are often caused by miniperl | |
829 | # build problems but that's not obvious to the novice. | |
830 | # The Module used here must not depend on Config or any extensions. | |
831 | ||
ecfb2188 GS |
832 | !NO!SUBS! |
833 | ||
834 | case "${osname}${osvers}" in | |
e56d2c04 | 835 | aix*|beos*) |
5a20539c | 836 | $spitshell >>$Makefile <<'!NO!SUBS!' |
c3ea6d28 TC |
837 | $(MINIPERL_EXE): $& $(mini_obj) |
838 | $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs) | |
5a20539c | 839 | $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 GS |
840 | !NO!SUBS! |
841 | ;; | |
e56d2c04 | 842 | next4*) |
5a20539c | 843 | $spitshell >>$Makefile <<'!NO!SUBS!' |
c3ea6d28 TC |
844 | $(MINIPERL_EXE): $& $(mini_obj) |
845 | $(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs) | |
5a20539c | 846 | $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
535d2540 JH |
847 | !NO!SUBS! |
848 | ;; | |
cb3fc426 | 849 | darwin*) |
986530ea JH |
850 | case "$osvers" in |
851 | [1-6].*) ;; | |
852 | *) case "$ldflags" in | |
853 | *"-flat_namespace"*) ;; | |
854 | *) # to allow opmini.o to override stuff in libperl.dylib | |
5a20539c | 855 | $spitshell >>$Makefile <<!NO!SUBS! |
69625aa9 JH |
856 | NAMESPACEFLAGS = -force_flat_namespace |
857 | !NO!SUBS! | |
986530ea JH |
858 | ;; |
859 | esac | |
860 | ;; | |
cb3fc426 | 861 | esac |
5a20539c | 862 | $spitshell >>$Makefile <<'!NO!SUBS!' |
c3ea6d28 | 863 | $(MINIPERL_EXE): $& $(mini_obj) |
cb3fc426 | 864 | -@rm -f miniperl.xok |
199863e7 | 865 | $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \ |
c3ea6d28 | 866 | $(mini_obj) $(libs) |
5a20539c | 867 | $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
cb3fc426 JH |
868 | !NO!SUBS! |
869 | ;; | |
ecfb2188 | 870 | *) |
5a20539c | 871 | $spitshell >>$Makefile <<'!NO!SUBS!' |
c3ea6d28 | 872 | $(MINIPERL_EXE): $& $(mini_obj) |
93c0359c | 873 | -@rm -f miniperl.xok |
199863e7 | 874 | $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \ |
c3ea6d28 | 875 | $(mini_obj) $(libs) |
5a20539c | 876 | $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 GS |
877 | !NO!SUBS! |
878 | ;; | |
879 | esac | |
880 | ||
5a20539c | 881 | $spitshell >>$Makefile <<'!NO!SUBS!' |
599a829f | 882 | |
34b80e25 | 883 | $(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) |
93c0359c | 884 | -@rm -f miniperl.xok |
908fcb8b | 885 | $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f | 886 | |
4ae3d70a JH |
887 | # Purify/Quantify Perls. |
888 | ||
34b80e25 | 889 | pure$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) |
908fcb8b | 890 | $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f | 891 | |
34b80e25 | 892 | purecov$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) |
908fcb8b | 893 | $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
dbadb36a | 894 | |
34b80e25 | 895 | quant$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) |
908fcb8b | 896 | $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 | 897 | |
45ed6be3 JC |
898 | !NO!SUBS! |
899 | ||
900 | case "${osname}${osvers}" in | |
09617314 | 901 | linux*|darwin*) |
45ed6be3 | 902 | $spitshell >>$Makefile <<'!NO!SUBS!' |
09617314 | 903 | # Valgrind perl (currently Linux, Darwin only) |
7a834142 JH |
904 | |
905 | perl.valgrind.config: config.sh | |
906 | @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..." | |
907 | @$(MAKE) perl.config.dashg | |
908 | @echo "Checking usemymalloc='n' in config.sh..." | |
909 | @grep "^usemymalloc=" config.sh | |
910 | @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1 | |
911 | @echo "And of course you have to have valgrind..." | |
c7b956bb | 912 | $(VALGRIND) $(VG_TEST) || exit 1 |
45ed6be3 JC |
913 | !NO!SUBS! |
914 | ;; | |
915 | esac | |
916 | ||
917 | $spitshell >>$Makefile <<'!NO!SUBS!' | |
7a834142 | 918 | |
4ae3d70a JH |
919 | # Third Degree Perl (Tru64 only) |
920 | ||
719561de | 921 | perl.config.dashg: |
83f0ef60 | 922 | @echo "Checking optimize='-g' in config.sh..." |
fdb8bc18 RGS |
923 | @grep "^optimize=" config.sh |
924 | @egrep "^optimize='(.*-g.*)'" config.sh >/dev/null || exit 1 | |
4ae3d70a JH |
925 | |
926 | perl.third.config: config.sh | |
927 | @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..." | |
6e36760b | 928 | @$(MAKE) perl.config.dashg |
83f0ef60 JH |
929 | @echo "Checking usemymalloc='n' in config.sh..." |
930 | @grep "^usemymalloc=" config.sh | |
931 | @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1 | |
170ba846 | 932 | |
412c6516 | 933 | perl.third: /usr/bin/atom perl.third.config perl |
dca31ef4 | 934 | atom -tool third -L. -all -gp -toolargs="-invalid -uninit heap+stack+copy -min 0" perl |
83f0ef60 | 935 | @echo "Now you may run perl.third and then study perl.3log." |
15615bfd | 936 | |
4ae3d70a JH |
937 | # Pixie Perls (Tru64 and IRIX only) |
938 | ||
719561de | 939 | perl.pixie.config: config.sh |
4ae3d70a | 940 | @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..." |
6e36760b | 941 | @$(MAKE) perl.config.dashg |
4ae3d70a | 942 | |
719561de | 943 | perl.pixie.atom: /usr/bin/atom perl |
4ae3d70a JH |
944 | atom -tool pixie -L. -all -toolargs="-quiet" perl |
945 | ||
946 | perl.pixie.irix: perl | |
947 | pixie perl | |
948 | ||
719561de | 949 | perl.pixie: /usr/bin/pixie perl.pixie.config perl |
4ae3d70a JH |
950 | if test -x /usr/bin/atom; then \ |
951 | $(MAKE) perl.pixie.atom; \ | |
952 | else \ | |
953 | $(MAKE) perl.pixie.irix; \ | |
954 | fi | |
83f0ef60 JH |
955 | @echo "Now you may run perl.pixie and then run pixie." |
956 | ||
957 | # Gprof Perl | |
958 | ||
959 | perl.config.dashpg: | |
960 | @echo "Checking optimize='-pg' in config.sh..." | |
961 | @grep "^optimize=" config.sh | |
64778e5f | 962 | @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1 |
83f0ef60 JH |
963 | |
964 | perl.gprof.config: config.sh | |
965 | @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..." | |
966 | @$(MAKE) perl.config.dashpg | |
967 | ||
968 | perl.gprof: /usr/bin/gprof perl.gprof.config | |
64778e5f | 969 | @-rm -f perl |
51a35ef1 | 970 | $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl |
83f0ef60 | 971 | @echo "Now you may run perl.gprof and then run gprof perl.gprof." |
4ae3d70a | 972 | |
51a35ef1 JH |
973 | # Gcov Perl |
974 | ||
975 | perl.config.gcov: | |
976 | @echo "To build perl.gcov you must use gcc 3.0 or newer, checking..." | |
977 | @echo "Checking gccversion in config.sh..." | |
978 | @grep "^gccversion=" config.sh | |
979 | @grep "^gccversion='[3-9]\." config.sh >/dev/null || exit 1 | |
980 | @echo "To build perl.gcov you must Configure -Dccflags=-fprofile-arcs -ftest-coverage, checking..." | |
981 | @echo "Checking ccflags='-fprofile-arcs -ftest-coverage' in config.sh..." | |
982 | @grep "^ccflags=" config.sh | |
983 | @grep "^ccflags='.*-fprofile-arcs -ftest-coverage.*'" config.sh >/dev/null || exit 1 | |
984 | ||
985 | perl.gcov: perl.config.gcov | |
986 | @-rm -f perl | |
987 | $(MAKE) PERL_SUFFIX=.gcov PERL_PROFILE_LDFLAGS='' perl | |
988 | @echo "Now you may run perl.gcov and then run gcov some.c." | |
989 | ||
f946bb38 JH |
990 | # Microperl. This is just a convenience thing if one happens to |
991 | # build also the full Perl and therefore the real big Makefile: | |
f4db5405 | 992 | # usually one should manually explicitly issue the below command. |
f946bb38 | 993 | |
869a466c | 994 | .PHONY: microperl |
f946bb38 JH |
995 | microperl: |
996 | $(MAKE) -f Makefile.micro | |
997 | ||
fe5460cc RT |
998 | !NO!SUBS! |
999 | ||
599a829f IZ |
1000 | fi |
1001 | ||
6d4b7d88 JH |
1002 | # Some environment have no system(), which mkpport uses. |
1003 | # Let's try running the commands with shell. | |
1004 | case "${osname}" in | |
1005 | catamount) | |
5a20539c | 1006 | $spitshell >>$Makefile <<!GROK!THIS! |
6d4b7d88 | 1007 | .PHONY: makeppport |
199863e7 | 1008 | makeppport: \$(MINIPERL_EXE) \$(CONFIGPM) |
6d4b7d88 | 1009 | -@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \ |
199863e7 | 1010 | (cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \ |
6d4b7d88 JH |
1011 | done |
1012 | ||
1013 | !GROK!THIS! | |
1014 | ;; | |
1015 | *) | |
5a20539c | 1016 | $spitshell >>$Makefile <<'!NO!SUBS!' |
6d4b7d88 | 1017 | .PHONY: makeppport |
199863e7 NC |
1018 | makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext) |
1019 | $(MINIPERL) $(Icwd) mkppport | |
6d4b7d88 JH |
1020 | |
1021 | !NO!SUBS! | |
1022 | ;; | |
1023 | esac | |
1024 | ||
5a20539c | 1025 | $spitshell >>$Makefile <<'!NO!SUBS!' |
599a829f | 1026 | |
869a466c | 1027 | .PHONY: preplibrary |
7353f64c | 1028 | preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL) |
2304df62 | 1029 | |
0f13ebd5 NC |
1030 | $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD) |
1031 | ||
1032 | $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl | |
199863e7 | 1033 | $(MINIPERL) configpm |
2304df62 | 1034 | |
199863e7 NC |
1035 | lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM) |
1036 | $(MINIPERL) minimod.pl > lib/ExtUtils/Miniperl.pm | |
fed7345c | 1037 | |
5e4c4c91 NC |
1038 | lib/buildcustomize.pl: $(MINIPERL_EXE) write_buildcustomize.pl |
1039 | $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl | |
1040 | ||
58fa074c | 1041 | unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data |
6c684aee | 1042 | |
199863e7 | 1043 | uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext) |
3df51b85 | 1044 | $(MINIPERL) $(Icwd) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p |
f86864ac KW |
1045 | # Commented out so always runs, mktables looks at far more files than we |
1046 | # can in this makefile to decide if needs to run or not | |
1047 | # touch uni.data | |
5ad7e614 | 1048 | |
34b80e25 | 1049 | # $(PERL_EXE) and ext because buildtoc uses Text::Wrap uses re |
7eb47696 NC |
1050 | # But also this ensures that all extensions are built before we try to scan |
1051 | # them, which picks up Devel::PPPort's documentation. | |
34b80e25 | 1052 | pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc |
b78c1104 | 1053 | $(RUN_PERL) -f -Ilib pod/buildtoc -q |
7eb47696 | 1054 | |
0f13ebd5 NC |
1055 | pod/perlapi.pod: pod/perlintern.pod |
1056 | ||
1057 | pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc | |
199863e7 | 1058 | $(MINIPERL) autodoc.pl |
344af494 | 1059 | |
199863e7 NC |
1060 | pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST |
1061 | $(MINIPERL) $(Icwd) pod/perlmodlib.PL -q | |
6e2c8928 | 1062 | |
7e7cfa2d FR |
1063 | pod/perl5176delta.pod: pod/perldelta.pod |
1064 | $(RMS) pod/perl5176delta.pod | |
1065 | $(LNS) perldelta.pod pod/perl5176delta.pod | |
8e7bc40f | 1066 | |
199863e7 | 1067 | extra.pods: $(MINIPERL_EXE) |
ebbebb7c | 1068 | -@test ! -f extra.pods || rm -f `cat extra.pods` |
72b3d9b4 | 1069 | -@rm -f extra.pods |
b4bc034f | 1070 | -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \ |
72b3d9b4 | 1071 | nx=`echo $$x | sed -e "s/README\.//"`; \ |
e0be038f | 1072 | $(LNS) ../$$x "pod/perl"$$nx".pod" ; \ |
72b3d9b4 GS |
1073 | echo "pod/perl"$$nx".pod" >> extra.pods ; \ |
1074 | done | |
ebbebb7c | 1075 | |
34b80e25 JV |
1076 | extras.make: $(PERL_EXE) |
1077 | -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` | |
bf35c3f6 | 1078 | |
34b80e25 JV |
1079 | extras.test: $(PERL_EXE) |
1080 | -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` | |
bf35c3f6 | 1081 | |
34b80e25 JV |
1082 | extras.install: $(PERL_EXE) |
1083 | -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` | |
bf35c3f6 | 1084 | |
869a466c | 1085 | .PHONY: install install-strip install-all install-verbose install-silent \ |
5e2f386f | 1086 | no-install install.perl install.man install.html |
869a466c | 1087 | |
59c72abb | 1088 | install_strip install-strip: |
70eaf669 | 1089 | $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)" |
f556e5b9 | 1090 | |
59c72abb | 1091 | install install_all install-all: |
70eaf669 | 1092 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)" |
c77385cf | 1093 | |
59c72abb | 1094 | install_verbose install-verbose: |
70eaf669 | 1095 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)" |
c458b76c | 1096 | |
59c72abb | 1097 | install_silent install-silent: |
70eaf669 | 1098 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)" |
4ad019ef | 1099 | |
59c72abb | 1100 | no_install no-install: |
70eaf669 | 1101 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)" |
16d20bd9 | 1102 | |
70eaf669 IZ |
1103 | # Set this to an empty string to avoid an attempt of rebuild before install |
1104 | INSTALL_DEPENDENCE = all | |
1105 | ||
1106 | install.perl: $(INSTALL_DEPENDENCE) installperl | |
34b80e25 | 1107 | $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) |
3eb2897c | 1108 | -@test ! -s extras.lst || $(MAKE) extras.install |
a0d0e21e | 1109 | |
b1a1e9f1 | 1110 | install.man: all installman |
34b80e25 | 1111 | $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS) |
16d20bd9 | 1112 | |
84902520 TB |
1113 | # XXX Experimental. Hardwired values, but useful for testing. |
1114 | # Eventually Configure could ask for some of these values. | |
1115 | install.html: all installhtml | |
40096396 | 1116 | -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd .. |
34b80e25 | 1117 | $(RUN_PERL) installhtml \ |
84902520 | 1118 | --podroot=. --podpath=. --recurse \ |
47ec63d0 RGS |
1119 | --htmldir=$(privlib)/html \ |
1120 | --htmlroot=$(privlib)/html \ | |
84902520 TB |
1121 | --splithead=pod/perlipc \ |
1122 | --splititem=pod/perlfunc \ | |
e2b41a3f | 1123 | --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \ |
84902520 TB |
1124 | --verbose |
1125 | ||
16d20bd9 | 1126 | |
a0d0e21e | 1127 | # I now supply perly.c with the kits, so the following section is |
0de566d7 DM |
1128 | # used only if you force bison to run by saying |
1129 | # make regen_perly | |
1130 | # You normally shouldn't remake perly.[ch]. | |
1131 | ||
1132 | .PHONY: regen_perly | |
1133 | ||
59c72abb | 1134 | run_byacc run-byacc: |
0de566d7 DM |
1135 | @echo "run_byacc is obsolete; try 'make regen_perly' instead" |
1136 | ||
f05e27e5 | 1137 | # this outputs perly.h, perly.act and perly.tab |
59c72abb | 1138 | regen_perly regen-perly: |
0de566d7 | 1139 | perl regen_perly.pl |
56febc5e AD |
1140 | |
1141 | # We don't want to regenerate perly.c and perly.h, but they might | |
1142 | # appear out-of-date after a patch is applied or a new distribution is | |
1143 | # made. | |
92c28edd | 1144 | perly.c: perly.y |
b233458b JH |
1145 | -@sh -c true |
1146 | ||
92c28edd | 1147 | perly.h: perly.y |
b233458b JH |
1148 | -@sh -c true |
1149 | ||
d500e60d | 1150 | SYM = globvar.sym perlio.sym |
419eaf7b | 1151 | |
907b3e23 | 1152 | SYMH = perlvars.h intrpvar.h |
419eaf7b | 1153 | |
dae78bb1 IZ |
1154 | CHMOD_W = chmod +w |
1155 | ||
a8581515 | 1156 | # The following files are generated automatically |
d500e60d | 1157 | # embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c |
897d3989 | 1158 | # opcode.pl: opcode.h opnames.h pp_proto.h |
c83f8f39 JH |
1159 | # regcomp.pl: regnodes.h |
1160 | # warnings.pl: warnings.h lib/warnings.pm | |
f2c01b15 | 1161 | # feature.pl: feature.h lib/feature.pm |
e50aee73 AD |
1162 | # The correct versions should be already supplied with the perl kit, |
1163 | # in case you don't have perl available. | |
36bb303b | 1164 | # To force them to be regenerated, run |
9ad884cb | 1165 | # perl regen.pl |
36bb303b NC |
1166 | # with your existing copy of perl |
1167 | # (make regen_headers is kept for backwards compatibility) | |
e1354ed6 | 1168 | |
d500e60d | 1169 | AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \ |
69bcf1d3 | 1170 | perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm \ |
f2c01b15 | 1171 | lib/feature.pm feature.h |
e1354ed6 | 1172 | |
1e2f36ef | 1173 | .PHONY: regen_headers regen_all |
869a466c | 1174 | |
95aa0565 | 1175 | regen: FORCE |
9ad884cb | 1176 | -perl regen.pl |
2caceca9 | 1177 | -perl regen/uconfig_h.pl |
8e07c86e | 1178 | |
59c72abb | 1179 | regen_headers regen-headers: FORCE |
95aa0565 | 1180 | -perl regen.pl -v |
2caceca9 | 1181 | -perl regen/uconfig_h.pl -v |
95aa0565 | 1182 | |
59c72abb | 1183 | regen_meta regen-meta: META.yml |
de65cabd JV |
1184 | |
1185 | META.yml: FORCE | |
1186 | PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta | |
1187 | ||
1188 | ||
59c72abb | 1189 | regen_all regen-all: regen regen_meta |
9fec149b | 1190 | |
1aea71db A |
1191 | .PHONY: manisort manicheck |
1192 | ||
1193 | manisort: FORCE | |
4e86fc4b JH |
1194 | @perl Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \ |
1195 | perl Porting/manisort -q -o MANIFEST; sh -c true) | |
1aea71db A |
1196 | |
1197 | manicheck: FORCE | |
1198 | perl Porting/manicheck | |
1199 | ||
a0d0e21e | 1200 | # Extensions: |
4318d5a0 GB |
1201 | # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will |
1202 | # automatically get built. There should ordinarily be no need to change | |
1203 | # any of this part of makefile. | |
a0d0e21e LW |
1204 | # |
1205 | # The dummy dependency is a place holder in case $(dynamic_ext) or | |
1206 | # $(static_ext) is empty. | |
1207 | # | |
1208 | # DynaLoader may be needed for extensions that use Makefile.PL. | |
1209 | ||
5e4c4c91 | 1210 | $(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext) |
199863e7 | 1211 | $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) |
a0d0e21e | 1212 | |
5e4c4c91 | 1213 | d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) |
199863e7 | 1214 | $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic |
a0d0e21e | 1215 | |
5e4c4c91 | 1216 | s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE |
199863e7 | 1217 | $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) |
2304df62 | 1218 | |
5e4c4c91 | 1219 | n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE |
199863e7 | 1220 | $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
9f3ef600 NC |
1221 | !NO!SUBS! |
1222 | ||
5a20539c | 1223 | $spitshell >>$Makefile <<EOF |
9f3ef600 NC |
1224 | $extra_dep |
1225 | EOF | |
1226 | ||
5a20539c | 1227 | $spitshell >>$Makefile <<'!NO!SUBS!' |
4318d5a0 | 1228 | |
a774dfe6 RSG |
1229 | .PHONY: printconfig |
1230 | printconfig: | |
34b80e25 | 1231 | @eval `$(RUN_PERL) -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR) |
a774dfe6 | 1232 | |
869a466c JH |
1233 | .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \ |
1234 | realclean _realcleaner clobber _clobber \ | |
6e2cec71 | 1235 | distclean veryclean _verycleaner |
869a466c | 1236 | |
6e2cec71 | 1237 | clean: _tidy _mopup |
70af249b | 1238 | |
6e2cec71 | 1239 | realclean: _realcleaner _mopup |
fcfe1ab7 | 1240 | @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh" |
70af249b | 1241 | |
b37ebb13 | 1242 | _clobber: |
5440bc8e | 1243 | -@rm -f Cross/run-* Cross/to-* Cross/from-* |
0279961e | 1244 | rm -f t/test_state |
bf35c3f6 | 1245 | rm -f config.sh cppstdin Policy.sh extras.lst |
b37ebb13 | 1246 | |
6e2cec71 | 1247 | clobber: _realcleaner _mopup _clobber |
70af249b CS |
1248 | |
1249 | distclean: clobber | |
1250 | ||
2edbd6da | 1251 | # Like distclean but also removes emacs backups and *.orig. |
6e2cec71 | 1252 | veryclean: _verycleaner _mopup _clobber |
b37ebb13 | 1253 | -@rm -f Obsolete Wanted |
2edbd6da | 1254 | |
70af249b CS |
1255 | # Do not 'make _mopup' directly. |
1256 | _mopup: | |
9387abf8 | 1257 | rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers) |
1ed50e5b | 1258 | -rmdir .depending |
72b3d9b4 | 1259 | -@test -f extra.pods && rm -f `cat extra.pods` |
b4bc034f | 1260 | -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod |
60f0ee9d | 1261 | -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall |
d96ebe2e | 1262 | -rm -f perl.export perl.dll perl.libexp perl.map perl.def |
1cfa4ec7 | 1263 | -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap |
9d4d067b | 1264 | -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log |
6a966751 | 1265 | -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs |
93c0359c | 1266 | -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok |
ce0286c6 | 1267 | -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump |
34b80e25 | 1268 | -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl |
95aef5ce | 1269 | -rm -f config.arch config.over $(DTRACE_H) runtests |
70af249b CS |
1270 | |
1271 | # Do not 'make _tidy' directly. | |
1272 | _tidy: | |
e3f83878 JH |
1273 | -cd pod; $(LDLIBPTH) $(MAKE) clean |
1274 | -cd utils; $(LDLIBPTH) $(MAKE) clean | |
1275 | -cd x2p; $(LDLIBPTH) $(MAKE) clean | |
ff346313 | 1276 | -rm -f lib/Config_git.pl git_version.h |
4318d5a0 | 1277 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
199863e7 | 1278 | $(MINIPERL) make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \ |
a0d0e21e | 1279 | done |
ff68c719 | 1280 | |
2edbd6da | 1281 | _cleaner1: |
4633a7c4 | 1282 | -cd os2; rm -f Makefile |
2edbd6da JH |
1283 | -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) |
1284 | -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) | |
1285 | -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) | |
199863e7 | 1286 | -@if test -f $(MINIPERL_EXE) ; then \ |
61edc683 | 1287 | for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
199863e7 | 1288 | $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \ |
61edc683 NC |
1289 | done ; \ |
1290 | else \ | |
1291 | sh $(CLEAN).sh ; \ | |
1292 | fi | |
1293 | rm -f realclean.sh veryclean.sh | |
0d4cbbcf NC |
1294 | -for file in `find cpan dist ext -name ppport.h` ; do rm -f $$file; done |
1295 | ||
1296 | # Dear POSIX, thanks for making the default to xargs to be | |
1297 | # run once if nothhing is passed in. It is such a great help. | |
2edbd6da | 1298 | |
2ad994b6 | 1299 | # Some systems do not support "?", so keep these files separate. |
2edbd6da | 1300 | _cleaner2: |
2ad994b6 | 1301 | -rm -f core.*perl.*.? t/core.perl.*.? .?*.c |
5033177e | 1302 | rm -f core *perl.core t/core t/*perl.core core.* t/core.* |
f18bc4a8 NC |
1303 | rm -f t/$(PERL_EXE) t/rantests |
1304 | rm -rf t/tmp* | |
2ad994b6 | 1305 | rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) |
a0d0e21e | 1306 | rm -rf $(addedbyconf) |
0eb4e931 | 1307 | rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old |
c27f7bb1 | 1308 | rm -f $(private) |
ca12659b | 1309 | rm -rf $(unidatafiles) $(unidatadirs) |
a0d0e21e | 1310 | rm -rf lib/auto |
07a6e20d | 1311 | rm -f lib/.exists lib/*/.exists lib/*/*/.exists |
16d20bd9 | 1312 | rm -f h2ph.man pstruct |
a0d0e21e | 1313 | rm -rf .config |
7353f64c | 1314 | rm -f preload |
0f4f294e | 1315 | rm -rf lib/Encode lib/Compress lib/Hash lib/re |
c146e560 | 1316 | rm -rf lib/TAP lib/Module/Pluggable lib/App |
b2685f0c | 1317 | rm -rf lib/mro |
42182ddc | 1318 | rm -rf lib/IO/Compress lib/IO/Uncompress |
fc2730c3 RGS |
1319 | rm -f lib/ExtUtils/ParseXS/t/XSTest.c |
1320 | rm -f lib/ExtUtils/ParseXS/t/XSTest$(OBJ_EXT) | |
1321 | rm -f lib/ExtUtils/ParseXS/t/XSTest$(DLSUFFIX) | |
b6c155fe | 1322 | rm -fr lib/B |
71eaafb1 RGS |
1323 | rm -fr lib/CPAN lib/CPANPLUS |
1324 | rm -fr lib/ExtUtils/CBuilder | |
d689ebe1 | 1325 | rm -f pod2htmd.tmp |
708a028c | 1326 | rm -rf pod/perlfunc pod/perlipc |
71eaafb1 RGS |
1327 | -rmdir cpan/CPANPLUS-Dist-Build/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-localmirror |
1328 | -rmdir ext/B/lib | |
1329 | -rmdir lib/Archive/Tar lib/Archive lib/Attribute | |
476b2fe1 | 1330 | -rmdir lib/CGI lib/Carp |
71eaafb1 RGS |
1331 | -rmdir lib/Data lib/Devel lib/Digest |
1332 | -rmdir lib/ExtUtils/Command lib/ExtUtils/Constant lib/ExtUtils/Liblist lib/ExtUtils/MakeMaker | |
1333 | -rmdir lib/File/Spec lib/Filter/Util lib/Filter | |
1334 | -rmdir lib/I18N/LangTags lib/IO/Socket lib/IO lib/IPC | |
1335 | -rmdir lib/List/Util lib/List | |
1336 | -rmdir lib/Locale/Maketext lib/Locale | |
1337 | -rmdir lib/Log/Message lib/Log | |
1338 | -rmdir lib/Math/Big* lib/Math | |
1339 | -rmdir lib/Memoize lib/MIME | |
1340 | -rmdir lib/Module/Build/Platform lib/Module/Build lib/Module/Load lib/Module | |
1341 | -rmdir lib/Net/FTP lib/Object | |
1342 | -rmdir lib/Parse/CPAN lib/Parse | |
1343 | -rmdir lib/PerlIO/via lib/PerlIO | |
1344 | -rmdir lib/Package lib/Params | |
1345 | -rmdir lib/Pod/Perldoc lib/Pod/Simple lib/Pod/Text | |
1346 | -rmdir lib/Sys lib/Scalar/Util lib/Scalar | |
8cf6f931 | 1347 | -rmdir lib/Term/UI lib/Thread lib/Tie/Hash |
71eaafb1 RGS |
1348 | -rmdir lib/Test/Builder/Tester lib/Test/Builder lib/Test |
1349 | -rmdir lib/Unicode/Collate | |
1350 | -rmdir lib/XS/APItest lib/XS | |
1351 | -rmdir lib/inc/latest lib/inc | |
1352 | -rmdir lib/autodie/exception lib/autodie lib/encoding lib/threads | |
b0d7393a JH |
1353 | -rm -f lib/ExtUtils/CBuilder/t/libcompilet.dll.a |
1354 | -rm -f lib/ExtUtils/ParseXS/t/libXSTest.dll.a | |
ecfc5424 | 1355 | |
f4db5405 | 1356 | _realcleaner: |
95aef5ce | 1357 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=distclean |
2edbd6da JH |
1358 | @$(LDLIBPTH) $(MAKE) _cleaner2 |
1359 | ||
f4db5405 | 1360 | _verycleaner: |
2edbd6da JH |
1361 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean |
1362 | @$(LDLIBPTH) $(MAKE) _cleaner2 | |
c94787a5 | 1363 | -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig |
2edbd6da | 1364 | |
869a466c | 1365 | .PHONY: lint |
bf0dfd28 | 1366 | lint: $(c) |
075abff3 | 1367 | rm -f *.ln |
66a1b24b | 1368 | lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c) |
2304df62 | 1369 | |
abcf5ada AL |
1370 | .PHONY: splint |
1371 | splint: $(c) | |
1372 | splint $(splintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(splintfiles) | |
1373 | ||
fb73857a | 1374 | # Need to unset during recursion to go out of loop. |
1375 | # The README below ensures that the dependency list is never empty and | |
1376 | # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding. | |
cd4d8a96 | 1377 | |
84902520 | 1378 | MAKEDEPEND = Makefile makedepend |
cd4d8a96 | 1379 | |
fb73857a | 1380 | $(FIRSTMAKEFILE): README $(MAKEDEPEND) |
cd4d8a96 | 1381 | $(MAKE) depend MAKEDEPEND= |
a0d0e21e | 1382 | |
599a829f | 1383 | config.h: config_h.SH config.sh |
655635e8 | 1384 | $(SHELL) config_h.SH |
1385 | ||
869a466c | 1386 | .PHONY: depend |
2304df62 | 1387 | depend: makedepend |
fb73857a | 1388 | sh ./makedepend MAKE=$(MAKE) |
2304df62 AD |
1389 | cd x2p; $(MAKE) depend |
1390 | ||
cd4d8a96 | 1391 | # Cannot postpone this until $firstmakefile is ready ;-) |
92c28edd JH |
1392 | makedepend: makedepend.SH config.sh |
1393 | sh ./makedepend.SH | |
cd4d8a96 | 1394 | |
9aa28017 NC |
1395 | runtests: runtests.SH config.sh |
1396 | sh ./runtests.SH | |
1397 | ||
9988b539 | 1398 | .PHONY: test check test_prep test_prep_nodll test_prep_pre \ |
ec81ed5d | 1399 | test_prep_reonly test_tty test-tty test_notty test-notty \ |
e018f8be | 1400 | utest ucheck test.utf8 check.utf8 test.torture torturetest \ |
1de9afcd | 1401 | test.utf16 check.utf16 utest.utf16 ucheck.utf16 \ |
869a466c | 1402 | test.third check.third utest.third ucheck.third test_notty.third \ |
69bfbd2f | 1403 | test.deparse test_notty.deparse test_harness test_harness_notty \ |
f258a656 NC |
1404 | minitest coretest test.taintwarn test-reonly _test |
1405 | ||
1406 | _test: | |
1407 | echo >&2 The _test target is deprecated. Please upgrade your smoker | |
5fb77da4 | 1408 | PERL=./perl $(RUN_TESTS) choose |
869a466c | 1409 | |
ec861bc1 JH |
1410 | # Cannot delegate rebuilding of t/perl to make |
1411 | # to allow interlaced test and minitest | |
3e3baf6d | 1412 | |
1167a30e IZ |
1413 | # Architecture-neutral stuff: |
1414 | ||
1415 | test_prep_pre: preplibrary utilities $(nonxs_ext) | |
1416 | ||
59c72abb | 1417 | test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \ |
9f417383 NC |
1418 | $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \ |
1419 | $(generated_pods) | |
34b80e25 | 1420 | cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) |
a0ed51b3 | 1421 | |
34b80e25 | 1422 | test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL) |
ec81ed5d | 1423 | $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic |
34b80e25 | 1424 | cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) |
ec81ed5d | 1425 | |
937aca76 | 1426 | test check: test_prep |
5fb77da4 | 1427 | $(RUN_TESTS) choose |
ec861bc1 | 1428 | |
59c72abb | 1429 | test_tty test-tty: test_prep |
5fb77da4 | 1430 | $(RUN_TESTS) tty |
ec861bc1 | 1431 | |
59c72abb | 1432 | test_notty test-notty: test_prep |
5fb77da4 | 1433 | $(RUN_TESTS) no-tty |
ec861bc1 | 1434 | |
83f0ef60 | 1435 | utest ucheck test.utf8 check.utf8: test_prep |
5fb77da4 | 1436 | TEST_ARGS=-utf8 $(RUN_TESTS) choose |
ec861bc1 | 1437 | |
5a6e071d | 1438 | coretest: test_prep |
5fb77da4 | 1439 | TEST_ARGS=-core $(RUN_TESTS) choose |
5a6e071d | 1440 | |
e018f8be JH |
1441 | # Torture testing |
1442 | ||
1443 | test.torture torturetest: test_prep | |
5fb77da4 | 1444 | TEST_ARGS=-torture $(RUN_TESTS) choose |
e018f8be | 1445 | |
1de9afcd RGS |
1446 | # Targets for UTF16 testing: |
1447 | ||
1448 | minitest.utf16: minitest.prep | |
34b80e25 | 1449 | - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \ |
115e9681 | 1450 | && $(RUN_PERL) TEST -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty |
1de9afcd RGS |
1451 | |
1452 | test.utf16 check.utf16: test_prep | |
5fb77da4 | 1453 | TEST_ARGS=-utf16 $(RUN_TESTS) choose |
1de9afcd RGS |
1454 | |
1455 | utest.utf16 ucheck.utf16: test_prep | |
5fb77da4 | 1456 | TEST_ARGS="-utf8 -utf16" $(RUN_TESTS) choose |
1de9afcd | 1457 | |
45ed6be3 JC |
1458 | !NO!SUBS! |
1459 | ||
1460 | case "${osname}${osvers}" in | |
09617314 | 1461 | linux*|darwin*) |
45ed6be3 | 1462 | $spitshell >>$Makefile <<'!NO!SUBS!' |
7a834142 JH |
1463 | # Targets for valgrind testing: |
1464 | ||
1465 | test_prep.valgrind: test_prep perl.valgrind | |
7a834142 JH |
1466 | |
1467 | test.valgrind check.valgrind: test_prep perl.valgrind.config | |
5fb77da4 | 1468 | PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(RUN_TESTS) choose |
7a834142 | 1469 | |
78f158d1 | 1470 | utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config |
5fb77da4 | 1471 | PERL_VALGRIND=1 TEST_ARGS=-utf8 $(RUN_TESTS) choose |
7a834142 | 1472 | |
78f158d1 | 1473 | test_notty.valgrind: test_prep.valgrind perl.valgrind.config |
5fb77da4 | 1474 | PERL_VALGRIND=1 $(RUN_TESTS) no-tty |
45ed6be3 JC |
1475 | !NO!SUBS! |
1476 | ;; | |
1477 | esac | |
1478 | ||
1479 | $spitshell >>$Makefile <<'!NO!SUBS!' | |
7a834142 | 1480 | |
ec861bc1 JH |
1481 | # Targets for Third Degree testing. |
1482 | ||
9b99345a | 1483 | test_prep.third: test_prep perl.third |
e75f8ea9 | 1484 | cd t && (rm -f ./perl.third$(EXE_EXT); $(LNS) ../perl.third$(EXE_EXT) perl.third(EXE_EXT)) |
ec861bc1 | 1485 | |
937aca76 | 1486 | test.third check.third: test_prep.third perl.third |
5fb77da4 | 1487 | PERL=./perl.third PERL_3LOG=1 $(RUN_TESTS) choose |
ec861bc1 | 1488 | |
937aca76 | 1489 | utest.third ucheck.third: test_prep.third perl.third |
5fb77da4 | 1490 | PERL=./perl.third PERL_3LOG=1 TEST_ARGS=-utf8 $(RUN_TESTS) choose |
ec861bc1 | 1491 | |
937aca76 | 1492 | test_notty.third: test_prep.third perl.third |
5fb77da4 | 1493 | PERL=./perl.third PERL_3LOG=1 $(RUN_TESTS) choose |
2304df62 | 1494 | |
35117553 JH |
1495 | # Targets for Deparse testing. |
1496 | ||
1497 | test.deparse: test_prep | |
5fb77da4 | 1498 | TEST_ARGS=-deparse $(RUN_TESTS) choose |
35117553 JH |
1499 | |
1500 | test_notty.deparse: test_prep | |
5fb77da4 | 1501 | TEST_ARGS=-deparse $(RUN_TESTS) no-tty |
35117553 | 1502 | |
b26492ee RGS |
1503 | # Targets to run the test suite with -t |
1504 | ||
1505 | test.taintwarn: test_prep | |
5fb77da4 | 1506 | TEST_ARGS=-taintwarn $(RUN_TESTS) choose |
b26492ee | 1507 | |
1de9afcd | 1508 | minitest.prep: |
8a71e97e | 1509 | -@test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles) |
4fa3f26e | 1510 | @echo " " |
d96ebe2e | 1511 | @echo "You may see some irrelevant test failures if you have been unable" |
82dee7de | 1512 | @echo "to build lib/Config.pm, or the Unicode data files." |
4fa3f26e | 1513 | @echo " " |
1de9afcd RGS |
1514 | |
1515 | # Can't depend on lib/Config.pm because that might be where miniperl | |
1516 | # is crashing. | |
7353f64c | 1517 | minitest: $(MINIPERL_EXE) minitest.prep |
34b80e25 | 1518 | - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \ |
115e9681 | 1519 | && $(RUN_PERL) TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t op/*.t uni/*.t </dev/tty |
16d20bd9 | 1520 | |
1167a30e IZ |
1521 | # Test via harness |
1522 | ||
59c72abb | 1523 | test_harness test-harness: test_prep |
5fb77da4 | 1524 | TESTFILE=harness $(RUN_TESTS) choose |
1167a30e | 1525 | |
69bfbd2f | 1526 | test_harness_notty: test_prep |
5fb77da4 | 1527 | HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose |
69bfbd2f | 1528 | |
59c72abb | 1529 | test_reonly test-reonly: test_prep_reonly |
5fb77da4 | 1530 | TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose |
4979e288 | 1531 | |
1e547844 JV |
1532 | |
1533 | # Porting tests (well-formedness of pod, manifest, etc) | |
1534 | ||
59c72abb | 1535 | test_porting test-porting: test_prep |
48d97dac | 1536 | cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t |
1e547844 | 1537 | |
fb73857a | 1538 | # Handy way to run perlbug -ok without having to install and run the |
84902520 | 1539 | # installed perlbug. We don't re-run the tests here - we trust the user. |
fb73857a | 1540 | # Please *don't* use this unless all tests pass. |
1d2dff63 | 1541 | # If you want to report test failures, use "make nok" instead. |
869a466c JH |
1542 | |
1543 | .PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack | |
1544 | ||
188cd53f | 1545 | ok: utilities |
34b80e25 | 1546 | $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' |
84902520 | 1547 | |
105f9295 | 1548 | okfile: utilities |
34b80e25 | 1549 | $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok |
105f9295 | 1550 | |
890b8eb0 | 1551 | oknack: utilities |
34b80e25 | 1552 | $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A |
890b8eb0 NC |
1553 | |
1554 | okfilenack: utilities | |
34b80e25 | 1555 | $(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A |
890b8eb0 | 1556 | |
1d2dff63 | 1557 | nok: utilities |
34b80e25 | 1558 | $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' |
1d2dff63 | 1559 | |
b4e8cfaf | 1560 | nokfile: utilities |
34b80e25 | 1561 | $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok |
b4e8cfaf | 1562 | |
890b8eb0 | 1563 | noknack: utilities |
34b80e25 | 1564 | $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A |
890b8eb0 NC |
1565 | |
1566 | nokfilenack: utilities | |
34b80e25 | 1567 | $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A |
890b8eb0 | 1568 | |
467132b9 | 1569 | .PHONY: clist hlist shlist |
869a466c | 1570 | |
85e6fe83 | 1571 | clist: $(c) |
92c28edd | 1572 | echo $(c) | tr ' ' $(TRNL) >.clist |
2304df62 | 1573 | |
85e6fe83 | 1574 | hlist: $(h) |
92c28edd | 1575 | echo $(h) | tr ' ' $(TRNL) >.hlist |
2304df62 | 1576 | |
85e6fe83 | 1577 | shlist: $(sh) |
92c28edd | 1578 | echo $(sh) | tr ' ' $(TRNL) >.shlist |
2304df62 | 1579 | |
92c28edd JH |
1580 | Makefile: Makefile.SH ./config.sh |
1581 | $(SHELL) Makefile.SH | |
760ac839 | 1582 | |
869a466c | 1583 | .PHONY: distcheck |
599a829f | 1584 | distcheck: FORCE |
760ac839 LW |
1585 | perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' |
1586 | ||
dde299c1 | 1587 | .PHONY: ctags |
3ee700d1 | 1588 | |
5c36f626 | 1589 | ctags: |
bf799c64 | 1590 | ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c --exclude=perlmini.c *.c *.h |
5c36f626 | 1591 | |
2304df62 AD |
1592 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
1593 | # If this runs make out of memory, delete /usr/include lines. | |
1594 | !NO!SUBS! | |
1595 | ||
85e6fe83 | 1596 | $eunicefix Makefile |
2304df62 AD |
1597 | case `pwd` in |
1598 | *SH) | |
85e6fe83 | 1599 | $rm -f ../Makefile |
cd4d8a96 | 1600 | $ln Makefile ../Makefile |
2304df62 AD |
1601 | ;; |
1602 | esac | |
cd4d8a96 | 1603 | $rm -f $firstmakefile |
5ff3f7a4 GS |
1604 | |
1605 | # Now do any special processing required before building. | |
1606 | ||
1607 | case "$ebcdic" in | |
2d340b60 | 1608 | define) |
5ff3f7a4 | 1609 | xxx='' |
2d340b60 | 1610 | echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2 |
7a66b286 | 1611 | case "$osname" in |
25e9a2e3 | 1612 | os390|posix-bc) |
e9d08790 | 1613 | if cd x2p |
5ff3f7a4 | 1614 | then |
e9d08790 | 1615 | rm -f y.tab.c y.tab.h |
5928ee40 JH |
1616 | case "$osname" in |
1617 | posix-bc) | |
1618 | # we are using two different yaccs in BS2000 Posix! | |
1619 | byacc a2p.y >/dev/null 2>&1 | |
1620 | ;; | |
1621 | *) # e.g. os390 | |
1622 | yacc a2p.y >/dev/null 2>&1 | |
1623 | ;; | |
1624 | esac | |
e9d08790 JH |
1625 | if cmp -s y.tab.c a2p.c |
1626 | then | |
1627 | rm -f y.tab.c | |
1628 | else | |
1629 | echo "a2p.y -> a2p.c" >&2 | |
1630 | mv -f y.tab.c a2p.c | |
1631 | chmod u+w a2p.c | |
1632 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ | |
f1f802f7 | 1633 | -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \ |
e9d08790 JH |
1634 | -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
1635 | xxx="$xxx a2p.c" | |
1636 | fi | |
1637 | # In case somebody yacc -d:ed the a2p.y. | |
1638 | if test -f y.tab.h | |
1639 | then | |
1640 | if cmp -s y.tab.h a2p.h | |
1641 | then | |
1642 | rm -f y.tab.h | |
1643 | else | |
1644 | echo "a2p.h -> a2p.h" >&2 | |
1645 | mv -f y.tab.h a2p.h | |
1646 | xxx="$xxx a2p.h" | |
1647 | fi | |
1648 | fi | |
1649 | cd .. | |
5ff3f7a4 | 1650 | fi |
7a66b286 | 1651 | ;; |
aa34f189 | 1652 | *) |
e9d08790 | 1653 | echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
aa34f189 | 1654 | ;; |
fe572743 | 1655 | esac |
5ff3f7a4 GS |
1656 | case "$xxx" in |
1657 | '') echo "No parser files were regenerated. That's okay." >&2 ;; | |
1658 | esac | |
1659 | ;; | |
1660 | esac | |
1661 | ||
075abff3 | 1662 | # ex: set ts=8 sts=4 sw=4 noet: |