Commit | Line | Data |
f9c39ab5 |
1 | # This file is read by Makefile.SH to produce rules for $(LIBPERL) (and |
e95c8f0e |
2 | # some additional rules as well). |
3 | |
4 | # Rerun `sh Makefile.SH; make depend' after making any change. |
5 | |
6 | # Additional rules supported: perl_, aout_test, aout_install, use them |
7 | # for a.out style perl (which may fork). |
8 | |
cceca5ed |
9 | perl_fullversion="5.00${PERL_VERSION}_$PERL_SUBVERSION" |
3aefca04 |
10 | case "$archname" in |
cceca5ed |
11 | *-thread*) perl_fullversion="${perl_fullversion}-threaded";; |
3aefca04 |
12 | esac |
13 | |
3cfae81b |
14 | dll_post="`echo $perl_fullversion | sum | sed -e 's/^0*//' | awk '{print $1}'`" |
017f25f1 |
15 | dll_post="`printf '%x' $dll_post | tr '[a-z]' '[A-Z]'`" |
16 | |
b732e2e2 |
17 | aout_extra_libs='' |
18 | aout_extra_sep='' |
19 | for xxx in $aout_extra_static_ext; do |
20 | aout_extra_dir=`echo "$xxx" | sed -e 's/::/\//g'` |
21 | aout_extra_lib="lib/auto/$aout_extra_dir/"`basename "$aout_extra_dir"` |
22 | aout_extra_libs="$aout_extra_libs$aout_extra_sep$aout_extra_lib$aout_lib_ext" |
23 | aout_extra_sep=' ' |
24 | done |
25 | |
e95c8f0e |
26 | $spitshell >>Makefile <<!GROK!THIS! |
27 | |
cceca5ed |
28 | PERL_FULLVERSION = $perl_fullversion |
3aefca04 |
29 | |
6756f2f0 |
30 | AOUT_OPTIMIZE = \$(OPTIMIZE) |
0eb4ebd7 |
31 | AOUT_CCCMD = \$(CC) -DPERL_CORE $aout_ccflags \$(AOUT_OPTIMIZE) |
e95c8f0e |
32 | AOUT_AR = $aout_ar |
33 | AOUT_OBJ_EXT = $aout_obj_ext |
34 | AOUT_LIB_EXT = $aout_lib_ext |
f9c39ab5 |
35 | AOUT_LIBPERL = libperl$aout_lib_ext |
e95c8f0e |
36 | AOUT_CLDFLAGS = $aout_ldflags |
37 | |
dd3366de |
38 | AOUT_LIBPERL_DLL = libperl_dll$aout_lib_ext |
72ea3524 |
39 | AOUT_CCCMD_DLL = \$(CC) -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK |
491527d0 |
40 | AOUT_CLDFLAGS_DLL = -Zexe -Zmt -Zcrtdll -Zstack 32000 |
dd3366de |
41 | |
764df951 |
42 | # No -DPERL_CORE |
43 | SO_CCCMD = \$(CC) $ccflags \$(OPTIMIZE) |
44 | |
f07bc2fb |
45 | LD_OPT = \$(OPTIMIZE) |
59ad941d |
46 | PERL_DLL_LD_OPT = -Zmap -Zlinker /map/li |
84902520 |
47 | |
3aefca04 |
48 | PERL_DLL_BASE = perl$dll_post |
49 | PERL_DLL = \$(PERL_DLL_BASE)\$(DLSUFFIX) |
d6a255e6 |
50 | TEST_PERL_DLL = perl_dll_t |
017f25f1 |
51 | CONFIG_ARGS = $config_args |
b732e2e2 |
52 | AOUT_EXTRA_LIBS = $aout_extra_libs |
3aefca04 |
53 | |
e95c8f0e |
54 | !GROK!THIS! |
82835e01 |
55 | |
56 | $spitshell >>Makefile <<'!NO!SUBS!' |
a64c954a |
57 | PREPLIBRARY_LIBPERL = $(LIBPERL) |
59ad941d |
58 | $(LIBPERL): perl.imp perl5.def libperl_override.lib |
f9c39ab5 |
59 | emximp -o $(LIBPERL) perl.imp |
dfcfdb64 |
60 | cp $(LIBPERL) perl.lib |
82835e01 |
61 | |
59ad941d |
62 | imp_version: $(FIRSTMAKEFILE) |
63 | echo $(PERL_DLL_BASE) > imp_version.tmp |
64 | sh mv-if-diff imp_version.tmp $@ |
65 | |
66 | libperl_override.imp: os2/os2add.sym miniperl imp_version |
5ba48348 |
67 | ./miniperl -wnle 'print "$$_\t$(PERL_DLL_BASE)\t$$_\t?"' os2/os2add.sym > tmp.imp |
68 | echo 'strdup $(PERL_DLL_BASE) Perl_strdup ?' >> tmp.imp |
69 | echo 'putenv $(PERL_DLL_BASE) Perl_putenv ?' >> tmp.imp |
70 | sh mv-if-diff tmp.imp $@ |
71 | |
72 | libperl_override.lib: libperl_override.imp |
73 | emximp -o $@ libperl_override.imp |
74 | |
59ad941d |
75 | libperl_dllmain.imp: imp_version |
76 | echo 'main $(PERL_DLL_BASE) dll_perlmain ?' >> tmpdll.imp |
77 | sh mv-if-diff tmpdll.imp $@ |
78 | |
79 | libperl_dllmain.lib: libperl_dllmain.imp |
80 | emximp -o $@ libperl_dllmain.imp |
81 | |
82 | libperl_dllmain.a: libperl_dllmain.imp |
83 | emximp -o $@ libperl_dllmain.imp |
84 | |
3aefca04 |
85 | $(AOUT_LIBPERL_DLL): perl.imp $(PERL_DLL) perl5.def |
dd3366de |
86 | emximp -o $(AOUT_LIBPERL_DLL) perl.imp |
87 | |
59ad941d |
88 | perl.imp: perl5.def imp_version |
82835e01 |
89 | emximp -o perl.imp perl5.def |
df3ef7a9 |
90 | echo 'emx_calloc emxlibcm 400 ?' >> $@ |
91 | echo 'emx_free emxlibcm 401 ?' >> $@ |
92 | echo 'emx_malloc emxlibcm 402 ?' >> $@ |
93 | echo 'emx_realloc emxlibcm 403 ?' >> $@ |
82835e01 |
94 | |
764df951 |
95 | .PHONY: perl_dll installcmd aout_clean aout_install aout_install.perl \ |
96 | perlrexx test_prep_perl_ test_prep_perl_sys test_prep_perl_stat \ |
97 | test_prep_perl_stat_aout test_prep_various \ |
98 | stat_aout_harness aout_harness stat_harness sys_harness all_harness \ |
59ad941d |
99 | stat_aout_test aout_test stat_test sys_test all_test \ |
100 | perl___harness test_harness_redir |
764df951 |
101 | |
017f25f1 |
102 | perl_dll: $(PERL_DLL) |
103 | |
d6a255e6 |
104 | perl_dll_t: t/$(PERL_DLL) |
105 | |
106 | t/$(PERL_DLL): $(PERL_DLL) |
107 | $(LNS) $(PERL_DLL) t/$(PERL_DLL) |
108 | |
59ad941d |
109 | $(PERL_DLL): $(obj) perl5.def perl$(OBJ_EXT) perlmain$(OBJ_EXT) $(DYNALOADER) |
110 | $(LD) $(LD_OPT) $(LDDLFLAGS) $(PERL_DLL_LD_OPT) -o $@ perl$(OBJ_EXT) $(obj) perlmain$(OBJ_EXT) $(DYNALOADER) $(libs) perl5.def || ( rm $(PERL_DLL) && sh -c false ) |
82835e01 |
111 | |
3cfae81b |
112 | perl5.olddef: perl.linkexp |
3aefca04 |
113 | echo "LIBRARY '$(PERL_DLL_BASE)' INITINSTANCE TERMINSTANCE" > $@ |
23da6c43 |
114 | echo DESCRIPTION "'Perl interpreter v$(PERL_FULLVERSION), export autogenerated'" >>$@ |
82835e01 |
115 | echo STACKSIZE 32768 >>$@ |
116 | echo CODE LOADONCALL >>$@ |
117 | echo DATA LOADONCALL NONSHARED MULTIPLE >>$@ |
118 | echo EXPORTS >>$@ |
82835e01 |
119 | !NO!SUBS! |
120 | |
121 | if [ ! -z "$myttyname" ] ; then |
122 | $spitshell >>Makefile <<'!NO!SUBS!' |
123 | echo ' "ttyname"' >>$@ |
124 | !NO!SUBS! |
125 | fi |
126 | |
127 | $spitshell >>Makefile <<'!NO!SUBS!' |
128 | cat perl.linkexp >>$@ |
129 | |
130 | # grep -v '"\(malloc\|realloc\|free\)"' perl.linkexp >>$@ |
131 | |
132 | |
82835e01 |
133 | perl.exports: perl.exp EXTERN.h perl.h |
ff68c719 |
134 | (echo "#include \"EXTERN.h\" \n#include \"perl.h\" \n#include \"perl.exp\""; \ |
135 | echo "malloc\nrealloc\ncalloc\nfree") | \ |
82835e01 |
136 | $(CC) -DEMBED -E - | \ |
137 | awk '{if ($$2 == "") print $$1}' | sort | uniq > $@ |
138 | |
3aefca04 |
139 | perl.linkexp: perl.exports perl.map os2/os2.sym |
dd96f567 |
140 | cat perl.exports os2/os2.sym perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp |
82835e01 |
141 | |
84902520 |
142 | # We link miniperl statically, since .DLL depends on $(DYNALOADER) |
143 | |
a64c954a |
144 | miniperl.map: miniperl |
145 | |
146 | miniperl.exe: miniperl |
147 | |
148 | miniperl: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) |
74294fdf |
149 | $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) `echo $(obj)|sed -e 's/\bop\./opmini./g'` $(libs) -Zmap -Zlinker /map/PM:VIO |
bd0dd1d8 |
150 | @./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest |
82835e01 |
151 | |
dd96f567 |
152 | depend: os2ish.h dlfcn.h os2thread.h os2.c |
82835e01 |
153 | |
154 | # Stupid make? Needed... |
155 | os2$(OBJ_EXT) : os2.c |
156 | |
157 | os2.c: os2/os2.c os2ish.h |
491527d0 |
158 | cp -f $< $@ |
82835e01 |
159 | |
e95c8f0e |
160 | dl_os2.c: os2/dl_os2.c os2ish.h |
491527d0 |
161 | cp -f $< $@ |
e95c8f0e |
162 | |
82835e01 |
163 | os2ish.h: os2/os2ish.h |
491527d0 |
164 | cp -f $< $@ |
82835e01 |
165 | |
dd96f567 |
166 | os2thread.h: os2/os2thread.h |
491527d0 |
167 | cp -f $< $@ |
dd96f567 |
168 | |
e95c8f0e |
169 | dlfcn.h: os2/dlfcn.h |
491527d0 |
170 | cp -f $< $@ |
e95c8f0e |
171 | |
764df951 |
172 | # Non-Forking dynamically loaded perl |
59ad941d |
173 | # Make many: they are useful in low-memory conditions (floppy boot? Lot of shared memory used?) |
dd3366de |
174 | |
59ad941d |
175 | perl___$(EXE_EXT) perl___: $& libperl_dllmain$(LIB_EXT) |
176 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl___ libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
177 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 8192 -o perl___8 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
178 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 4096 -o perl___4 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
179 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 2048 -o perl___2 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
180 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 1024 -o perl___1 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
181 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 512 -o perl___05 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
182 | $(SHRPENV) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -Zstack 320 -o perl___03 libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
e95c8f0e |
183 | |
53285a48 |
184 | # This one is compiled -Zsys, so cannot do many things: |
185 | |
764df951 |
186 | # Remove -Zcrtdll |
187 | STAT_CLDFLAGS = -Zexe -Zomf -Zmt -Zstack 32000 |
188 | |
189 | # Non-forking dynamically loaded perl with a wrong CRT library: |
190 | |
59ad941d |
191 | perl_stat perl_stat$(EXE_EXT): $& libperl_dllmain$(LIB_EXT) |
192 | $(SHRPENV) $(CC) $(STAT_CLDFLAGS) $(CCDLFLAGS) -o perl_stat libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
764df951 |
193 | |
53285a48 |
194 | # Remove -Zcrtdll, add -Zsys |
764df951 |
195 | SYS_CLDFLAGS = $(STAT_CLDFLAGS) -Zsys |
196 | |
197 | # Non-Forking dynamically loaded perl without EMX - so with wrong CRT library |
53285a48 |
198 | |
59ad941d |
199 | perl_sys perl_sys$(EXE_EXT): $& libperl_dllmain$(LIB_EXT) |
200 | $(SHRPENV) $(CC) $(SYS_CLDFLAGS) $(CCDLFLAGS) -o perl_sys libperl_dllmain$(LIB_EXT) -Zlinker /map/PM:VIO |
53285a48 |
201 | |
82835e01 |
202 | installcmd : |
e71dd89f |
203 | @perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR) |
204 | ./miniperl -Ilib os2/perl2cmd.pl $(INSTALLCMDDIR) |
82835e01 |
205 | |
e95c8f0e |
206 | # Aout section: |
207 | |
208 | aout_obj = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(obj))) |
209 | AOUT_DYNALOADER = $(addsuffix $(AOUT_LIB_EXT),$(basename $(DYNALOADER))) |
8ee276f3 |
210 | aout_ext = $(static_ext) $(dynamic_ext) $(AOUT_EXTRA_LIBS) |
b732e2e2 |
211 | aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(aout_ext))) |
212 | aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(aout_ext))) |
e95c8f0e |
213 | |
dd3366de |
214 | aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext))) |
215 | DYNALOADER_OBJ = ext/DynaLoader/DynaLoader$(OBJ_EXT) |
216 | aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext))) |
217 | AOUT_DYNALOADER_OBJ = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(DYNALOADER_OBJ))) |
218 | |
219 | $(AOUT_DYNALOADER_OBJ) : $(DYNALOADER_OBJ) |
220 | emxaout -o $@ $< |
221 | |
222 | $(DYNALOADER_OBJ) : $(DYNALOADER) |
223 | @sh -c true |
224 | |
f9c39ab5 |
225 | $(AOUT_LIBPERL) : $(aout_obj) perl$(AOUT_OBJ_EXT) |
dd3366de |
226 | rm -f $@ |
227 | $(AOUT_AR) rcu $@ perl$(AOUT_OBJ_EXT) $(aout_obj) |
59ad941d |
228 | cp $@ perl$(AOUT_LIB_EXT) |
e95c8f0e |
229 | |
230 | .c$(AOUT_OBJ_EXT): |
231 | $(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c |
232 | |
bd0dd1d8 |
233 | opmini$(AOUT_OBJ_EXT): op.c |
234 | $(AOUT_CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB -o opmini$(AOUT_OBJ_EXT) -c op.c |
235 | |
dd3366de |
236 | perlmain(AOUT_OBJ_EXT): perlmain.c |
237 | $(AOUT_CCCMD_DLL) $(PLDLFLAGS) -c perlmain.c |
238 | |
59ad941d |
239 | # Assume that extensions are at most 4 deep (this is so with 5.8.1) |
8ee276f3 |
240 | aout_extlist: $(aout_static_ext) $(AOUT_DYNALOADER) |
59ad941d |
241 | echo lib/auto/*.a lib/auto/*/*.a lib/auto/*/*/*.a lib/auto/*/*/*/*.a | tr ' ' '\n' | grep -v '\*' > $@.tmp |
242 | sh mv-if-diff $@.tmp $@ |
243 | |
244 | aout_perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit) $(aout_static_ext) writemain aout_extlist |
245 | sh writemain `cat aout_extlist` > aout_perlmain.tmp |
246 | sh mv-if-diff aout_perlmain.tmp aout_perlmain.c |
e95c8f0e |
247 | |
764df951 |
248 | _preplibrary = miniperl lib/Config.pm lib/lib.pm lib/re.pm |
249 | |
250 | miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) opmini$(AOUT_OBJ_EXT) $(_preplibrary) |
74294fdf |
251 | $(CC) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) opmini$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(libs) |
e95c8f0e |
252 | |
764df951 |
253 | # Forking statically loaded perl |
254 | |
dfcfdb64 |
255 | # Need a miniperl_ dependency, since $(AOUT_DYNALOADER) is build via implicit |
256 | # rules, thus would not rebuild miniperl_ via an explicit rule |
257 | |
59ad941d |
258 | perl_$(EXE_EXT) perl_: $& miniperl_ aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(AOUT_DYNALOADER) $(aout_static_ext) ext.libs aout_extlist |
259 | $(CC) $(AOUT_CLDFLAGS) $(CCDLFLAGS) $(OPTIMIZE) -o perl_ aout_perlmain$(AOUT_OBJ_EXT) `cat aout_extlist` $(AOUT_LIBPERL) `cat ext.libs` $(libs) |
e95c8f0e |
260 | |
764df951 |
261 | # Remove -Zcrtdll |
262 | STAT_AOUT_CLDFLAGS = -Zexe -Zmt -Zstack 32000 |
263 | |
264 | # Forking dynamically loaded perl with a wrong CRT library: |
265 | |
59ad941d |
266 | perl_stat_aout$(EXE_EXT) perl_stat_aout: $& libperl_dllmain$(AOUT_LIB_EXT) |
267 | $(SHRPENV) $(CC) $(STAT_AOUT_CLDFLAGS) $(CCDLFLAGS) $(OPTIMIZE) -o perl_stat_aout libperl_dllmain$(AOUT_LIB_EXT) |
764df951 |
268 | |
9e2a34c1 |
269 | PERLREXX_DLL = perlrexx.dll |
270 | |
59ad941d |
271 | perl perl$(EXE_EXT) : perl__ perl___ $(PERLREXX_DLL) $(PERL_DLL) |
760ac839 |
272 | |
764df951 |
273 | # Dynamically loaded PM-application perl: |
274 | |
59ad941d |
275 | perl__$(EXE_EXT) perl__: $& libperl_dllmain$(LIB_EXT) |
276 | $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ libperl_dllmain$(LIB_EXT) -Zlinker /PM:PM |
760ac839 |
277 | |
dd3366de |
278 | # Forking dynamically loaded perl: |
279 | |
59ad941d |
280 | perl$(EXE_EXT) perl: $& libperl_dllmain$(AOUT_LIB_EXT) |
281 | $(CC) $(AOUT_CLDFLAGS_DLL) $(CCDLFLAGS) -o perl libperl_dllmain$(AOUT_LIB_EXT) |
dd3366de |
282 | |
283 | clean: aout_clean |
284 | |
e95c8f0e |
285 | aout_clean: |
59ad941d |
286 | -rm *perl_.* *.o *.a lib/auto/*/*.a lib/auto/*/*/*.a lib/auto/*/*/*/*.a ext/*/Makefile.aout ext/*/*/Makefile.aout ext/*/*/*/Makefile.aout |
e95c8f0e |
287 | |
288 | aout_install: perl_ aout_install.perl |
289 | |
290 | aout_install.perl: perl_ installperl |
70eaf669 |
291 | ./perl_ installperl --destdir="$(DESTDIR)" |
e95c8f0e |
292 | |
9e2a34c1 |
293 | perlrexx: $(PERLREXX_DLL) |
764df951 |
294 | @sh -c true |
295 | |
296 | perlrexx.c: os2/perlrexx.c |
297 | @cp -f os2/$@ $@ |
298 | |
299 | # Remove -Zexe, add -Zdll -Zso. No stack needed |
300 | SO_CLDFLAGS = -Zdll -Zso -Zomf -Zmt -Zsys |
301 | |
302 | # A callable-from-REXX DLL |
303 | |
9e2a34c1 |
304 | $(PERLREXX_DLL): perlrexx$(OBJ_EXT) perlrexx.def |
764df951 |
305 | $(SHRPENV) $(CC) $(SO_CLDFLAGS) $(CCDLFLAGS) -o $@ perlrexx$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs) perlrexx.def |
306 | |
9e2a34c1 |
307 | perlrexx.def: miniperl $(_preplibrary) |
764df951 |
308 | echo "LIBRARY 'perlrexx' INITINSTANCE TERMINSTANCE" > tmp.def |
309 | echo "DESCRIPTION '@#perl5-porters@perl.org:`miniperl -Ilib -MConfig -e 'print \$$]'`#@ REXX to Perl `miniperl -Ilib -MConfig -e 'print \$$Config{version}'` interface'" >> tmp.def |
310 | echo "EXPORTS" >> tmp.def |
311 | echo ' "PERL"' >> tmp.def |
312 | echo ' "PERLTERM"' >> tmp.def |
313 | echo ' "PERLINIT"' >> tmp.def |
314 | echo ' "PERLEXIT"' >> tmp.def |
315 | echo ' "PERLEVAL"' >> tmp.def |
9e2a34c1 |
316 | echo ' "PERLLASTERROR"' >> tmp.def |
317 | echo ' "PERLEVALSUBCOMMAND"' >> tmp.def |
318 | echo ' "PERLEXPORTALL"' >> tmp.def |
319 | echo ' "PERLDROPALL"' >> tmp.def |
320 | echo ' "PERLDROPALLEXIT"' >> tmp.def |
764df951 |
321 | sh mv-if-diff tmp.def $@ |
322 | |
323 | |
324 | perlrexx$(OBJ_EXT): perlrexx.c |
325 | $(SO_CCCMD) $(PLDLFLAGS) -c perlrexx.c |
326 | |
327 | # To test with harness, one needed to HARNESS_IGNORE_EXITCODE=2 |
760ac839 |
328 | |
764df951 |
329 | # Define to be empty to get a TTY test |
330 | REDIR_TEST = 2>&1 | tee 00_$@ |
53285a48 |
331 | |
764df951 |
332 | test_prep_perl_: test_prep_pre miniperl_ ./perl_$(EXE_EXT) |
333 | PERL=./perl_ $(MAKE) _test_prep |
53285a48 |
334 | |
764df951 |
335 | test_prep_various: test_prep_pre miniperl $(dynamic_ext) $(TEST_PERL_DLL) |
336 | |
337 | test_prep_perl_sys: test_prep_various ./perl_sys$(EXE_EXT) |
338 | PERL=./perl_sys $(MAKE) _test_prep |
339 | |
340 | test_prep_perl___: test_prep_various ./perl___$(EXE_EXT) |
341 | PERL=./perl___ $(MAKE) _test_prep |
342 | |
343 | test_prep_perl_stat: test_prep_various ./perl_stat$(EXE_EXT) |
344 | PERL=./perl_stat $(MAKE) _test_prep |
345 | |
346 | test_prep_perl_stat_aout: test_prep_various ./perl_stat_aout$(EXE_EXT) |
347 | PERL=./perl_stat_aout $(MAKE) _test_prep |
348 | |
349 | aout_test: test_prep_perl_ |
350 | PERL=./perl_ $(MAKE) _test |
351 | |
352 | aout_harness: test_prep_perl_ |
353 | -PERL=./perl_ $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
354 | |
355 | sys_test: test_prep_perl_sys |
356 | PERL=./perl_sys $(MAKE) _test |
357 | |
358 | sys_harness: test_prep_perl_sys |
359 | -PERL=./perl_sys $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
360 | |
361 | stat_test: test_prep_perl_stat |
362 | PERL=./perl_stat $(MAKE) _test |
363 | |
364 | stat_harness: test_prep_perl_stat |
365 | -PERL=./perl_stat $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
366 | |
367 | stat_aout_test: test_prep_perl_stat_aout |
368 | PERL=./perl_stat_aout $(MAKE) _test |
369 | |
370 | stat_aout_harness: test_prep_perl_stat_aout |
371 | -PERL=./perl_stat_aout $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
372 | |
373 | perl___test: test_prep_perl___ |
374 | PERL=./perl___ $(MAKE) _test |
375 | |
376 | perl___harness: test_prep_perl___ |
377 | -PERL=./perl___ $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
378 | |
379 | all_test: test aout_test perl___test sys_test stat_test stat_aout_test |
380 | |
59ad941d |
381 | test_harness_redir: test_prep |
382 | -PERL=./perl $(MAKE) TESTFILE=harness _test $(REDIR_TEST) |
383 | |
384 | all_harness: test_harness_redir aout_harness perl___harness sys_harness stat_harness stat_aout_harness |
53285a48 |
385 | |
017f25f1 |
386 | !NO!SUBS! |
e95c8f0e |
387 | |
5f929d0c |
388 | # Now we need to find directories in ./ext/ which are up to 3 level deep |
389 | # Currently (2001/06) there is no directories 4 levels deep. |
390 | # (Only directories so that there is no Makefile.PL some levels up matter.) |
017f25f1 |
391 | |
392 | dirs='' |
5f929d0c |
393 | ddirs='' |
017f25f1 |
394 | preci='ext/%/Makefile.aout ' |
395 | for d in ext/* |
396 | do |
5f929d0c |
397 | # echo "...Checking '$d'..." |
398 | # skip the kid if the parent exists: cmp SDBFile/sdbm, done by MakeMaker |
399 | if test ! -e "$d/Makefile.PL"; then |
400 | # Need to treat subdirectories manually |
401 | # echo "...Checking subdirs of '$d'..." |
402 | d_treated='' |
403 | for dd in $d/* |
404 | do |
405 | if test ! -d $dd; then |
406 | continue |
407 | fi |
408 | if test -e "$dd/Makefile.PL"; then |
409 | if test "X$d_treated" = "X"; then |
410 | d_treated=1 |
411 | # echo "...Found parentless 2-level deep Makefile.PL's in $d/*/:" $d/*/Makefile.PL |
412 | dirs="$dirs $d" |
413 | preci="$preci $d/%/Makefile.aout" |
414 | fi |
415 | else |
416 | # Need to treat subsubdirectories manually |
417 | dd_treated='' |
59ad941d |
418 | for ddd in $dd/* # ext/*/*/*/Makefile.PL |
5f929d0c |
419 | do |
420 | if test ! -d $ddd; then |
421 | continue |
422 | fi |
423 | if test -e "$ddd/Makefile.PL"; then |
424 | if test "X$dd_treated" = "X"; then |
425 | dd_treated=1 |
426 | # echo "...Found parentless 3-level deep Makefile.PL's in $dd/*/:" $dd/*/Makefile.PL |
427 | ddirs="$ddirs $dd" |
428 | preci="$preci $dd/%/Makefile.aout" |
429 | fi |
430 | fi |
431 | done |
432 | fi |
433 | done |
017f25f1 |
434 | fi |
435 | done |
436 | |
59ad941d |
437 | # ext/threads is marked as NORECURS, so we need to specialcase it |
438 | if echo "$static_ext $dynamic_ext" | grep -q threads/shared ; then |
439 | preci="$preci ext/threads/%/Makefile.aout" |
440 | dirs="$dirs ext/threads" |
441 | fi |
442 | |
017f25f1 |
443 | $spitshell >>Makefile <<!GROK!THIS! |
444 | .PRECIOUS : $preci |
445 | |
764df951 |
446 | # Set this to FORCE to force a rebuilt of aout extensions |
447 | |
448 | AOUT_EXTENSIONS_FORCE = |
449 | |
017f25f1 |
450 | !GROK!THIS! |
451 | |
5f929d0c |
452 | for d in $ddirs |
453 | do |
454 | # Remove the leading component ext/ |
455 | dd=`dirname $d` |
456 | pp=`basename $dd` |
457 | p=$pp/`basename $d` |
458 | $spitshell >>Makefile <<!GROK!THIS! |
459 | lib/auto/$p/*/%.a : $d/%/Makefile.aout |
460 | @cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..." |
461 | cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS= |
462 | |
764df951 |
463 | $d/%/Makefile.aout : miniperl_ \$(_preplibrary) \$(AOUT_EXTENSIONS_FORCE) |
c5635c9e |
464 | cd \$(dir \$@) ; ../../../../miniperl_ -I ../../../../lib Makefile.PL FIRST_MAKEFILE=Makefile.aout INSTALLDIRS=perl PERL_CORE=1 |
5f929d0c |
465 | |
466 | !GROK!THIS! |
467 | |
468 | done |
469 | |
017f25f1 |
470 | for d in $dirs |
471 | do |
472 | p=`basename $d` |
473 | $spitshell >>Makefile <<!GROK!THIS! |
5f929d0c |
474 | lib/auto/$p/*/%.a : $d/%/Makefile.aout |
475 | @cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..." |
476 | cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS= |
017f25f1 |
477 | |
764df951 |
478 | $d/%/Makefile.aout : miniperl_ \$(_preplibrary) \$(AOUT_EXTENSIONS_FORCE) |
c5635c9e |
479 | cd \$(dir \$@) ; ../../../miniperl_ -I ../../../lib Makefile.PL FIRST_MAKEFILE=Makefile.aout INSTALLDIRS=perl PERL_CORE=1 |
017f25f1 |
480 | |
481 | !GROK!THIS! |
e95c8f0e |
482 | |
017f25f1 |
483 | done |
760ac839 |
484 | |
764df951 |
485 | # We need to special-case OS2/DLL/DLL.a, since the recipe above will |
486 | # try to find it in ext/OS2/DLL |
487 | |
017f25f1 |
488 | $spitshell >>Makefile <<'!NO!SUBS!' |
764df951 |
489 | lib/auto/OS2/DLL/DLL.a : lib/auto/OS2/REXX/REXX.a |
490 | @sh -c true |
491 | |
017f25f1 |
492 | lib/auto/*/%.a : ext/%/Makefile.aout |
493 | @cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..." |
494 | cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS= |
760ac839 |
495 | |
dfcfdb64 |
496 | ext/%/Makefile.aout : miniperl_ $(_preplibrary) $(AOUT_EXTENSIONS_FORCE) |
c5635c9e |
497 | cd $(dir $@) ; ../../miniperl_ -I ../../lib Makefile.PL FIRST_MAKEFILE=Makefile.aout INSTALLDIRS=perl PERL_CORE=1 |
e95c8f0e |
498 | |
82835e01 |
499 | !NO!SUBS! |