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