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