Commit | Line | Data |
599a829f |
1 | #! /bin/sh |
2304df62 |
2 | case $CONFIG in |
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)' |
c4f23d77 |
28 | ldlibpth='' |
d96ebe2e |
29 | case "$useshrplib" in |
30 | true) |
c4f23d77 |
31 | # Prefix all runs of 'miniperl' and 'perl' with |
32 | # $ldlibpth so that ./perl finds *this* libperl.so. |
33 | ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH" |
34 | |
d5d19f97 |
35 | pldlflags="$cccdlflags" |
f0efd8cf |
36 | # NeXT-4 specific stuff. Can't we do this in the hint file? |
d96ebe2e |
37 | case "${osname}${osvers}" in |
38 | next4*) |
3c321fdc |
39 | ld=libtool |
40 | lddlflags="-dynamic -undefined warning -framework System \ |
41 | -compatibility_version 1 -current_version $patchlevel \ |
42 | -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@" |
c4f23d77 |
43 | # NeXT uses a different name. |
44 | ldlibpth="DYLD_LIBRARY_PATH=`pwd`:$DYLD_LIBRARY_PATH" |
45 | ;; |
46 | os2*) # OS/2 doesn't need anything special for LD_LIBRARY_PATH. |
47 | ldlibpth='' |
d96ebe2e |
48 | ;; |
dec5cd44 |
49 | sunos*|freebsd[23]*|netbsd*) |
d5d19f97 |
50 | linklibperl="-lperl" |
51 | ;; |
3c321fdc |
52 | aix*) |
53 | shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" |
1553ab04 |
54 | case "$osvers" in |
55 | 3*) |
56 | shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib" |
57 | ;; |
58 | *) |
59 | shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib" |
60 | ;; |
61 | esac |
3c321fdc |
62 | aixinstdir=`pwd | sed 's/\/UU$//'` |
63 | linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl" |
64 | ;; |
fb73857a |
65 | hpux10*) |
66 | linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+b$archlibexp/CORE -lperl" |
67 | ;; |
655635e8 |
68 | esac |
d5d19f97 |
69 | ;; |
f0efd8cf |
70 | *) pldlflags='' |
d96ebe2e |
71 | ;; |
ecfc5424 |
72 | esac |
73 | |
a0d0e21e |
74 | : Prepare dependency lists for Makefile. |
75 | dynamic_list=' ' |
76 | for f in $dynamic_ext; do |
77 | : the dependency named here will never exist |
ecfc5424 |
78 | base=`echo "$f" | sed 's/.*\///'` |
75f92628 |
79 | dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext" |
a0d0e21e |
80 | done |
81 | |
82 | static_list=' ' |
a0d0e21e |
83 | for f in $static_ext; do |
84 | base=`echo "$f" | sed 's/.*\///'` |
cd4d8a96 |
85 | static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)" |
a0d0e21e |
86 | done |
87 | |
2304df62 |
88 | echo "Extracting Makefile (with variable substitutions)" |
655635e8 |
89 | $spitshell >Makefile <<!GROK!THIS! |
a0d0e21e |
90 | # Makefile.SH |
85e6fe83 |
91 | # This file is derived from Makefile.SH. Any changes made here will |
92 | # be lost the next time you run Configure. |
655635e8 |
93 | # Makefile is used to generate $firstmakefile. The only difference |
94 | # is that $firstmakefile has the dependencies filled in at the end. |
2304df62 |
95 | # |
fed7345c |
96 | # |
2304df62 |
97 | # I now supply perly.c with the kits, so don't remake perly.c without byacc |
98 | BYACC = $byacc |
99 | CC = $cc |
232e078e |
100 | LD = $ld |
16d20bd9 |
101 | |
2304df62 |
102 | LDFLAGS = $ldflags |
103 | CLDFLAGS = $ldflags |
85e6fe83 |
104 | |
2304df62 |
105 | SMALL = $small |
106 | LARGE = $large $split |
107 | mallocsrc = $mallocsrc |
108 | mallocobj = $mallocobj |
85e6fe83 |
109 | LNS = $lns |
2304df62 |
110 | RMS = rm -f |
85e6fe83 |
111 | ranlib = $ranlib |
112 | |
16d20bd9 |
113 | # The following are mentioned only to make metaconfig include the |
114 | # appropriate questions in Configure. If you want to change these, |
8e07c86e |
115 | # edit config.sh instead, or specify --man1dir=/wherever on |
16d20bd9 |
116 | # installman commandline. |
117 | bin = $installbin |
118 | scriptdir = $scriptdir |
d96ebe2e |
119 | shrpdir = $archlibexp/CORE |
16d20bd9 |
120 | privlib = $installprivlib |
121 | man1dir = $man1dir |
122 | man1ext = $man1ext |
123 | man3dir = $man3dir |
124 | man3ext = $man3ext |
125 | |
85e6fe83 |
126 | # The following are used to build and install shared libraries for |
127 | # dynamic loading. |
128 | LDDLFLAGS = $lddlflags |
3c321fdc |
129 | SHRPLDFLAGS = $shrpldflags |
85e6fe83 |
130 | CCDLFLAGS = $ccdlflags |
a0d0e21e |
131 | DLSUFFIX = .$dlext |
ecfc5424 |
132 | PLDLFLAGS = $pldlflags |
d96ebe2e |
133 | LIBPERL = $libperl |
d5d19f97 |
134 | LLIBPERL= $linklibperl |
ecfc5424 |
135 | SHRPENV = $shrpenv |
a0d0e21e |
136 | |
c4f23d77 |
137 | # The following is used to include the current directory in |
138 | # LD_LIBRARY_PATH if you are building a shared libperl.so. |
139 | LDLIBPTH = $ldlibpth |
140 | |
a0d0e21e |
141 | dynamic_ext = $dynamic_list |
142 | static_ext = $static_list |
143 | ext = \$(dynamic_ext) \$(static_ext) |
cd4d8a96 |
144 | DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT) |
2304df62 |
145 | |
146 | libs = $libs $cryptlib |
147 | |
909b3858 |
148 | public = perl $suidperl utilities translators |
2304df62 |
149 | |
150 | shellflags = $shellflags |
151 | |
d96ebe2e |
152 | # This is set to MAKE=$make if your $make command doesn't |
153 | # do it for you. |
154 | $make_set_make |
4633a7c4 |
155 | |
dfe9444c |
156 | # These variables may need to be manually set for non-Unix systems. |
4633a7c4 |
157 | AR = $ar |
dfe9444c |
158 | EXE_EXT = $_exe |
159 | LIB_EXT = $_a |
160 | OBJ_EXT = $_o |
161 | PATH_SEP = $p_ |
4633a7c4 |
162 | |
163 | FIRSTMAKEFILE = $firstmakefile |
164 | |
165 | # Any special object files needed by this architecture, e.g. os2/os2.obj |
166 | ARCHOBJS = $archobjs |
167 | |
cd4d8a96 |
168 | .SUFFIXES: .c \$(OBJ_EXT) |
169 | |
d96ebe2e |
170 | # grrr |
171 | SHELL = $sh |
655635e8 |
172 | |
2304df62 |
173 | !GROK!THIS! |
174 | |
85e6fe83 |
175 | ## In the following dollars and backticks do not need the extra backslash. |
2304df62 |
176 | $spitshell >>Makefile <<'!NO!SUBS!' |
177 | |
d96ebe2e |
178 | CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@` |
2304df62 |
179 | |
fed7345c |
180 | private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm |
2304df62 |
181 | |
4633a7c4 |
182 | # Files to be built with variable substitution before miniperl |
183 | # is available. |
184 | sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \ |
185 | makedir.SH perl_exp.SH writemain.SH |
186 | |
187 | shextract = Makefile cflags config.h makeaperl makedepend \ |
655635e8 |
188 | makedir perl.exp writemain |
4633a7c4 |
189 | |
190 | # Files to be built with variable substitution after miniperl is |
191 | # available. Dependencies handled manually below (for now). |
2304df62 |
192 | |
909b3858 |
193 | pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL |
4633a7c4 |
194 | |
909b3858 |
195 | plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text |
4633a7c4 |
196 | |
197 | addedbyconf = UU $(shextract) $(plextract) pstruct |
2304df62 |
198 | |
fed7345c |
199 | h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h |
a0d0e21e |
200 | h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h |
2304df62 |
201 | h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h |
12ca11f6 |
202 | h4 = regexp.h scope.h sv.h unixish.h util.h perlio.h thread.h |
33b839e2 |
203 | h5 = bytecode.h byterun.h |
204 | h = $(h1) $(h2) $(h3) $(h4) $(h5) |
2304df62 |
205 | |
33b839e2 |
206 | c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c byterun.c |
a0d0e21e |
207 | c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c |
760ac839 |
208 | c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c globals.c perlio.c |
2304df62 |
209 | |
a0d0e21e |
210 | c = $(c1) $(c2) $(c3) miniperlmain.c perlmain.c |
2304df62 |
211 | |
33b839e2 |
212 | 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) byterun$(OBJ_EXT) |
cd4d8a96 |
213 | 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) |
760ac839 |
214 | obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) |
655635e8 |
215 | |
4633a7c4 |
216 | obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
2304df62 |
217 | |
a0d0e21e |
218 | # Once perl has been Configure'd and built ok you build different |
219 | # perl variants (Debugging, Embedded, Multiplicity etc) by saying: |
d96ebe2e |
220 | # make clean; make LIBPERL=libperl<type>.a |
a0d0e21e |
221 | # where <type> is some combination of 'd' and(or) 'e' or 'm'. |
222 | # See cflags to understand how this works. |
223 | # |
d96ebe2e |
224 | # This mechanism is getting clunky and might not even work any more. |
225 | # EMBEDDING is on by default, and MULTIPLICITY doesn't work. |
226 | # |
a0d0e21e |
227 | |
2304df62 |
228 | lintflags = -hbvxac |
229 | |
cd4d8a96 |
230 | .c$(OBJ_EXT): |
d96ebe2e |
231 | $(CCCMD) $(PLDLFLAGS) $*.c |
2304df62 |
232 | |
655635e8 |
233 | all: $(FIRSTMAKEFILE) miniperl $(private) $(plextract) $(public) $(dynamic_ext) |
909b3858 |
234 | @echo " "; echo " Everything is up to date." |
235 | |
236 | translators: miniperl lib/Config.pm FORCE |
c4f23d77 |
237 | @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all |
8e07c86e |
238 | |
909b3858 |
239 | utilities: miniperl lib/Config.pm FORCE |
c4f23d77 |
240 | @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all |
909b3858 |
241 | |
242 | |
16d20bd9 |
243 | # This is now done by installman only if you actually want the man pages. |
244 | # @echo " "; echo " Making docs"; cd pod; $(MAKE) all; |
85e6fe83 |
245 | |
246 | # Phony target to force checking subdirectories. |
e50aee73 |
247 | # Apparently some makes require an action for the FORCE target. |
85e6fe83 |
248 | FORCE: |
4633a7c4 |
249 | @sh -c true |
85e6fe83 |
250 | |
cd4d8a96 |
251 | miniperlmain$(OBJ_EXT): miniperlmain.c |
d96ebe2e |
252 | $(CCCMD) $(PLDLFLAGS) $*.c |
ecfc5424 |
253 | |
655635e8 |
254 | perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) |
a0d0e21e |
255 | sh writemain $(DYNALOADER) $(static_ext) > tmp |
256 | sh mv-if-diff tmp perlmain.c |
85e6fe83 |
257 | |
cd4d8a96 |
258 | perlmain$(OBJ_EXT): perlmain.c |
d96ebe2e |
259 | $(CCCMD) $(PLDLFLAGS) $*.c |
85e6fe83 |
260 | |
a0d0e21e |
261 | # The file ext.libs is a list of libraries that must be linked in |
262 | # for static extensions, e.g. -lm -lgdbm, etc. The individual |
263 | # static extension Makefile's add to it. |
fed7345c |
264 | ext.libs: $(static_ext) |
a0d0e21e |
265 | -@test -f ext.libs || touch ext.libs |
85e6fe83 |
266 | |
ecfc5424 |
267 | !NO!SUBS! |
599a829f |
268 | |
d96ebe2e |
269 | # How to build libperl. This is still rather convoluted. |
599a829f |
270 | # Load up custom Makefile.SH fragment for shared loading and executables: |
d96ebe2e |
271 | if test -r $osname/Makefile.SHs ; then |
272 | . $osname/Makefile.SHs |
273 | $spitshell >>Makefile <<!GROK!THIS! |
cd4d8a96 |
274 | |
275 | Makefile: $osname/Makefile.SHs |
cd4d8a96 |
276 | !GROK!THIS! |
277 | else |
f0efd8cf |
278 | $spitshell >>Makefile <<'!NO!SUBS!' |
9c9e9f08 |
279 | $(LIBPERL): $& perl$(OBJ_EXT) $(obj) |
280 | !NO!SUBS! |
d96ebe2e |
281 | case "$useshrplib" in |
282 | true) |
283 | $spitshell >>Makefile <<'!NO!SUBS!' |
3c321fdc |
284 | $(LD) $(SHRPLDFLAGS) -o $@ perl$(OBJ_EXT) $(obj) |
285 | !NO!SUBS! |
286 | case "$osname" in |
287 | aix) |
288 | $spitshell >>Makefile <<'!NO!SUBS!' |
289 | mv $@ libperl$(OBJ_EXT) |
290 | $(AR) qv $(LIBPERL) libperl$(OBJ_EXT) |
ecfc5424 |
291 | !NO!SUBS! |
3c321fdc |
292 | ;; |
293 | esac |
d96ebe2e |
294 | ;; |
295 | *) |
296 | $spitshell >>Makefile <<'!NO!SUBS!' |
297 | rm -f $(LIBPERL) |
298 | $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj) |
299 | @$(ranlib) $(LIBPERL) |
655635e8 |
300 | !NO!SUBS! |
d96ebe2e |
301 | ;; |
302 | esac |
599a829f |
303 | $spitshell >>Makefile <<'!NO!SUBS!' |
304 | |
305 | # How to build executables. |
306 | |
307 | # The $& notation tells Sequent machines that it can do a parallel make, |
308 | # and is harmless otherwise. |
309 | # The miniperl -w -MExporter line is a basic cheap test to catch errors |
310 | # before make goes on to run preplibrary and then MakeMaker on extensions. |
311 | # This is very handy because later errors are often caused by miniperl |
312 | # build problems but that's not obvious to the novice. |
313 | # The Module used here must not depend on Config or any extensions. |
314 | |
315 | miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) |
c4f23d77 |
316 | $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs) |
317 | @ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest |
599a829f |
318 | |
319 | perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs |
c4f23d77 |
320 | $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f |
321 | |
322 | pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs |
c4f23d77 |
323 | $(SHRPENV) $(LDLIBPTH) purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
599a829f |
324 | |
dbadb36a |
325 | purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs |
c4f23d77 |
326 | $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
dbadb36a |
327 | |
599a829f |
328 | quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs |
c4f23d77 |
329 | $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 |
330 | |
331 | # This version, if specified in Configure, does ONLY those scripts which need |
332 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" |
333 | # checks as well as the special code to validate that the script in question |
334 | # has been invoked correctly. |
335 | |
d96ebe2e |
336 | suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs |
c4f23d77 |
337 | $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) |
2304df62 |
338 | |
599a829f |
339 | !NO!SUBS! |
340 | |
341 | fi |
342 | |
343 | $spitshell >>Makefile <<'!NO!SUBS!' |
344 | |
cd4d8a96 |
345 | sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h) |
2304df62 |
346 | $(RMS) sperl.c |
85e6fe83 |
347 | $(LNS) perl.c sperl.c |
d96ebe2e |
348 | $(CCCMD) -DIAMSUID sperl.c |
2304df62 |
349 | $(RMS) sperl.c |
350 | |
fec02dd3 |
351 | # We have to call our ./makedir because Ultrix 4.3 make can't handle the line |
352 | # test -d lib/auto || mkdir lib/auto |
353 | # |
4633a7c4 |
354 | preplibrary: miniperl lib/Config.pm $(plextract) |
cd4d8a96 |
355 | @sh ./makedir lib/auto |
a0d0e21e |
356 | @echo " AutoSplitting perl library" |
c4f23d77 |
357 | @$(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \ |
a0d0e21e |
358 | autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm |
2304df62 |
359 | |
75f92628 |
360 | # Take care to avoid modifying lib/Config.pm without reason |
fb73857a |
361 | # (If trying to create a new port and having problems with the configpm script, |
362 | # try 'make minitest' and/or commenting out the tests at the end of configpm.) |
655635e8 |
363 | lib/Config.pm: config.sh miniperl configpm |
c4f23d77 |
364 | $(LDLIBPTH) ./miniperl configpm tmp |
75f92628 |
365 | sh mv-if-diff tmp lib/Config.pm |
2304df62 |
366 | |
37120919 |
367 | lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm |
c4f23d77 |
368 | $(LDLIBPTH) ./miniperl minimod.pl > tmp && mv tmp $@ |
fed7345c |
369 | |
4633a7c4 |
370 | $(plextract): miniperl lib/Config.pm |
c4f23d77 |
371 | $(LDLIBPTH) ./miniperl -Ilib $@.PL |
372 | |
16d20bd9 |
373 | install: all install.perl install.man |
374 | |
cd4d8a96 |
375 | install.perl: all installperl |
c4f23d77 |
376 | $(LDLIBPTH) ./perl installperl |
a0d0e21e |
377 | |
cd4d8a96 |
378 | install.man: all installman |
c4f23d77 |
379 | $(LDLIBPTH) ./perl installman |
16d20bd9 |
380 | |
84902520 |
381 | # XXX Experimental. Hardwired values, but useful for testing. |
382 | # Eventually Configure could ask for some of these values. |
383 | install.html: all installhtml |
c4f23d77 |
384 | $(LDLIBPTH) ./perl installhtml \ |
84902520 |
385 | --podroot=. --podpath=. --recurse \ |
386 | --htmldir=$(privlib)/html \ |
387 | --htmlroot=$(privlib)/html \ |
388 | --splithead=pod/perlipc \ |
389 | --splititem=pod/perlfunc \ |
390 | --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \ |
391 | --verbose |
392 | |
16d20bd9 |
393 | |
a0d0e21e |
394 | # I now supply perly.c with the kits, so the following section is |
56febc5e |
395 | # used only if you force byacc to run by saying |
396 | # make run_byacc |
397 | # Since we patch up the byacc output, the perly.fixer script needs |
398 | # to run with precisely the same version of byacc as I use. You |
399 | # normally shouldn't remake perly.[ch]. |
400 | |
232e078e |
401 | run_byacc: FORCE |
28757baa |
402 | @ echo 'Expect' 113 shift/reduce and 1 reduce/reduce conflict |
56febc5e |
403 | $(BYACC) -d perly.y |
fb73857a |
404 | chmod 664 perly.c |
56febc5e |
405 | sh $(shellflags) ./perly.fixer y.tab.c perly.c |
55497cff |
406 | sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
407 | -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
408 | echo 'extern YYSTYPE yylval;' >>y.tab.h |
409 | cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h |
fb73857a |
410 | chmod 664 vms/perly_c.vms vms/perly_h.vms |
411 | perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms |
56febc5e |
412 | |
413 | # We don't want to regenerate perly.c and perly.h, but they might |
414 | # appear out-of-date after a patch is applied or a new distribution is |
415 | # made. |
416 | perly.c: perly.y |
cd4d8a96 |
417 | -@sh -c true |
56febc5e |
418 | |
419 | perly.h: perly.y |
cd4d8a96 |
420 | -@sh -c true |
a0d0e21e |
421 | |
bd656b61 |
422 | # No compat3.sym here since and including the 5.004_50. |
423 | SYM = global.sym interp.sym perlio.sym thread.sym |
419eaf7b |
424 | |
425 | SYMH = perlvars.h thrdvar.h |
426 | |
a8581515 |
427 | # The following files are generated automatically |
e50aee73 |
428 | # keywords.h: keywords.pl |
429 | # opcode.h: opcode.pl |
430 | # embed.h: embed.pl global.sym interp.sym |
a8581515 |
431 | # byterun.h: bytecode.pl |
432 | # byterun.c: bytecode.pl |
433 | # lib/B/Asmdata.pm: bytecode.pl |
e50aee73 |
434 | # The correct versions should be already supplied with the perl kit, |
435 | # in case you don't have perl available. |
436 | # To force them to run, type |
437 | # make regen_headers |
438 | regen_headers: FORCE |
439 | perl keywords.pl |
440 | perl opcode.pl |
441 | perl embed.pl |
a8581515 |
442 | perl bytecode.pl |
8e07c86e |
443 | |
a0d0e21e |
444 | # Extensions: |
445 | # Names added to $(dynamic_ext) or $(static_ext) will automatically |
fed7345c |
446 | # get built. There should ordinarily be no need to change any of |
a0d0e21e |
447 | # this part of makefile. |
448 | # |
449 | # The dummy dependency is a place holder in case $(dynamic_ext) or |
450 | # $(static_ext) is empty. |
451 | # |
452 | # DynaLoader may be needed for extensions that use Makefile.PL. |
453 | |
454 | $(DYNALOADER): miniperl preplibrary FORCE |
c4f23d77 |
455 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e |
456 | |
457 | d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE |
c4f23d77 |
458 | @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
a0d0e21e |
459 | |
460 | s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE |
c4f23d77 |
461 | @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) |
2304df62 |
462 | |
17b893d8 |
463 | clean: _tidy _mopup |
70af249b |
464 | |
465 | realclean: _cleaner _mopup |
4e2a5f63 |
466 | @echo "Note that make realclean does not delete config.sh or Policy.sh" |
70af249b |
467 | |
468 | clobber: _cleaner _mopup |
4e2a5f63 |
469 | rm -f config.sh cppstdin Policy.sh |
70af249b |
470 | |
471 | distclean: clobber |
472 | |
473 | # Do not 'make _mopup' directly. |
474 | _mopup: |
cd4d8a96 |
475 | rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c |
fed7345c |
476 | rm -f perl.exp ext.libs |
d96ebe2e |
477 | -rm -f perl.export perl.dll perl.libexp perl.map perl.def |
70af249b |
478 | rm -f perl suidperl miniperl $(LIBPERL) |
479 | |
480 | # Do not 'make _tidy' directly. |
481 | _tidy: |
a0d0e21e |
482 | -cd pod; $(MAKE) clean |
909b3858 |
483 | -cd utils; $(MAKE) clean |
484 | -cd x2p; $(MAKE) clean |
75f92628 |
485 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \ |
fb73857a |
486 | sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \ |
a0d0e21e |
487 | done |
ff68c719 |
488 | |
489 | # Do not 'make _cleaner' directly. |
490 | _cleaner: |
4633a7c4 |
491 | -cd os2; rm -f Makefile |
909b3858 |
492 | -cd pod; $(MAKE) realclean |
493 | -cd utils; $(MAKE) realclean |
494 | -cd x2p; $(MAKE) realclean |
8e07c86e |
495 | -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \ |
fb73857a |
496 | sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \ |
a0d0e21e |
497 | done |
42793c05 |
498 | rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl |
a0d0e21e |
499 | rm -rf $(addedbyconf) |
cd4d8a96 |
500 | rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old |
fed7345c |
501 | rm -f $(private) |
a0d0e21e |
502 | rm -rf lib/auto |
232e078e |
503 | rm -f lib/.exists |
16d20bd9 |
504 | rm -f h2ph.man pstruct |
a0d0e21e |
505 | rm -rf .config |
ecfc5424 |
506 | |
2304df62 |
507 | # The following lint has practically everything turned on. Unfortunately, |
508 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. |
509 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message |
510 | # for that spot. |
511 | |
512 | lint: perly.c $(c) |
513 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz |
514 | |
fb73857a |
515 | # Need to unset during recursion to go out of loop. |
516 | # The README below ensures that the dependency list is never empty and |
517 | # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding. |
cd4d8a96 |
518 | |
84902520 |
519 | MAKEDEPEND = Makefile makedepend |
cd4d8a96 |
520 | |
fb73857a |
521 | $(FIRSTMAKEFILE): README $(MAKEDEPEND) |
cd4d8a96 |
522 | $(MAKE) depend MAKEDEPEND= |
a0d0e21e |
523 | |
599a829f |
524 | config.h: config_h.SH config.sh |
655635e8 |
525 | $(SHELL) config_h.SH |
526 | |
419eaf7b |
527 | # This is an AIXism. |
528 | perl.exp: perl_exp.SH config.sh $(SYM) $(SYMH) |
655635e8 |
529 | $(SHELL) perl_exp.SH |
75f92628 |
530 | |
a0d0e21e |
531 | # When done, touch perlmain.c so that it doesn't get remade each time. |
2304df62 |
532 | depend: makedepend |
fb73857a |
533 | sh ./makedepend MAKE=$(MAKE) |
a0d0e21e |
534 | - test -s perlmain.c && touch perlmain.c |
2304df62 |
535 | cd x2p; $(MAKE) depend |
536 | |
cd4d8a96 |
537 | # Cannot postpone this until $firstmakefile is ready ;-) |
538 | makedepend: makedepend.SH config.sh |
539 | sh ./makedepend.SH |
540 | |
3e3baf6d |
541 | test-prep: miniperl perl preplibrary $(dynamic_ext) |
542 | cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT)) |
543 | |
544 | test check: test-prep |
c4f23d77 |
545 | cd t && $(LDLIBPTH) ./perl TEST </dev/tty |
3e3baf6d |
546 | |
547 | # For testing without a tty or controling terminal. See t/op/stat.t |
548 | test-notty: test-prep |
c4f23d77 |
549 | cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST |
2304df62 |
550 | |
d96ebe2e |
551 | # Can't depend on lib/Config.pm because that might be where miniperl |
552 | # is crashing. |
599a829f |
553 | minitest: miniperl |
d96ebe2e |
554 | @echo "You may see some irrelevant test failures if you have been unable" |
555 | @echo "to build lib/Config.pm." |
cd4d8a96 |
556 | - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \ |
c4f23d77 |
557 | && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t </dev/tty |
16d20bd9 |
558 | |
fb73857a |
559 | # Handy way to run perlbug -ok without having to install and run the |
84902520 |
560 | # installed perlbug. We don't re-run the tests here - we trust the user. |
fb73857a |
561 | # Please *don't* use this unless all tests pass. |
562 | # If you want to report test failures, just use "perlbug -Ilib". |
188cd53f |
563 | ok: utilities |
c4f23d77 |
564 | $(LBLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' |
84902520 |
565 | |
85e6fe83 |
566 | clist: $(c) |
2304df62 |
567 | echo $(c) | tr ' ' '\012' >.clist |
568 | |
85e6fe83 |
569 | hlist: $(h) |
2304df62 |
570 | echo $(h) | tr ' ' '\012' >.hlist |
571 | |
85e6fe83 |
572 | shlist: $(sh) |
2304df62 |
573 | echo $(sh) | tr ' ' '\012' >.shlist |
574 | |
4633a7c4 |
575 | pllist: $(pl) |
576 | echo $(pl) | tr ' ' '\012' >.pllist |
577 | |
599a829f |
578 | Makefile: Makefile.SH ./config.sh |
760ac839 |
579 | $(SHELL) Makefile.SH |
580 | |
599a829f |
581 | distcheck: FORCE |
760ac839 |
582 | perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' |
583 | |
3ee700d1 |
584 | etags: |
585 | sh emacs/ptags |
586 | |
2304df62 |
587 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
588 | # If this runs make out of memory, delete /usr/include lines. |
589 | !NO!SUBS! |
590 | |
85e6fe83 |
591 | $eunicefix Makefile |
2304df62 |
592 | case `pwd` in |
593 | *SH) |
85e6fe83 |
594 | $rm -f ../Makefile |
cd4d8a96 |
595 | $ln Makefile ../Makefile |
2304df62 |
596 | ;; |
597 | esac |
cd4d8a96 |
598 | $rm -f $firstmakefile |