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