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_CCCMD = \$(CC) $aout_ccflags $optimize
13 AOUT_OBJ_EXT = $aout_obj_ext
14 AOUT_LIB_EXT = $aout_lib_ext
15 AOUT_LIBPERL = libperl$aout_lib_ext
16 AOUT_CLDFLAGS = $aout_ldflags
18 AOUT_LIBPERL_DLL = libperl_dll$aout_lib_ext
19 AOUT_CCCMD_DLL = \$(CC) -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK
20 AOUT_CLDFLAGS_DLL = -Zexe -Zmt -Zcrtdll
24 $spitshell >>Makefile <<'!NO!SUBS!'
25 $(LIBPERL): perl.imp perl.dll perl5.def
26 emximp -o $(LIBPERL) perl.imp
28 $(AOUT_LIBPERL_DLL): perl.imp perl.dll perl5.def
29 emximp -o $(AOUT_LIBPERL_DLL) perl.imp
32 emximp -o perl.imp perl5.def
33 echo 'emx_calloc emxlibcm 400 ?' >> $@
34 echo 'emx_free emxlibcm 401 ?' >> $@
35 echo 'emx_malloc emxlibcm 402 ?' >> $@
36 echo 'emx_realloc emxlibcm 403 ?' >> $@
38 perl.dll: $(obj) perl5.def perl$(OBJ_EXT)
39 $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def
41 perl5.def: perl.linkexp
42 echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@
43 echo DESCRIPTION "'Perl interpreter, export autogenerated'" >>$@
44 echo STACKSIZE 32768 >>$@
45 echo CODE LOADONCALL >>$@
46 echo DATA LOADONCALL NONSHARED MULTIPLE >>$@
48 echo ' "ctermid"' >>$@
49 echo ' "get_sysinfo"' >>$@
50 echo ' "Perl_OS2_init"' >>$@
51 echo ' "OS2_Perl_data"' >>$@
54 echo ' "dlerror"' >>$@
55 echo ' "my_tmpfile"' >>$@
56 echo ' "my_tmpnam"' >>$@
59 if [ ! -z "$myttyname" ] ; then
60 $spitshell >>Makefile <<'!NO!SUBS!'
61 echo ' "ttyname"' >>$@
65 $spitshell >>Makefile <<'!NO!SUBS!'
68 # grep -v '"\(malloc\|realloc\|free\)"' perl.linkexp >>$@
71 perl.exports: perl.exp EXTERN.h perl.h
72 (echo "#include \"EXTERN.h\" \n#include \"perl.h\" \n#include \"perl.exp\""; \
73 echo "malloc\nrealloc\ncalloc\nfree") | \
74 $(CC) -DEMBED -E - | \
75 awk '{if ($$2 == "") print $$1}' | sort | uniq > $@
77 perl.linkexp: perl.exports perl.map
78 cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp
80 perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT)
81 $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map
82 awk '{if ($$3 == "") print $$2}' <dummy.map | sort | uniq > perl.map
83 rm dummy.exe dummy.map
85 depend: os2ish.h dlfcn.h
87 # Stupid make? Needed...
90 os2.c: os2/os2.c os2ish.h
93 dl_os2.c: os2/dl_os2.c os2ish.h
96 os2ish.h: os2/os2ish.h
102 # We link miniperl statically, since .DLL depends on $(DYNALOADER)
104 miniperl: $& miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj)
105 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs)
106 @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
108 # This one is compiled OMF, so cannot fork():
110 perl___: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
111 $(SHRPENV) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl___ perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs)
114 perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR)
115 perl os2/perl2cmd.pl $(INSTALLCMDDIR)
119 aout_obj = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(obj)))
120 AOUT_DYNALOADER = $(addsuffix $(AOUT_LIB_EXT),$(basename $(DYNALOADER)))
121 aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(dynamic_ext)))
122 aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(dynamic_ext)))
124 aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext)))
125 DYNALOADER_OBJ = ext/DynaLoader/DynaLoader$(OBJ_EXT)
126 aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext)))
127 AOUT_DYNALOADER_OBJ = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(DYNALOADER_OBJ)))
129 $(AOUT_DYNALOADER_OBJ) : $(DYNALOADER_OBJ)
132 $(DYNALOADER_OBJ) : $(DYNALOADER)
135 $(AOUT_LIBPERL) : $(aout_obj) perl$(AOUT_OBJ_EXT)
137 $(AOUT_AR) rcu $@ perl$(AOUT_OBJ_EXT) $(aout_obj)
140 $(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c
142 perlmain(AOUT_OBJ_EXT): perlmain.c
143 $(AOUT_CCCMD_DLL) $(PLDLFLAGS) -c perlmain.c
145 aout_perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit)
146 sh writemain $(DYNALOADER) $(aout_static_lib) > tmp
147 sh mv-if-diff tmp aout_perlmain.c
149 miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) ext.libs
150 $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) `cat ext.libs` $(libs)
152 perl_: $& aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_LIBPERL) $(AOUT_DYNALOADER) $(aout_static_ext) ext.libs
153 $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o perl_ aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER) $(aout_static_ext) $(AOUT_LIBPERL) `cat ext.libs` $(libs)
155 perl : perl__ perl___
157 perl__: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
158 $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs) -Zlinker /PM:PM
160 # Forking dynamically loaded perl:
162 perl: $& perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER_OBJ) $(aout_static_ext_dll) $(AOUT_LIBPERL_DLL) ext.libs
163 $(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)
168 -rm *perl_.* *.o *.a lib/auto/*/*.a ext/*/Makefile.aout
170 aout_install: perl_ aout_install.perl
172 aout_install.perl: perl_ installperl
176 - cd t && (rm -f perl_$(EXE_EXT); $(LNS) ../perl_$(EXE_EXT) perl$(EXE_EXT)) && ./perl TEST </dev/tty
178 lib/auto/OS2/*/%.a : ext/OS2/%/Makefile.aout
179 cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..."
180 cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
182 lib/auto/*/%.a : ext/%/Makefile.aout
183 cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..."
184 cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
186 .PRECIOUS : ext/%/Makefile.aout ext/OS2/%/Makefile.aout
188 ext/OS2/%/Makefile.aout : miniperl_
189 cd $(dir $@) ; ../../../miniperl_ -I ../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl
191 ext/%/Makefile.aout : miniperl_
192 cd $(dir $@) ; ../../miniperl_ -I ../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl