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