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 | |
9 | $spitshell >>Makefile <<!GROK!THIS! |
10 | |
dd96f567 |
11 | AOUT_OPTIMIZE = $optimize |
12 | AOUT_CCCMD = \$(CC) $aout_ccflags \$(AOUT_OPTIMIZE) |
e95c8f0e |
13 | AOUT_AR = $aout_ar |
14 | AOUT_OBJ_EXT = $aout_obj_ext |
15 | AOUT_LIB_EXT = $aout_lib_ext |
f9c39ab5 |
16 | AOUT_LIBPERL = libperl$aout_lib_ext |
e95c8f0e |
17 | AOUT_CLDFLAGS = $aout_ldflags |
18 | |
dd3366de |
19 | AOUT_LIBPERL_DLL = libperl_dll$aout_lib_ext |
72ea3524 |
20 | AOUT_CCCMD_DLL = \$(CC) -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK |
dd3366de |
21 | AOUT_CLDFLAGS_DLL = -Zexe -Zmt -Zcrtdll |
22 | |
84902520 |
23 | LD_OPT = $optimize |
24 | |
e95c8f0e |
25 | !GROK!THIS! |
82835e01 |
26 | |
27 | $spitshell >>Makefile <<'!NO!SUBS!' |
f9c39ab5 |
28 | $(LIBPERL): perl.imp perl.dll perl5.def |
29 | emximp -o $(LIBPERL) perl.imp |
82835e01 |
30 | |
dd3366de |
31 | $(AOUT_LIBPERL_DLL): perl.imp perl.dll perl5.def |
32 | emximp -o $(AOUT_LIBPERL_DLL) perl.imp |
33 | |
82835e01 |
34 | perl.imp: perl5.def |
35 | emximp -o perl.imp perl5.def |
df3ef7a9 |
36 | echo 'emx_calloc emxlibcm 400 ?' >> $@ |
37 | echo 'emx_free emxlibcm 401 ?' >> $@ |
38 | echo 'emx_malloc emxlibcm 402 ?' >> $@ |
39 | echo 'emx_realloc emxlibcm 403 ?' >> $@ |
82835e01 |
40 | |
41 | perl.dll: $(obj) perl5.def perl$(OBJ_EXT) |
84902520 |
42 | $(LD) $(LD_OPT) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def |
82835e01 |
43 | |
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 >>$@ |
50 | echo EXPORTS >>$@ |
82835e01 |
51 | !NO!SUBS! |
52 | |
53 | if [ ! -z "$myttyname" ] ; then |
54 | $spitshell >>Makefile <<'!NO!SUBS!' |
55 | echo ' "ttyname"' >>$@ |
56 | !NO!SUBS! |
57 | fi |
58 | |
59 | $spitshell >>Makefile <<'!NO!SUBS!' |
60 | cat perl.linkexp >>$@ |
61 | |
62 | # grep -v '"\(malloc\|realloc\|free\)"' perl.linkexp >>$@ |
63 | |
64 | |
82835e01 |
65 | perl.exports: perl.exp EXTERN.h perl.h |
ff68c719 |
66 | (echo "#include \"EXTERN.h\" \n#include \"perl.h\" \n#include \"perl.exp\""; \ |
67 | echo "malloc\nrealloc\ncalloc\nfree") | \ |
82835e01 |
68 | $(CC) -DEMBED -E - | \ |
69 | awk '{if ($$2 == "") print $$1}' | sort | uniq > $@ |
70 | |
82835e01 |
71 | perl.linkexp: perl.exports perl.map |
dd96f567 |
72 | cat perl.exports os2/os2.sym perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp |
82835e01 |
73 | |
84902520 |
74 | # We link miniperl statically, since .DLL depends on $(DYNALOADER) |
75 | |
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 |
79 | rm miniperl.map |
80 | @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest |
82835e01 |
81 | |
dd96f567 |
82 | depend: os2ish.h dlfcn.h os2thread.h os2.c |
82835e01 |
83 | |
84 | # Stupid make? Needed... |
85 | os2$(OBJ_EXT) : os2.c |
86 | |
87 | os2.c: os2/os2.c os2ish.h |
88 | cp $< $@ |
89 | |
e95c8f0e |
90 | dl_os2.c: os2/dl_os2.c os2ish.h |
91 | cp $< $@ |
92 | |
82835e01 |
93 | os2ish.h: os2/os2ish.h |
94 | cp $< $@ |
95 | |
dd96f567 |
96 | os2thread.h: os2/os2thread.h |
97 | cp $< $@ |
98 | |
e95c8f0e |
99 | dlfcn.h: os2/dlfcn.h |
100 | cp $< $@ |
101 | |
dd3366de |
102 | # This one is compiled OMF, so cannot fork(): |
103 | |
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) |
e95c8f0e |
106 | |
82835e01 |
107 | installcmd : |
108 | perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR) |
109 | perl os2/perl2cmd.pl $(INSTALLCMDDIR) |
110 | |
e95c8f0e |
111 | # Aout section: |
112 | |
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))) |
117 | |
dd3366de |
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))) |
122 | |
123 | $(AOUT_DYNALOADER_OBJ) : $(DYNALOADER_OBJ) |
124 | emxaout -o $@ $< |
125 | |
126 | $(DYNALOADER_OBJ) : $(DYNALOADER) |
127 | @sh -c true |
128 | |
f9c39ab5 |
129 | $(AOUT_LIBPERL) : $(aout_obj) perl$(AOUT_OBJ_EXT) |
dd3366de |
130 | rm -f $@ |
131 | $(AOUT_AR) rcu $@ perl$(AOUT_OBJ_EXT) $(aout_obj) |
e95c8f0e |
132 | |
133 | .c$(AOUT_OBJ_EXT): |
134 | $(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c |
135 | |
dd3366de |
136 | perlmain(AOUT_OBJ_EXT): perlmain.c |
137 | $(AOUT_CCCMD_DLL) $(PLDLFLAGS) -c perlmain.c |
138 | |
e95c8f0e |
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 |
142 | |
f9c39ab5 |
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) |
e95c8f0e |
145 | |
f9c39ab5 |
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) |
e95c8f0e |
148 | |
dd3366de |
149 | perl : perl__ perl___ |
760ac839 |
150 | |
f9c39ab5 |
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 |
760ac839 |
153 | |
dd3366de |
154 | # Forking dynamically loaded perl: |
155 | |
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) |
158 | |
159 | clean: aout_clean |
160 | |
e95c8f0e |
161 | aout_clean: |
162 | -rm *perl_.* *.o *.a lib/auto/*/*.a ext/*/Makefile.aout |
163 | |
164 | aout_install: perl_ aout_install.perl |
165 | |
166 | aout_install.perl: perl_ installperl |
167 | ./perl_ installperl |
168 | |
169 | aout_test: perl_ |
760ac839 |
170 | - cd t && (rm -f perl_$(EXE_EXT); $(LNS) ../perl_$(EXE_EXT) perl$(EXE_EXT)) && ./perl TEST </dev/tty |
171 | |
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= |
e95c8f0e |
175 | |
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= |
179 | |
760ac839 |
180 | .PRECIOUS : ext/%/Makefile.aout ext/OS2/%/Makefile.aout |
181 | |
182 | ext/OS2/%/Makefile.aout : miniperl_ |
183 | cd $(dir $@) ; ../../../miniperl_ -I ../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl |
184 | |
e95c8f0e |
185 | ext/%/Makefile.aout : miniperl_ |
760ac839 |
186 | cd $(dir $@) ; ../../miniperl_ -I ../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl |
e95c8f0e |
187 | |
82835e01 |
188 | !NO!SUBS! |