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