1 # This file is read by Makefile.SH to produce rules for $(LIBPERL) (and
2 # some additional rules as well).
4 # Rerun `sh Makefile.SH; make depend' after making any change.
6 # Additional rules supported: perl_, aout_test, aout_install, use them
7 # for a.out style perl (which may fork).
9 $spitshell >>Makefile <<!GROK!THIS!
11 AOUT_OPTIMIZE = $optimize
12 AOUT_CCCMD = \$(CC) $aout_ccflags \$(AOUT_OPTIMIZE)
14 AOUT_OBJ_EXT = $aout_obj_ext
15 AOUT_LIB_EXT = $aout_lib_ext
16 AOUT_LIBPERL = libperl$aout_lib_ext
17 AOUT_CLDFLAGS = $aout_ldflags
19 AOUT_LIBPERL_DLL = libperl_dll$aout_lib_ext
20 AOUT_CCCMD_DLL = \$(CC) -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK
21 AOUT_CLDFLAGS_DLL = -Zexe -Zmt -Zcrtdll
27 $spitshell >>Makefile <<'!NO!SUBS!'
28 $(LIBPERL): perl.imp perl.dll perl5.def
29 emximp -o $(LIBPERL) perl.imp
31 $(AOUT_LIBPERL_DLL): perl.imp perl.dll perl5.def
32 emximp -o $(AOUT_LIBPERL_DLL) perl.imp
35 emximp -o perl.imp perl5.def
36 echo 'emx_calloc emxlibcm 400 ?' >> $@
37 echo 'emx_free emxlibcm 401 ?' >> $@
38 echo 'emx_malloc emxlibcm 402 ?' >> $@
39 echo 'emx_realloc emxlibcm 403 ?' >> $@
41 perl.dll: $(obj) perl5.def perl$(OBJ_EXT)
42 $(LD) $(LD_OPT) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def
44 perl5.def: perl.linkexp
45 echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@
46 echo DESCRIPTION "'Perl interpreter, export autogenerated'" >>$@
47 echo STACKSIZE 32768 >>$@
48 echo CODE LOADONCALL >>$@
49 echo DATA LOADONCALL NONSHARED MULTIPLE >>$@
53 if [ ! -z "$myttyname" ] ; then
54 $spitshell >>Makefile <<'!NO!SUBS!'
55 echo ' "ttyname"' >>$@
59 $spitshell >>Makefile <<'!NO!SUBS!'
62 # grep -v '"\(malloc\|realloc\|free\)"' perl.linkexp >>$@
65 perl.exports: perl.exp EXTERN.h perl.h
66 (echo "#include \"EXTERN.h\" \n#include \"perl.h\" \n#include \"perl.exp\""; \
67 echo "malloc\nrealloc\ncalloc\nfree") | \
68 $(CC) -DEMBED -E - | \
69 awk '{if ($$2 == "") print $$1}' | sort | uniq > $@
71 perl.linkexp: perl.exports perl.map
72 cat perl.exports os2/os2.sym perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp
74 # We link miniperl statically, since .DLL depends on $(DYNALOADER)
76 perl.map miniperl: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT)
77 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map
78 awk '{if ($$3 == "") print $$2}' <miniperl.map | sort | uniq > perl.map
80 @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
82 depend: os2ish.h dlfcn.h os2thread.h os2.c
84 # Stupid make? Needed...
87 os2.c: os2/os2.c os2ish.h
90 dl_os2.c: os2/dl_os2.c os2ish.h
93 os2ish.h: os2/os2ish.h
96 os2thread.h: os2/os2thread.h
102 # This one is compiled OMF, so cannot fork():
104 perl___: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
105 $(SHRPENV) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl___ perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs)
108 perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR)
109 perl os2/perl2cmd.pl $(INSTALLCMDDIR)
113 aout_obj = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(obj)))
114 AOUT_DYNALOADER = $(addsuffix $(AOUT_LIB_EXT),$(basename $(DYNALOADER)))
115 aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(dynamic_ext)))
116 aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(dynamic_ext)))
118 aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext)))
119 DYNALOADER_OBJ = ext/DynaLoader/DynaLoader$(OBJ_EXT)
120 aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext)))
121 AOUT_DYNALOADER_OBJ = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(DYNALOADER_OBJ)))
123 $(AOUT_DYNALOADER_OBJ) : $(DYNALOADER_OBJ)
126 $(DYNALOADER_OBJ) : $(DYNALOADER)
129 $(AOUT_LIBPERL) : $(aout_obj) perl$(AOUT_OBJ_EXT)
131 $(AOUT_AR) rcu $@ perl$(AOUT_OBJ_EXT) $(aout_obj)
134 $(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c
136 perlmain(AOUT_OBJ_EXT): perlmain.c
137 $(AOUT_CCCMD_DLL) $(PLDLFLAGS) -c perlmain.c
139 aout_perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit)
140 sh writemain $(DYNALOADER) $(aout_static_lib) > tmp
141 sh mv-if-diff tmp aout_perlmain.c
143 miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) ext.libs
144 $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) `cat ext.libs` $(libs)
146 perl_: $& aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(AOUT_DYNALOADER) $(aout_static_ext) ext.libs
147 $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o perl_ aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER) $(aout_static_ext) $(AOUT_LIBPERL) `cat ext.libs` $(libs)
149 perl : perl__ perl___
151 perl__: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
152 $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs) -Zlinker /PM:PM
154 # Forking dynamically loaded perl:
156 perl: $& perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER_OBJ) $(aout_static_ext_dll) $(AOUT_LIBPERL_DLL) ext.libs
157 $(CC) $(LARGE) $(AOUT_CLDFLAGS_DLL) $(CCDLFLAGS) -o perl perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER_OBJ) $(aout_static_ext_dll) $(AOUT_LIBPERL_DLL) `cat ext.libs` $(libs)
162 -rm *perl_.* *.o *.a lib/auto/*/*.a ext/*/Makefile.aout
164 aout_install: perl_ aout_install.perl
166 aout_install.perl: perl_ installperl
170 - cd t && (rm -f perl_$(EXE_EXT); $(LNS) ../perl_$(EXE_EXT) perl$(EXE_EXT)) && ./perl TEST </dev/tty
172 lib/auto/OS2/*/%.a : ext/OS2/%/Makefile.aout
173 cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..."
174 cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
176 lib/auto/*/%.a : ext/%/Makefile.aout
177 cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..."
178 cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
180 .PRECIOUS : ext/%/Makefile.aout ext/OS2/%/Makefile.aout
182 ext/OS2/%/Makefile.aout : miniperl_
183 cd $(dir $@) ; ../../../miniperl_ -I ../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl
185 ext/%/Makefile.aout : miniperl_
186 cd $(dir $@) ; ../../miniperl_ -I ../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl