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