Commit | Line | Data |
---|---|---|
599a829f | 1 | #! /bin/sh |
a02608de | 2 | case $PERL_CONFIG_SH in |
2304df62 | 3 | '') |
66b99216 JH |
4 | if test -f config.sh |
5 | then TOP=. | |
2304df62 AD |
6 | else |
7 | echo "Can't find config.sh."; exit 1 | |
8 | fi | |
9 | . $TOP/config.sh | |
10 | ;; | |
11 | esac | |
12 | : This forces SH files to create target in same directory as SH file. | |
13 | : This is so that make depend always knows where to find SH derivatives. | |
14 | case "$0" in | |
15 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
16 | esac | |
17 | ||
2304df62 AD |
18 | case "$d_dosuid" in |
19 | *define*) suidperl='suidperl' ;; | |
20 | *) suidperl='';; | |
21 | esac | |
22 | ||
d5d19f97 | 23 | linklibperl='$(LIBPERL)' |
3c321fdc | 24 | shrpldflags='$(LDDLFLAGS)' |
6ee623d5 | 25 | ldlibpth='' |
ac9901e0 | 26 | DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB' |
d96ebe2e | 27 | case "$useshrplib" in |
28 | true) | |
f4db5405 | 29 | # Prefix all runs of 'miniperl' and 'perl' with |
5cf1d1f1 | 30 | # $ldlibpth so that ./perl finds *this* shared libperl. |
c1b49bc0 GS |
31 | case "$LD_LIBRARY_PATH" in |
32 | '') | |
33 | ldlibpth="LD_LIBRARY_PATH=`pwd`";; | |
34 | *) | |
35 | ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";; | |
36 | esac | |
6ee623d5 | 37 | |
d5d19f97 | 38 | pldlflags="$cccdlflags" |
d96ebe2e | 39 | case "${osname}${osvers}" in |
40 | next4*) | |
3c321fdc | 41 | ld=libtool |
42 | lddlflags="-dynamic -undefined warning -framework System \ | |
43 | -compatibility_version 1 -current_version $patchlevel \ | |
44 | -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@" | |
6ee623d5 | 45 | ;; |
f556e5b9 JH |
46 | rhapsody*|darwin*) |
47 | shrpldflags="${ldflags} -dynamiclib \ | |
c1e7a127 W |
48 | -compatibility_version \ |
49 | ${api_revision}.${api_version}.${api_subversion} \ | |
f556e5b9 | 50 | -current_version \ |
c1e7a127 | 51 | ${revision}.${patchlevel}.${subversion} \ |
f556e5b9 JH |
52 | -install_name \$(shrpdir)/\$@" |
53 | ;; | |
5cf1d1f1 | 54 | cygwin*) |
8736538c AS |
55 | linklibperl="-lperl" |
56 | ;; | |
73d40b3e | 57 | sunos*) |
d5d19f97 UP |
58 | linklibperl="-lperl" |
59 | ;; | |
43039de7 | 60 | netbsd*|freebsd[234]*|openbsd*) |
099685bc JH |
61 | linklibperl="-L. -lperl" |
62 | ;; | |
3c321fdc | 63 | aix*) |
64 | shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" | |
1553ab04 | 65 | case "$osvers" in |
549a6b10 | 66 | 3*) shrpldflags="$shrpldflags -e _nostart" |
1553ab04 | 67 | ;; |
549a6b10 | 68 | *) shrpldflags="$shrpldflags -b noentry" |
1553ab04 TB |
69 | ;; |
70 | esac | |
9c839522 | 71 | shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib" |
549a6b10 | 72 | linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl" |
3c321fdc | 73 | ;; |
1c7d1a19 GS |
74 | hpux*) |
75 | linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl" | |
46193409 | 76 | ;; |
ac9901e0 | 77 | os390*) |
f2766b05 | 78 | shrpldflags='-W l,dll' |
ac9901e0 PP |
79 | linklibperl='libperl.x' |
80 | DPERL_EXTERNAL_GLOB='' | |
81 | ;; | |
655635e8 | 82 | esac |
5cf1d1f1 JH |
83 | case "$ldlibpthname" in |
84 | '') ;; | |
85 | *) | |
86 | case "$osname" in | |
87 | os2) | |
88 | ldlibpth='' | |
89 | ;; | |
5cf1d1f1 JH |
90 | *) |
91 | eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\"" | |
92 | ;; | |
93 | esac | |
c1b49bc0 GS |
94 | # Strip off any trailing :'s |
95 | ldlibpth=`echo $ldlibpth | sed 's/:*$//'` | |
5cf1d1f1 JH |
96 | ;; |
97 | esac | |
d5d19f97 | 98 | ;; |
f0efd8cf | 99 | *) pldlflags='' |
d96ebe2e | 100 | ;; |
ecfc5424 AD |
101 | esac |
102 | ||
a0d0e21e LW |
103 | : Prepare dependency lists for Makefile. |
104 | dynamic_list=' ' | |
105 | for f in $dynamic_ext; do | |
106 | : the dependency named here will never exist | |
ecfc5424 | 107 | base=`echo "$f" | sed 's/.*\///'` |
75f92628 | 108 | dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext" |
a0d0e21e LW |
109 | done |
110 | ||
111 | static_list=' ' | |
a0d0e21e LW |
112 | for f in $static_ext; do |
113 | base=`echo "$f" | sed 's/.*\///'` | |
cd4d8a96 | 114 | static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)" |
a0d0e21e LW |
115 | done |
116 | ||
4318d5a0 GB |
117 | nonxs_list=' ' |
118 | for f in $nonxs_ext; do | |
119 | base=`echo "$f" | sed 's/.*\///'` | |
120 | nonxs_list="$nonxs_list ext/$f/pm_to_blib" | |
121 | done | |
122 | ||
f1f802f7 JH |
123 | # Handle the usage of different yaccs in posix-bc (During Configure we |
124 | # us yacc for perly.y and byacc for a2p.y. The makefiles must use the | |
125 | # same configuration for run_byacc!): | |
126 | case "$osname" in | |
127 | posix-bc) | |
128 | byacc=$yacc | |
129 | ;; | |
130 | esac | |
131 | ||
2304df62 | 132 | echo "Extracting Makefile (with variable substitutions)" |
655635e8 | 133 | $spitshell >Makefile <<!GROK!THIS! |
a0d0e21e | 134 | # Makefile.SH |
85e6fe83 LW |
135 | # This file is derived from Makefile.SH. Any changes made here will |
136 | # be lost the next time you run Configure. | |
655635e8 | 137 | # Makefile is used to generate $firstmakefile. The only difference |
138 | # is that $firstmakefile has the dependencies filled in at the end. | |
2304df62 | 139 | # |
fed7345c | 140 | # |
2304df62 AD |
141 | # I now supply perly.c with the kits, so don't remake perly.c without byacc |
142 | BYACC = $byacc | |
143 | CC = $cc | |
232e078e | 144 | LD = $ld |
16d20bd9 | 145 | |
2304df62 AD |
146 | LDFLAGS = $ldflags |
147 | CLDFLAGS = $ldflags | |
85e6fe83 | 148 | |
2304df62 AD |
149 | mallocsrc = $mallocsrc |
150 | mallocobj = $mallocobj | |
85e6fe83 | 151 | LNS = $lns |
4c901d04 JH |
152 | # NOTE: some systems don't grok "cp -f". XXX Configure test needed? |
153 | CPS = $cp | |
2304df62 | 154 | RMS = rm -f |
85e6fe83 LW |
155 | ranlib = $ranlib |
156 | ||
16d20bd9 AD |
157 | # The following are mentioned only to make metaconfig include the |
158 | # appropriate questions in Configure. If you want to change these, | |
8e07c86e | 159 | # edit config.sh instead, or specify --man1dir=/wherever on |
16d20bd9 AD |
160 | # installman commandline. |
161 | bin = $installbin | |
162 | scriptdir = $scriptdir | |
d96ebe2e | 163 | shrpdir = $archlibexp/CORE |
16d20bd9 AD |
164 | privlib = $installprivlib |
165 | man1dir = $man1dir | |
166 | man1ext = $man1ext | |
167 | man3dir = $man3dir | |
168 | man3ext = $man3ext | |
169 | ||
85e6fe83 LW |
170 | # The following are used to build and install shared libraries for |
171 | # dynamic loading. | |
172 | LDDLFLAGS = $lddlflags | |
3c321fdc | 173 | SHRPLDFLAGS = $shrpldflags |
85e6fe83 | 174 | CCDLFLAGS = $ccdlflags |
a0d0e21e | 175 | DLSUFFIX = .$dlext |
ecfc5424 | 176 | PLDLFLAGS = $pldlflags |
d96ebe2e | 177 | LIBPERL = $libperl |
d5d19f97 | 178 | LLIBPERL= $linklibperl |
ecfc5424 | 179 | SHRPENV = $shrpenv |
a0d0e21e | 180 | |
6ee623d5 | 181 | # The following is used to include the current directory in |
5cf1d1f1 | 182 | # the dynamic loader path you are building a shared libperl. |
6ee623d5 GS |
183 | LDLIBPTH = $ldlibpth |
184 | ||
a0d0e21e LW |
185 | dynamic_ext = $dynamic_list |
186 | static_ext = $static_list | |
4318d5a0 GB |
187 | nonxs_ext = $nonxs_list |
188 | ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext) | |
cd4d8a96 | 189 | DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT) |
2304df62 | 190 | |
9c839522 | 191 | libs = $perllibs $cryptlib |
2304df62 | 192 | |
443a5b98 | 193 | public = perl\$(EXE_EXT) $suidperl utilities translators |
2304df62 AD |
194 | |
195 | shellflags = $shellflags | |
196 | ||
d96ebe2e | 197 | # This is set to MAKE=$make if your $make command doesn't |
198 | # do it for you. | |
199 | $make_set_make | |
4633a7c4 | 200 | |
1fef16b3 JH |
201 | # Mention $gmake here so it gets probed for by Configure. |
202 | ||
dfe9444c | 203 | # These variables may need to be manually set for non-Unix systems. |
ccc7f9b3 | 204 | AR = $full_ar |
dfe9444c AD |
205 | EXE_EXT = $_exe |
206 | LIB_EXT = $_a | |
207 | OBJ_EXT = $_o | |
208 | PATH_SEP = $p_ | |
4633a7c4 LW |
209 | |
210 | FIRSTMAKEFILE = $firstmakefile | |
211 | ||
212 | # Any special object files needed by this architecture, e.g. os2/os2.obj | |
213 | ARCHOBJS = $archobjs | |
214 | ||
89ada9f2 | 215 | .SUFFIXES: .c \$(OBJ_EXT) .i .s |
cd4d8a96 | 216 | |
d96ebe2e | 217 | # grrr |
218 | SHELL = $sh | |
655635e8 | 219 | |
28e8609d JH |
220 | # how to tr(anslate) newlines |
221 | TRNL = '$trnl' | |
222 | ||
82240bfc JH |
223 | OPTIMIZE = $optimize |
224 | ||
3343e82c JH |
225 | EXTRAS = $extras |
226 | ||
bf35c3f6 JH |
227 | INSTALLPREFIXEXP = $prefix |
228 | ||
d56c5707 | 229 | !GROK!THIS! |
b7b35fc2 | 230 | # not used by Makefile but by installperl; |
d56c5707 JH |
231 | # mentioned here so that metaconfig picks these up |
232 | # $installusrbinperl | |
233 | # $versiononly | |
b7b35fc2 | 234 | |
8170cb12 JH |
235 | case "${osname}:${osvers}" in |
236 | darwin:*) | |
237 | $spitshell >>Makefile <<EOF | |
238 | ||
239 | # Your locales are broken (osname $osname, osvers $osvers) | |
240 | # and to avoid the numerous | |
241 | # perl: warning: Setting locale failed. | |
242 | # warnings during the build process we reset the locale variables. | |
243 | ||
244 | LC_ALL=C | |
245 | LANG=C | |
246 | LANGUAGE=C | |
247 | EOF | |
248 | ;; | |
249 | esac | |
2304df62 | 250 | |
85e6fe83 | 251 | ## In the following dollars and backticks do not need the extra backslash. |
2304df62 AD |
252 | $spitshell >>Makefile <<'!NO!SUBS!' |
253 | ||
1167a30e | 254 | CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $(LIBPERL) $@` |
89ada9f2 | 255 | |
1167a30e | 256 | CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $(LIBPERL) $<` |
2304df62 | 257 | |
abae58a6 | 258 | private = preplibrary lib/Config.pm lib/ExtUtils/Miniperl.pm |
2304df62 | 259 | |
4633a7c4 LW |
260 | # Files to be built with variable substitution before miniperl |
261 | # is available. | |
262 | sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \ | |
4755096e | 263 | makedir.SH myconfig.SH writemain.SH pod/Makefile.SH |
4633a7c4 | 264 | |
3ebb1980 | 265 | shextract = Makefile cflags config.h makeaperl makedepend \ |
4755096e | 266 | makedir myconfig writemain pod/Makefile |
4633a7c4 LW |
267 | |
268 | # Files to be built with variable substitution after miniperl is | |
269 | # available. Dependencies handled manually below (for now). | |
2304df62 | 270 | |
efb12ca0 | 271 | pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \ |
4755096e GS |
272 | pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL \ |
273 | pod/buildtoc.PL | |
4633a7c4 | 274 | |
4755096e | 275 | # lib/lib.pm is not listed here because it has a rule of its own. |
efb12ca0 | 276 | plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \ |
4755096e GS |
277 | pod/pod2usage pod/podchecker pod/podselect \ |
278 | pod/buildtoc | |
4633a7c4 | 279 | |
4755096e | 280 | addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct |
2304df62 | 281 | |
fed7345c | 282 | h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h |
a0d0e21e | 283 | h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h |
6f4183fe | 284 | h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h |
219f41b1 | 285 | h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h |
cd1ee231 | 286 | h5 = utf8.h warnings.h sharedsv.h |
33b839e2 | 287 | h = $(h1) $(h2) $(h3) $(h4) $(h5) |
2304df62 | 288 | |
e8edd1e6 | 289 | c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c |
a0ed51b3 | 290 | c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c |
09bef843 | 291 | c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c |
84d4ea48 | 292 | c4 = globals.c perlio.c perlapi.c numeric.c locale.c pp_pack.c pp_sort.c sharedsv.c |
2304df62 | 293 | |
09bef843 | 294 | c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c |
2304df62 | 295 | |
e8edd1e6 | 296 | 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 | 297 | 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) |
84d4ea48 | 298 | 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) numeric$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) sharedsv$(OBJ_EXT) |
655635e8 | 299 | |
4633a7c4 | 300 | obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
2304df62 | 301 | |
a0d0e21e LW |
302 | # Once perl has been Configure'd and built ok you build different |
303 | # perl variants (Debugging, Embedded, Multiplicity etc) by saying: | |
d96ebe2e | 304 | # make clean; make LIBPERL=libperl<type>.a |
a0d0e21e LW |
305 | # where <type> is some combination of 'd' and(or) 'e' or 'm'. |
306 | # See cflags to understand how this works. | |
307 | # | |
d96ebe2e | 308 | # This mechanism is getting clunky and might not even work any more. |
309 | # EMBEDDING is on by default, and MULTIPLICITY doesn't work. | |
310 | # | |
a0d0e21e | 311 | |
2304df62 AD |
312 | lintflags = -hbvxac |
313 | ||
cd4d8a96 | 314 | .c$(OBJ_EXT): |
d96ebe2e | 315 | $(CCCMD) $(PLDLFLAGS) $*.c |
2304df62 | 316 | |
89ada9f2 JH |
317 | .c.i: |
318 | $(CCCMDSRC) -E $*.c > $*.i | |
319 | ||
320 | .c.s: | |
321 | $(CCCMDSRC) -S $*.c | |
322 | ||
869a466c JH |
323 | .PHONY: all compile translators utilities |
324 | ||
443a5b98 | 325 | all: $(FIRSTMAKEFILE) miniperl$(EXE_EXT) extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext) extras.make |
248e23d9 | 326 | @echo " "; |
fcfe1ab7 | 327 | @echo " Everything is up to date. Type '$(MAKE) test' to run test suite." |
909b3858 | 328 | |
6ee623d5 GS |
329 | compile: all |
330 | echo "testing compilation" > testcompile; | |
331 | cd utils; $(MAKE) compile; | |
f4db5405 | 332 | cd x2p; $(MAKE) compile; |
6ee623d5 GS |
333 | cd pod; $(MAKE) compile; |
334 | ||
443a5b98 | 335 | translators: miniperl$(EXE_EXT) lib/Config.pm FORCE |
6ee623d5 | 336 | @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all |
8e07c86e | 337 | |
443a5b98 | 338 | utilities: miniperl$(EXE_EXT) lib/Config.pm $(plextract) lib/lib.pm FORCE |
6ee623d5 | 339 | @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all |
909b3858 | 340 | |
341 | ||
16d20bd9 AD |
342 | # This is now done by installman only if you actually want the man pages. |
343 | # @echo " "; echo " Making docs"; cd pod; $(MAKE) all; | |
85e6fe83 LW |
344 | |
345 | # Phony target to force checking subdirectories. | |
e50aee73 | 346 | # Apparently some makes require an action for the FORCE target. |
869a466c | 347 | .PHONY: FORCE |
85e6fe83 | 348 | FORCE: |
4633a7c4 | 349 | @sh -c true |
ac9901e0 PP |
350 | !NO!SUBS! |
351 | $spitshell >>Makefile <<!GROK!THIS! | |
85e6fe83 | 352 | |
4ba7095c JH |
353 | # We do a copy of the op.c instead of a symlink because gcc gets huffy |
354 | # if we have a symlink forest to another disk (it complains about too many | |
355 | # levels of symbolic links, even if we have only two) | |
356 | ||
ac9901e0 PP |
357 | opmini\$(OBJ_EXT): op.c config.h |
358 | \$(RMS) opmini.c | |
359 | \$(CPS) op.c opmini.c | |
360 | \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c | |
361 | \$(RMS) opmini.c | |
bd0dd1d8 | 362 | |
ac9901e0 PP |
363 | !GROK!THIS! |
364 | $spitshell >>Makefile <<'!NO!SUBS!' | |
517e7c64 | 365 | miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h |
92c28edd | 366 | $(CCCMD) $(PLDLFLAGS) $*.c |
ecfc5424 | 367 | |
92c28edd | 368 | perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) |
e8827f64 | 369 | sh writemain $(DYNALOADER) $(static_ext) > writemain.tmp |
92c28edd | 370 | sh mv-if-diff writemain.tmp perlmain.c |
85e6fe83 | 371 | |
cd4d8a96 | 372 | perlmain$(OBJ_EXT): perlmain.c |
92c28edd | 373 | $(CCCMD) $(PLDLFLAGS) $*.c |
85e6fe83 | 374 | |
a0d0e21e LW |
375 | # The file ext.libs is a list of libraries that must be linked in |
376 | # for static extensions, e.g. -lm -lgdbm, etc. The individual | |
377 | # static extension Makefile's add to it. | |
fed7345c | 378 | ext.libs: $(static_ext) |
a0d0e21e | 379 | -@test -f ext.libs || touch ext.libs |
85e6fe83 | 380 | |
ecfc5424 | 381 | !NO!SUBS! |
599a829f | 382 | |
d96ebe2e | 383 | # How to build libperl. This is still rather convoluted. |
599a829f | 384 | # Load up custom Makefile.SH fragment for shared loading and executables: |
8736538c | 385 | case "$osname" in |
8736538c AS |
386 | *) |
387 | Makefile_s="$osname/Makefile.SHs" | |
388 | ;; | |
389 | esac | |
390 | ||
549a6b10 JH |
391 | case "$osname" in |
392 | aix) | |
393 | $spitshell >>Makefile <<!GROK!THIS! | |
9c839522 | 394 | LIBS = $perllibs |
5f9d9a17 ME |
395 | # In AIX we need to change this for building Perl itself from |
396 | # its earlier definition (which is for building external | |
397 | # extensions *after* Perl has been built and installed) | |
398 | CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'` | |
549a6b10 JH |
399 | |
400 | !GROK!THIS! | |
401 | case "$useshrplib" in | |
402 | define|true|[yY]*) | |
403 | $spitshell >>Makefile <<'!NO!SUBS!' | |
404 | ||
405 | LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT) | |
406 | MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) | |
407 | ||
408 | $(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj) | |
409 | $(RMS) $(LIBPERL_NONSHR) | |
410 | $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj) | |
411 | ||
bd0dd1d8 | 412 | $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) |
a7089531 GS |
413 | $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \ |
414 | opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS) | |
549a6b10 JH |
415 | |
416 | MINIPERLEXP = $(MINIPERL_NONSHR) | |
417 | ||
418 | LIBPERLEXPORT = perl.exp | |
419 | ||
420 | !NO!SUBS! | |
421 | ||
422 | ;; | |
423 | *) | |
424 | $spitshell >>Makefile <<'!NO!SUBS!' | |
425 | MINIPERLEXP = miniperl$(EXE_EXT) | |
426 | ||
427 | PERLEXPORT = perl.exp | |
428 | ||
429 | !NO!SUBS! | |
430 | ;; | |
431 | esac | |
432 | $spitshell >>Makefile <<'!NO!SUBS!' | |
433 | perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) | |
434 | ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp | |
435 | sh mv-if-diff perl.exp.tmp perl.exp | |
436 | ||
437 | !NO!SUBS! | |
438 | ;; | |
2c2d71f5 JH |
439 | os2) |
440 | $spitshell >>Makefile <<'!NO!SUBS!' | |
441 | MINIPERLEXP = miniperl | |
442 | ||
443 | perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map | |
444 | ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp | |
445 | sh mv-if-diff perl.exp.tmp perl5.def | |
446 | ||
447 | !NO!SUBS! | |
448 | ;; | |
549a6b10 JH |
449 | esac |
450 | ||
8736538c AS |
451 | if test -r $Makefile_s ; then |
452 | . $Makefile_s | |
d96ebe2e | 453 | $spitshell >>Makefile <<!GROK!THIS! |
cd4d8a96 | 454 | |
8736538c | 455 | Makefile: $Makefile_s |
cd4d8a96 | 456 | !GROK!THIS! |
457 | else | |
f0efd8cf | 458 | $spitshell >>Makefile <<'!NO!SUBS!' |
549a6b10 | 459 | $(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT) |
9c9e9f08 | 460 | !NO!SUBS! |
d96ebe2e | 461 | case "$useshrplib" in |
462 | true) | |
463 | $spitshell >>Makefile <<'!NO!SUBS!' | |
f2766b05 | 464 | $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj) |
3c321fdc | 465 | !NO!SUBS! |
466 | case "$osname" in | |
467 | aix) | |
468 | $spitshell >>Makefile <<'!NO!SUBS!' | |
28e8609d | 469 | rm -f libperl$(OBJ_EXT) |
3c321fdc | 470 | mv $@ libperl$(OBJ_EXT) |
471 | $(AR) qv $(LIBPERL) libperl$(OBJ_EXT) | |
ecfc5424 | 472 | !NO!SUBS! |
3c321fdc | 473 | ;; |
474 | esac | |
d96ebe2e | 475 | ;; |
476 | *) | |
477 | $spitshell >>Makefile <<'!NO!SUBS!' | |
478 | rm -f $(LIBPERL) | |
479 | $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj) | |
480 | @$(ranlib) $(LIBPERL) | |
655635e8 | 481 | !NO!SUBS! |
d96ebe2e | 482 | ;; |
483 | esac | |
599a829f IZ |
484 | $spitshell >>Makefile <<'!NO!SUBS!' |
485 | ||
486 | # How to build executables. | |
487 | ||
488 | # The $& notation tells Sequent machines that it can do a parallel make, | |
489 | # and is harmless otherwise. | |
490 | # The miniperl -w -MExporter line is a basic cheap test to catch errors | |
491 | # before make goes on to run preplibrary and then MakeMaker on extensions. | |
492 | # This is very handy because later errors are often caused by miniperl | |
493 | # build problems but that's not obvious to the novice. | |
494 | # The Module used here must not depend on Config or any extensions. | |
495 | ||
ecfb2188 GS |
496 | !NO!SUBS! |
497 | ||
498 | case "${osname}${osvers}" in | |
8fdf96e1 | 499 | aix*) |
ecfb2188 | 500 | $spitshell >>Makefile <<'!NO!SUBS!' |
bd0dd1d8 | 501 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) |
8fdf96e1 JH |
502 | $(CC) -o miniperl $(CLDFLAGS) \ |
503 | `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ | |
ecfb2188 | 504 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs) |
bd0dd1d8 | 505 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 GS |
506 | !NO!SUBS! |
507 | ;; | |
8fdf96e1 | 508 | beos*|next4*) |
535d2540 JH |
509 | $spitshell >>Makefile <<'!NO!SUBS!' |
510 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) | |
8fdf96e1 | 511 | $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ |
535d2540 JH |
512 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs) |
513 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest | |
514 | !NO!SUBS! | |
515 | ;; | |
ecfb2188 GS |
516 | *) |
517 | $spitshell >>Makefile <<'!NO!SUBS!' | |
443a5b98 | 518 | miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT) |
93c0359c | 519 | -@rm -f miniperl.xok |
5869b1f1 | 520 | $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \ |
a7089531 | 521 | miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs) |
bd0dd1d8 | 522 | $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
ecfb2188 GS |
523 | !NO!SUBS! |
524 | ;; | |
525 | esac | |
526 | ||
527 | $spitshell >>Makefile <<'!NO!SUBS!' | |
599a829f | 528 | |
443a5b98 | 529 | perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
93c0359c | 530 | -@rm -f miniperl.xok |
51a35ef1 | 531 | $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f | 532 | |
4ae3d70a JH |
533 | # Purify/Quantify Perls. |
534 | ||
443a5b98 | 535 | pureperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
f2766b05 | 536 | $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f | 537 | |
443a5b98 | 538 | purecovperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
f2766b05 | 539 | $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
dbadb36a | 540 | |
443a5b98 | 541 | quantperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
f2766b05 | 542 | $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 | 543 | |
4ae3d70a JH |
544 | # Third Degree Perl (Tru64 only) |
545 | ||
719561de | 546 | perl.config.dashg: |
83f0ef60 JH |
547 | @echo "Checking optimize='-g' in config.sh..." |
548 | @grep "^optimize=" config.sh | |
549 | @grep "^optimize='-g'" config.sh >/dev/null || exit 1 | |
4ae3d70a JH |
550 | |
551 | perl.third.config: config.sh | |
552 | @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..." | |
6e36760b | 553 | @$(MAKE) perl.config.dashg |
83f0ef60 JH |
554 | @echo "Checking usemymalloc='n' in config.sh..." |
555 | @grep "^usemymalloc=" config.sh | |
556 | @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1 | |
170ba846 | 557 | |
412c6516 | 558 | perl.third: /usr/bin/atom perl.third.config perl |
15615bfd | 559 | atom -tool third -L. -all -gp -toolargs="-quiet -invalid -uninit heap+stack+partword+copy -min 0" perl |
83f0ef60 | 560 | @echo "Now you may run perl.third and then study perl.3log." |
15615bfd | 561 | |
4ae3d70a JH |
562 | # Pixie Perls (Tru64 and IRIX only) |
563 | ||
719561de | 564 | perl.pixie.config: config.sh |
4ae3d70a | 565 | @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..." |
6e36760b | 566 | @$(MAKE) perl.config.dashg |
4ae3d70a | 567 | |
719561de | 568 | perl.pixie.atom: /usr/bin/atom perl |
4ae3d70a JH |
569 | atom -tool pixie -L. -all -toolargs="-quiet" perl |
570 | ||
571 | perl.pixie.irix: perl | |
572 | pixie perl | |
573 | ||
719561de | 574 | perl.pixie: /usr/bin/pixie perl.pixie.config perl |
4ae3d70a JH |
575 | if test -x /usr/bin/atom; then \ |
576 | $(MAKE) perl.pixie.atom; \ | |
577 | else \ | |
578 | $(MAKE) perl.pixie.irix; \ | |
579 | fi | |
83f0ef60 JH |
580 | @echo "Now you may run perl.pixie and then run pixie." |
581 | ||
582 | # Gprof Perl | |
583 | ||
584 | perl.config.dashpg: | |
585 | @echo "Checking optimize='-pg' in config.sh..." | |
586 | @grep "^optimize=" config.sh | |
64778e5f | 587 | @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1 |
83f0ef60 JH |
588 | |
589 | perl.gprof.config: config.sh | |
590 | @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..." | |
591 | @$(MAKE) perl.config.dashpg | |
592 | ||
593 | perl.gprof: /usr/bin/gprof perl.gprof.config | |
64778e5f | 594 | @-rm -f perl |
51a35ef1 | 595 | $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl |
83f0ef60 | 596 | @echo "Now you may run perl.gprof and then run gprof perl.gprof." |
4ae3d70a | 597 | |
51a35ef1 JH |
598 | # Gcov Perl |
599 | ||
600 | perl.config.gcov: | |
601 | @echo "To build perl.gcov you must use gcc 3.0 or newer, checking..." | |
602 | @echo "Checking gccversion in config.sh..." | |
603 | @grep "^gccversion=" config.sh | |
604 | @grep "^gccversion='[3-9]\." config.sh >/dev/null || exit 1 | |
605 | @echo "To build perl.gcov you must Configure -Dccflags=-fprofile-arcs -ftest-coverage, checking..." | |
606 | @echo "Checking ccflags='-fprofile-arcs -ftest-coverage' in config.sh..." | |
607 | @grep "^ccflags=" config.sh | |
608 | @grep "^ccflags='.*-fprofile-arcs -ftest-coverage.*'" config.sh >/dev/null || exit 1 | |
609 | ||
610 | perl.gcov: perl.config.gcov | |
611 | @-rm -f perl | |
612 | $(MAKE) PERL_SUFFIX=.gcov PERL_PROFILE_LDFLAGS='' perl | |
613 | @echo "Now you may run perl.gcov and then run gcov some.c." | |
614 | ||
f946bb38 JH |
615 | # Microperl. This is just a convenience thing if one happens to |
616 | # build also the full Perl and therefore the real big Makefile: | |
f4db5405 | 617 | # usually one should manually explicitly issue the below command. |
f946bb38 | 618 | |
869a466c | 619 | .PHONY: microperl |
f946bb38 JH |
620 | microperl: |
621 | $(MAKE) -f Makefile.micro | |
622 | ||
2304df62 AD |
623 | # This version, if specified in Configure, does ONLY those scripts which need |
624 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" | |
625 | # checks as well as the special code to validate that the script in question | |
626 | # has been invoked correctly. | |
627 | ||
443a5b98 | 628 | suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) |
f2766b05 | 629 | $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 | 630 | |
599a829f IZ |
631 | !NO!SUBS! |
632 | ||
633 | fi | |
634 | ||
635 | $spitshell >>Makefile <<'!NO!SUBS!' | |
636 | ||
bf0dfd28 | 637 | sperl$(OBJ_EXT): perl.c $(h) |
2304df62 | 638 | $(RMS) sperl.c |
85e6fe83 | 639 | $(LNS) perl.c sperl.c |
d96ebe2e | 640 | $(CCCMD) -DIAMSUID sperl.c |
2304df62 AD |
641 | $(RMS) sperl.c |
642 | ||
fec02dd3 AD |
643 | # We have to call our ./makedir because Ultrix 4.3 make can't handle the line |
644 | # test -d lib/auto || mkdir lib/auto | |
645 | # | |
869a466c | 646 | .PHONY: preplibrary |
443a5b98 | 647 | preplibrary: miniperl$(EXE_EXT) lib/Config.pm lib/lib.pm |
cd4d8a96 | 648 | @sh ./makedir lib/auto |
a0d0e21e | 649 | @echo " AutoSplitting perl library" |
92c28edd JH |
650 | $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \ |
651 | autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm | |
abae58a6 | 652 | $(MAKE) lib/re.pm |
2304df62 | 653 | |
75f92628 | 654 | # Take care to avoid modifying lib/Config.pm without reason |
f4db5405 | 655 | # (If trying to create a new port and having problems with the configpm script, |
fb73857a | 656 | # try 'make minitest' and/or commenting out the tests at the end of configpm.) |
443a5b98 | 657 | lib/Config.pm: config.sh miniperl$(EXE_EXT) configpm |
e8827f64 | 658 | $(LDLIBPTH) ./miniperl configpm configpm.tmp |
92c28edd | 659 | sh mv-if-diff configpm.tmp $@ |
2304df62 | 660 | |
443a5b98 | 661 | lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl lib/Config.pm |
e8827f64 | 662 | $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp |
92c28edd | 663 | sh mv-if-diff minimod.tmp $@ |
abae58a6 | 664 | -touch lib/ExtUtils/Miniperl.pm |
fed7345c | 665 | |
92c28edd | 666 | lib/re.pm: ext/re/re.pm |
abae58a6 | 667 | cp ext/re/re.pm ext/re/re.tmp && sh mv-if-diff ext/re/re.tmp lib/re.pm |
7cfc0d09 | 668 | |
443a5b98 | 669 | $(plextract): miniperl$(EXE_EXT) lib/Config.pm |
42c30c63 | 670 | @-rm -f $@ |
92c28edd | 671 | $(LDLIBPTH) ./miniperl -Ilib $@.PL |
72b3d9b4 | 672 | |
443a5b98 | 673 | lib/lib.pm: miniperl$(EXE_EXT) lib/Config.pm |
42c30c63 | 674 | @-rm -f $@ |
4755096e GS |
675 | $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL |
676 | ||
443a5b98 | 677 | extra.pods: miniperl$(EXE_EXT) |
fec93702 | 678 | -@test -f extra.pods && rm -f `cat extra.pods` |
72b3d9b4 | 679 | -@rm -f extra.pods |
b4bc034f | 680 | -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \ |
72b3d9b4 | 681 | nx=`echo $$x | sed -e "s/README\.//"`; \ |
40096396 | 682 | cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \ |
72b3d9b4 GS |
683 | echo "pod/perl"$$nx".pod" >> extra.pods ; \ |
684 | done | |
bf35c3f6 | 685 | -@rm -f pod/perlvms.pod |
40096396 | 686 | -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods |
72b3d9b4 | 687 | |
443a5b98 | 688 | extras.make: perl$(EXE_EXT) |
a40613e1 | 689 | -@test -s extras.lst && $(LDLIBPTH) PATH=`pwd`:${PATH} PERL5LIB=`pwd`/lib ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` |
bf35c3f6 | 690 | |
443a5b98 | 691 | extras.test: perl$(EXE_EXT) |
a40613e1 | 692 | -@test -s extras.lst && $(LDLIBPTH) PATH=`pwd`:${PATH} PERL5LIB=`pwd`/lib ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` |
bf35c3f6 | 693 | |
443a5b98 | 694 | extras.install: perl$(EXE_EXT) |
a40613e1 | 695 | -@test -s extras.lst && $(LDLIBPTH) PATH=`pwd`:${PATH} PERL5LIB=`pwd`/lib ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` |
bf35c3f6 | 696 | |
869a466c JH |
697 | .PHONY: install install-strip install-all install-verbose install-silent \ |
698 | no-install install.perl install.man installman install.html installhtml | |
699 | ||
f556e5b9 JH |
700 | install-strip: |
701 | $(MAKE) STRIPFLAGS=-s install | |
702 | ||
adbebc0b | 703 | install install-all: |
c458b76c | 704 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) |
c77385cf | 705 | |
4ad019ef A |
706 | install-verbose: |
707 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V | |
c458b76c | 708 | |
4ad019ef | 709 | install-silent: |
8d0b2130 | 710 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S |
4ad019ef A |
711 | |
712 | no-install: | |
713 | $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n | |
16d20bd9 | 714 | |
bf35c3f6 | 715 | install.perl: all installperl |
6ee623d5 GS |
716 | if [ -n "$(COMPILE)" ]; \ |
717 | then \ | |
718 | cd utils; $(MAKE) compile; \ | |
719 | cd ../x2p; $(MAKE) compile; \ | |
720 | cd ../pod; $(MAKE) compile; \ | |
83673e1f | 721 | else :; \ |
6ee623d5 | 722 | fi |
c77385cf | 723 | $(LDLIBPTH) ./perl installperl $(INSTALLFLAGS) $(STRIPFLAGS) |
bf35c3f6 | 724 | $(MAKE) extras.install |
a0d0e21e | 725 | |
b1a1e9f1 | 726 | install.man: all installman |
c77385cf | 727 | $(LDLIBPTH) ./perl installman $(INSTALLFLAGS) |
16d20bd9 | 728 | |
84902520 TB |
729 | # XXX Experimental. Hardwired values, but useful for testing. |
730 | # Eventually Configure could ask for some of these values. | |
731 | install.html: all installhtml | |
40096396 | 732 | -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd .. |
6ee623d5 | 733 | $(LDLIBPTH) ./perl installhtml \ |
84902520 TB |
734 | --podroot=. --podpath=. --recurse \ |
735 | --htmldir=$(privlib)/html \ | |
736 | --htmlroot=$(privlib)/html \ | |
737 | --splithead=pod/perlipc \ | |
738 | --splititem=pod/perlfunc \ | |
739 | --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \ | |
740 | --verbose | |
741 | ||
16d20bd9 | 742 | |
a0d0e21e | 743 | # I now supply perly.c with the kits, so the following section is |
56febc5e AD |
744 | # used only if you force byacc to run by saying |
745 | # make run_byacc | |
746 | # Since we patch up the byacc output, the perly.fixer script needs | |
747 | # to run with precisely the same version of byacc as I use. You | |
748 | # normally shouldn't remake perly.[ch]. | |
749 | ||
869a466c JH |
750 | .PHONY: check_byacc run_byacc |
751 | ||
001465dc JH |
752 | check_byacc: |
753 | @$(BYACC) -V 2>&1 | grep 'version 1\.8\.2' | |
754 | ||
755 | run_byacc: FORCE check_byacc | |
56febc5e | 756 | $(BYACC) -d perly.y |
cecd0ad1 | 757 | -chmod 664 perly.c perly.h |
56febc5e | 758 | sh $(shellflags) ./perly.fixer y.tab.c perly.c |
55497cff | 759 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
760 | -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c | |
ebb99254 | 761 | sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h |
55497cff | 762 | cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h |
f4db5405 | 763 | perl -i perlyline.pl perly.c |
fb73857a | 764 | chmod 664 vms/perly_c.vms vms/perly_h.vms |
765 | perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms | |
56febc5e AD |
766 | |
767 | # We don't want to regenerate perly.c and perly.h, but they might | |
768 | # appear out-of-date after a patch is applied or a new distribution is | |
769 | # made. | |
92c28edd | 770 | perly.c: perly.y |
b233458b JH |
771 | -@sh -c true |
772 | ||
92c28edd | 773 | perly.h: perly.y |
b233458b JH |
774 | -@sh -c true |
775 | ||
9fec149b JH |
776 | PERLYVMS = vms/perly_c.vms vms/perly_h.vms |
777 | ||
778 | $(PERLYVMS): perly.c perly.h vms/vms_yfix.pl | |
779 | perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms | |
780 | ||
bd656b61 | 781 | # No compat3.sym here since and including the 5.004_50. |
e4d5a464 | 782 | # No interp.sym since 5.005_03. |
22c35a8c | 783 | SYM = global.sym globvar.sym perlio.sym pp.sym |
419eaf7b | 784 | |
22c35a8c | 785 | SYMH = perlvars.h intrpvar.h thrdvar.h |
419eaf7b | 786 | |
dae78bb1 IZ |
787 | CHMOD_W = chmod +w |
788 | ||
a8581515 | 789 | # The following files are generated automatically |
c83f8f39 JH |
790 | # keywords.pl: keywords.h |
791 | # opcode.pl: opcode.h opnames.h pp_proto.h pp.sym | |
792 | # [* embed.pl needs pp.sym generated by opcode.pl! *] | |
acfe0abc | 793 | # embed.pl: proto.h embed.h embedvar.h global.sym |
c83f8f39 JH |
794 | # perlapi.h perlapi.c pod/perlintern.pod |
795 | # pod/perlapi.pod | |
796 | # bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c | |
797 | # ext/B/B/Asmdata.pm | |
798 | # regcomp.pl: regnodes.h | |
799 | # warnings.pl: warnings.h lib/warnings.pm | |
e50aee73 AD |
800 | # The correct versions should be already supplied with the perl kit, |
801 | # in case you don't have perl available. | |
e1354ed6 | 802 | # To force them to be regenerated, type |
e50aee73 | 803 | # make regen_headers |
e1354ed6 | 804 | |
b4d4469a JH |
805 | AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \ |
806 | embed.h embedvar.h global.sym \ | |
807 | pod/perlintern.pod pod/perlapi.pod \ | |
acfe0abc | 808 | perlapi.h perlapi.c ext/ByteLoader/byterun.h \ |
c83f8f39 JH |
809 | ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \ |
810 | warnings.h lib/warnings.pm | |
e1354ed6 | 811 | |
869a466c JH |
812 | .PHONY: regen_headers regen_pods regen_all |
813 | ||
e50aee73 | 814 | regen_headers: FORCE |
b4d4469a JH |
815 | -$(CHMOD_W) $(AUTOGEN_FILES) |
816 | -perl keywords.pl | |
817 | -perl opcode.pl | |
818 | -perl embed.pl | |
819 | -perl bytecode.pl | |
820 | -perl regcomp.pl | |
821 | -perl warnings.pl | |
94bdecf9 | 822 | -perl autodoc.pl |
8e07c86e | 823 | |
4755096e | 824 | regen_pods: FORCE |
fcfe1ab7 | 825 | -cd pod; $(LDLIBPTH) $(MAKE) regen_pods |
4755096e | 826 | |
9fec149b JH |
827 | regen_all: $(PERLYVMS) regen_headers regen_pods |
828 | ||
a0d0e21e | 829 | # Extensions: |
4318d5a0 GB |
830 | # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will |
831 | # automatically get built. There should ordinarily be no need to change | |
832 | # any of this part of makefile. | |
a0d0e21e LW |
833 | # |
834 | # The dummy dependency is a place holder in case $(dynamic_ext) or | |
835 | # $(static_ext) is empty. | |
836 | # | |
837 | # DynaLoader may be needed for extensions that use Makefile.PL. | |
838 | ||
443a5b98 | 839 | $(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE |
92c28edd | 840 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e | 841 | |
443a5b98 | 842 | d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE |
92c28edd | 843 | @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e | 844 | |
443a5b98 | 845 | s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE |
92c28edd | 846 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
2304df62 | 847 | |
443a5b98 | 848 | n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE |
92c28edd | 849 | @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
4318d5a0 | 850 | |
869a466c JH |
851 | .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \ |
852 | realclean _realcleaner clobber _clobber \ | |
853 | distclean veryclean _verycleaner | |
854 | ||
17b893d8 | 855 | clean: _tidy _mopup |
70af249b | 856 | |
2edbd6da | 857 | realclean: _realcleaner _mopup |
fcfe1ab7 | 858 | @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh" |
70af249b | 859 | |
b37ebb13 | 860 | _clobber: |
5440bc8e | 861 | -@rm -f Cross/run-* Cross/to-* Cross/from-* |
bf35c3f6 | 862 | rm -f config.sh cppstdin Policy.sh extras.lst |
b37ebb13 JH |
863 | |
864 | clobber: _realcleaner _mopup _clobber | |
70af249b CS |
865 | |
866 | distclean: clobber | |
867 | ||
2edbd6da | 868 | # Like distclean but also removes emacs backups and *.orig. |
b37ebb13 JH |
869 | veryclean: _verycleaner _mopup _clobber |
870 | -@rm -f Obsolete Wanted | |
2edbd6da | 871 | |
70af249b CS |
872 | # Do not 'make _mopup' directly. |
873 | _mopup: | |
cd4d8a96 | 874 | rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c |
72b3d9b4 | 875 | -@test -f extra.pods && rm -f `cat extra.pods` |
b4bc034f | 876 | -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod |
ac83e8b0 | 877 | -rm -f perl.exp ext.libs extra.pods opmini.o |
d96ebe2e | 878 | -rm -f perl.export perl.dll perl.libexp perl.map perl.def |
1cfa4ec7 | 879 | -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap |
9d4d067b | 880 | -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log |
6a966751 | 881 | -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs |
93c0359c | 882 | -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok |
6189dba1 JH |
883 | -rm -f perlld cygwin.c ld2 libperl*.def libperl*.dll |
884 | rm -f perl$(EXE_EXT) suidperl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl | |
70af249b CS |
885 | |
886 | # Do not 'make _tidy' directly. | |
887 | _tidy: | |
e3f83878 JH |
888 | -cd pod; $(LDLIBPTH) $(MAKE) clean |
889 | -cd utils; $(LDLIBPTH) $(MAKE) clean | |
890 | -cd x2p; $(LDLIBPTH) $(MAKE) clean | |
4318d5a0 | 891 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
e3f83878 | 892 | $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \ |
a0d0e21e | 893 | done |
6ee623d5 | 894 | rm -f testcompile compilelog |
ff68c719 | 895 | |
2edbd6da | 896 | _cleaner1: |
4633a7c4 | 897 | -cd os2; rm -f Makefile |
2edbd6da JH |
898 | -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) |
899 | -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) | |
900 | -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) | |
4318d5a0 | 901 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ |
2edbd6da | 902 | $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \ |
a0d0e21e | 903 | done |
2edbd6da JH |
904 | |
905 | _cleaner2: | |
6189dba1 | 906 | 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$(EXE_EXT) t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) |
a0d0e21e | 907 | rm -rf $(addedbyconf) |
cd4d8a96 | 908 | rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old |
fed7345c | 909 | rm -f $(private) |
a0d0e21e | 910 | rm -rf lib/auto |
07a6e20d | 911 | rm -f lib/.exists lib/*/.exists lib/*/*/.exists |
16d20bd9 | 912 | rm -f h2ph.man pstruct |
a0d0e21e | 913 | rm -rf .config |
6ee623d5 | 914 | rm -f testcompile compilelog |
d0b806d2 MB |
915 | -rmdir lib/B lib/Data lib/Digest lib/Encode lib/IO/Socket lib/IO/t lib/IO |
916 | -rmdir lib/Filter/Util lib/List lib/MIME lib/PerlIO lib/Scalar lib/Sys | |
917 | -rmdir lib/Thread lib/XS | |
ecfc5424 | 918 | |
f4db5405 | 919 | _realcleaner: |
2edbd6da JH |
920 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean |
921 | @$(LDLIBPTH) $(MAKE) _cleaner2 | |
922 | ||
f4db5405 | 923 | _verycleaner: |
2edbd6da JH |
924 | @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean |
925 | @$(LDLIBPTH) $(MAKE) _cleaner2 | |
c94787a5 | 926 | -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig |
2edbd6da | 927 | |
2304df62 AD |
928 | # The following lint has practically everything turned on. Unfortunately, |
929 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. | |
930 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message | |
931 | # for that spot. | |
932 | ||
869a466c | 933 | .PHONY: lint |
bf0dfd28 | 934 | lint: $(c) |
2304df62 AD |
935 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz |
936 | ||
fb73857a | 937 | # Need to unset during recursion to go out of loop. |
938 | # The README below ensures that the dependency list is never empty and | |
939 | # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding. | |
cd4d8a96 | 940 | |
84902520 | 941 | MAKEDEPEND = Makefile makedepend |
cd4d8a96 | 942 | |
fb73857a | 943 | $(FIRSTMAKEFILE): README $(MAKEDEPEND) |
cd4d8a96 | 944 | $(MAKE) depend MAKEDEPEND= |
a0d0e21e | 945 | |
599a829f | 946 | config.h: config_h.SH config.sh |
655635e8 | 947 | $(SHELL) config_h.SH |
948 | ||
a0d0e21e | 949 | # When done, touch perlmain.c so that it doesn't get remade each time. |
869a466c | 950 | .PHONY: depend |
2304df62 | 951 | depend: makedepend |
fb73857a | 952 | sh ./makedepend MAKE=$(MAKE) |
a0d0e21e | 953 | - test -s perlmain.c && touch perlmain.c |
2304df62 AD |
954 | cd x2p; $(MAKE) depend |
955 | ||
cd4d8a96 | 956 | # Cannot postpone this until $firstmakefile is ready ;-) |
92c28edd JH |
957 | makedepend: makedepend.SH config.sh |
958 | sh ./makedepend.SH | |
cd4d8a96 | 959 | |
1167a30e | 960 | .PHONY: test check test_prep test_prep_nodll test_prep_pre _test_prep \ |
869a466c JH |
961 | test_tty test-tty _test_tty test_notty test-notty _test_notty \ |
962 | utest ucheck test.utf8 check.utf8 \ | |
963 | test.third check.third utest.third ucheck.third test_notty.third \ | |
964 | test.deparse test_notty.deparse \ | |
5a6e071d | 965 | minitest coretest |
869a466c | 966 | |
ec861bc1 JH |
967 | # Cannot delegate rebuilding of t/perl to make |
968 | # to allow interlaced test and minitest | |
3e3baf6d | 969 | |
1167a30e IZ |
970 | TESTFILE=TEST |
971 | ||
972 | _test_prep: | |
ec861bc1 | 973 | cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT)) |
3e3baf6d | 974 | |
1167a30e IZ |
975 | # Architecture-neutral stuff: |
976 | ||
977 | test_prep_pre: preplibrary utilities $(nonxs_ext) | |
978 | ||
443a5b98 | 979 | test_prep: test_prep_pre miniperl$(EXE_EXT) perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL) |
5fe84fd2 | 980 | PERL=./perl $(MAKE) _test_prep |
ec861bc1 | 981 | |
5fe84fd2 | 982 | _test_tty: |
1167a30e | 983 | cd t && $(LDLIBPTH) $(PERL_DEBUG) $(PERL) $(TESTFILE) $(TEST_ARGS) </dev/tty |
ec861bc1 | 984 | |
5fe84fd2 | 985 | _test_notty: |
1167a30e | 986 | cd t && $(LDLIBPTH) $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(PERL) $(TESTFILE) $(TEST_ARGS) |
ec861bc1 JH |
987 | |
988 | # The second branch is for testing without a tty or controlling terminal, | |
989 | # see t/op/stat.t | |
990 | _test: | |
994e9bc0 | 991 | if (true </dev/tty) >/dev/null 2>&1; then \ |
1167a30e | 992 | $(MAKE) TEST_ARGS=$(TEST_ARGS) TESTFILE=$(TESTFILE) _test_tty ; \ |
994e9bc0 | 993 | else \ |
1167a30e | 994 | $(MAKE) TEST_ARGS=$(TEST_ARGS) TESTFILE=$(TESTFILE) _test_notty ; \ |
994e9bc0 | 995 | fi |
3d8f1d64 | 996 | @echo "Ran tests" > t/rantests |
a0ed51b3 | 997 | |
937aca76 | 998 | test check: test_prep |
ec861bc1 JH |
999 | PERL=./perl $(MAKE) _test |
1000 | ||
937aca76 | 1001 | test_tty: test_prep |
5fe84fd2 | 1002 | PERL=./perl $(MAKE) _test_tty |
ec861bc1 | 1003 | |
937aca76 | 1004 | test_notty: test_prep |
5fe84fd2 | 1005 | PERL=./perl $(MAKE) _test_notty |
ec861bc1 | 1006 | |
83f0ef60 | 1007 | utest ucheck test.utf8 check.utf8: test_prep |
35117553 | 1008 | PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test |
ec861bc1 | 1009 | |
5a6e071d PJ |
1010 | coretest: test_prep |
1011 | PERL=./perl TEST_ARGS=-core $(MAKE) _test | |
1012 | ||
48a293f8 | 1013 | test-prep: test_prep |
5fe84fd2 JH |
1014 | |
1015 | test-tty: test_tty | |
1016 | ||
1017 | test-notty: test_notty | |
1018 | ||
ec861bc1 JH |
1019 | # Targets for Third Degree testing. |
1020 | ||
1167a30e | 1021 | test_prep.third: test_prep perl.third perl.third$(EXE_EXT) |
5fe84fd2 | 1022 | PERL=./perl.third $(MAKE) _test_prep |
ec861bc1 | 1023 | |
937aca76 | 1024 | test.third check.third: test_prep.third perl.third |
ec861bc1 JH |
1025 | PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test |
1026 | ||
937aca76 | 1027 | utest.third ucheck.third: test_prep.third perl.third |
35117553 | 1028 | PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 TEST_ARGS=-utf8 $(MAKE) _test |
ec861bc1 | 1029 | |
937aca76 | 1030 | test_notty.third: test_prep.third perl.third |
5fe84fd2 | 1031 | PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty |
2304df62 | 1032 | |
35117553 JH |
1033 | # Targets for Deparse testing. |
1034 | ||
1035 | test.deparse: test_prep | |
1036 | PERL=./perl TEST_ARGS=-deparse $(MAKE) _test | |
1037 | ||
1038 | test_notty.deparse: test_prep | |
1039 | PERL=./perl TEST_ARGS=-deparse $(MAKE) _test_notty | |
1040 | ||
d96ebe2e | 1041 | # Can't depend on lib/Config.pm because that might be where miniperl |
1042 | # is crashing. | |
443a5b98 | 1043 | minitest: miniperl$(EXE_EXT) lib/re.pm |
d96ebe2e | 1044 | @echo "You may see some irrelevant test failures if you have been unable" |
1045 | @echo "to build lib/Config.pm." | |
cd4d8a96 | 1046 | - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \ |
aabd84f8 | 1047 | && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t </dev/tty |
16d20bd9 | 1048 | |
1167a30e IZ |
1049 | # Test via harness |
1050 | ||
1051 | test_harness: test_prep | |
1052 | PERL=./perl $(MAKE) TESTFILE=harness _test | |
1053 | ||
fb73857a | 1054 | # Handy way to run perlbug -ok without having to install and run the |
84902520 | 1055 | # installed perlbug. We don't re-run the tests here - we trust the user. |
fb73857a | 1056 | # Please *don't* use this unless all tests pass. |
1d2dff63 | 1057 | # If you want to report test failures, use "make nok" instead. |
869a466c JH |
1058 | |
1059 | .PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack | |
1060 | ||
188cd53f | 1061 | ok: utilities |
92c28edd | 1062 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' |
84902520 | 1063 | |
105f9295 | 1064 | okfile: utilities |
92c28edd | 1065 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok |
105f9295 | 1066 | |
890b8eb0 NC |
1067 | oknack: utilities |
1068 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A | |
1069 | ||
1070 | okfilenack: utilities | |
1071 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A | |
1072 | ||
1d2dff63 | 1073 | nok: utilities |
92c28edd | 1074 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' |
1d2dff63 | 1075 | |
b4e8cfaf GS |
1076 | nokfile: utilities |
1077 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok | |
1078 | ||
890b8eb0 NC |
1079 | noknack: utilities |
1080 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A | |
1081 | ||
1082 | nokfilenack: utilities | |
1083 | $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A | |
1084 | ||
869a466c JH |
1085 | .PHONY: clist hlist shlist pllist |
1086 | ||
85e6fe83 | 1087 | clist: $(c) |
92c28edd | 1088 | echo $(c) | tr ' ' $(TRNL) >.clist |
2304df62 | 1089 | |
85e6fe83 | 1090 | hlist: $(h) |
92c28edd | 1091 | echo $(h) | tr ' ' $(TRNL) >.hlist |
2304df62 | 1092 | |
85e6fe83 | 1093 | shlist: $(sh) |
92c28edd | 1094 | echo $(sh) | tr ' ' $(TRNL) >.shlist |
2304df62 | 1095 | |
4633a7c4 | 1096 | pllist: $(pl) |
92c28edd | 1097 | echo $(pl) | tr ' ' $(TRNL) >.pllist |
4633a7c4 | 1098 | |
92c28edd JH |
1099 | Makefile: Makefile.SH ./config.sh |
1100 | $(SHELL) Makefile.SH | |
760ac839 | 1101 | |
869a466c | 1102 | .PHONY: distcheck |
599a829f | 1103 | distcheck: FORCE |
760ac839 LW |
1104 | perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' |
1105 | ||
869a466c | 1106 | .PHONY: elc |
771c4874 IZ |
1107 | elc: emacs/cperl-mode.elc |
1108 | ||
1109 | emacs/cperl-mode.elc: emacs/cperl-mode.el | |
1110 | -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el | |
1111 | ||
869a466c JH |
1112 | .PHONY: etags ctags tags |
1113 | ||
d6a255e6 IZ |
1114 | etags: TAGS |
1115 | ||
1116 | TAGS: emacs/cperl-mode.elc | |
3ee700d1 | 1117 | sh emacs/ptags |
01e22528 | 1118 | |
d6a255e6 IZ |
1119 | ctags: tags |
1120 | ||
1121 | # Let's hope make will not go into an infinite loop on case-unsensitive systems | |
1122 | # This may also fail if . is in the head of the path, since perl will | |
1123 | # require -Ilib | |
1124 | tags: TAGS | |
1125 | perl emacs/e2ctags.pl TAGS > tags | |
3ee700d1 | 1126 | |
2304df62 AD |
1127 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
1128 | # If this runs make out of memory, delete /usr/include lines. | |
1129 | !NO!SUBS! | |
1130 | ||
85e6fe83 | 1131 | $eunicefix Makefile |
2304df62 AD |
1132 | case `pwd` in |
1133 | *SH) | |
85e6fe83 | 1134 | $rm -f ../Makefile |
cd4d8a96 | 1135 | $ln Makefile ../Makefile |
2304df62 AD |
1136 | ;; |
1137 | esac | |
cd4d8a96 | 1138 | $rm -f $firstmakefile |
5ff3f7a4 GS |
1139 | |
1140 | # Now do any special processing required before building. | |
1141 | ||
1142 | case "$ebcdic" in | |
1143 | $define) | |
1144 | xxx='' | |
1145 | echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 | |
7a66b286 | 1146 | case "$osname" in |
25e9a2e3 | 1147 | os390|posix-bc) |
5ff3f7a4 | 1148 | rm -f y.tab.c y.tab.h |
e9d08790 | 1149 | # yacc must be a reentrant ("pure") Bison in BS2000 Posix! |
5ff3f7a4 GS |
1150 | yacc -d perly.y >/dev/null 2>&1 |
1151 | if cmp -s y.tab.c perly.c; then | |
1152 | rm -f y.tab.c | |
1153 | else | |
1154 | echo "perly.y -> perly.c" >&2 | |
1155 | mv -f y.tab.c perly.c | |
1156 | chmod u+w perly.c | |
c8dba6f3 GS |
1157 | sed -e '/^#include "perl\.h"/a\ |
1158 | \ | |
1159 | #define yydebug PL_yydebug\ | |
1160 | #define yynerrs PL_yynerrs\ | |
1161 | #define yyerrflag PL_yyerrflag\ | |
1162 | #define yychar PL_yychar\ | |
c8dba6f3 GS |
1163 | #define yyval PL_yyval\ |
1164 | #define yylval PL_yylval' \ | |
1165 | -e '/YYSTYPE *yyval;/D' \ | |
1166 | -e '/YYSTYPE *yylval;/D' \ | |
1167 | -e '/int yychar,/,/yynerrs;/D' \ | |
1168 | -e 's/int yydebug = 0;/yydebug = 0;/' \ | |
1169 | -e 's/[^_]realloc(/PerlMem_realloc(/g' \ | |
1170 | -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ | |
5ff3f7a4 GS |
1171 | -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
1172 | xxx="$xxx perly.c" | |
1173 | fi | |
1174 | if cmp -s y.tab.h perly.h; then | |
1175 | rm -f y.tab.h | |
1176 | else | |
1177 | echo "perly.y -> perly.h" >&2 | |
1178 | mv -f y.tab.h perly.h | |
1179 | xxx="$xxx perly.h" | |
1180 | fi | |
e9d08790 | 1181 | if cd x2p |
5ff3f7a4 | 1182 | then |
e9d08790 | 1183 | rm -f y.tab.c y.tab.h |
5928ee40 JH |
1184 | case "$osname" in |
1185 | posix-bc) | |
1186 | # we are using two different yaccs in BS2000 Posix! | |
1187 | byacc a2p.y >/dev/null 2>&1 | |
1188 | ;; | |
1189 | *) # e.g. os390 | |
1190 | yacc a2p.y >/dev/null 2>&1 | |
1191 | ;; | |
1192 | esac | |
e9d08790 JH |
1193 | if cmp -s y.tab.c a2p.c |
1194 | then | |
1195 | rm -f y.tab.c | |
1196 | else | |
1197 | echo "a2p.y -> a2p.c" >&2 | |
1198 | mv -f y.tab.c a2p.c | |
1199 | chmod u+w a2p.c | |
1200 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ | |
f1f802f7 | 1201 | -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \ |
e9d08790 JH |
1202 | -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
1203 | xxx="$xxx a2p.c" | |
1204 | fi | |
1205 | # In case somebody yacc -d:ed the a2p.y. | |
1206 | if test -f y.tab.h | |
1207 | then | |
1208 | if cmp -s y.tab.h a2p.h | |
1209 | then | |
1210 | rm -f y.tab.h | |
1211 | else | |
1212 | echo "a2p.h -> a2p.h" >&2 | |
1213 | mv -f y.tab.h a2p.h | |
1214 | xxx="$xxx a2p.h" | |
1215 | fi | |
1216 | fi | |
1217 | cd .. | |
5ff3f7a4 | 1218 | fi |
7a66b286 JH |
1219 | ;; |
1220 | vmesa) | |
1221 | # Do nothing in VM/ESA. | |
1222 | ;; | |
aa34f189 | 1223 | *) |
e9d08790 | 1224 | echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
aa34f189 | 1225 | ;; |
fe572743 | 1226 | esac |
5ff3f7a4 GS |
1227 | case "$xxx" in |
1228 | '') echo "No parser files were regenerated. That's okay." >&2 ;; | |
1229 | esac | |
1230 | ;; | |
1231 | esac | |
1232 |