Commit | Line | Data |
e95c8f0e |
1 | # This file is read by Makefile.SH to produce rules for $(perllib) (and |
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 | |
11 | AOUT_CCCMD = \$(CC) $aout_ccflags $optimize |
12 | AOUT_AR = $aout_ar |
13 | AOUT_OBJ_EXT = $aout_obj_ext |
14 | AOUT_LIB_EXT = $aout_lib_ext |
15 | aout_perllib = libperl$aout_lib_ext |
16 | AOUT_CLDFLAGS = $aout_ldflags |
17 | |
18 | !GROK!THIS! |
82835e01 |
19 | |
20 | $spitshell >>Makefile <<'!NO!SUBS!' |
21 | $(perllib): perl.imp perl.dll perl5.def |
22 | emximp -o $(perllib) perl.imp |
23 | |
24 | perl.imp: perl5.def |
25 | emximp -o perl.imp perl5.def |
26 | |
27 | perl.dll: $(obj) perl5.def perl$(OBJ_EXT) |
e95c8f0e |
28 | $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs) perl5.def |
82835e01 |
29 | |
30 | perl5.def: perl.linkexp |
31 | echo "LIBRARY 'Perl' INITINSTANCE TERMINSTANCE" > $@ |
32 | echo DESCRIPTION "'Perl interpreter, export autogenerated'" >>$@ |
33 | echo STACKSIZE 32768 >>$@ |
34 | echo CODE LOADONCALL >>$@ |
35 | echo DATA LOADONCALL NONSHARED MULTIPLE >>$@ |
36 | echo EXPORTS >>$@ |
37 | echo ' "ctermid"' >>$@ |
e95c8f0e |
38 | echo ' "get_sysinfo"' >>$@ |
81ab40be |
39 | echo ' "Perl_OS2_init"' >>$@ |
40 | echo ' "OS2_Perl_data"' >>$@ |
e95c8f0e |
41 | echo ' "dlopen"' >>$@ |
42 | echo ' "dlsym"' >>$@ |
43 | echo ' "dlerror"' >>$@ |
760ac839 |
44 | echo ' "perl_init_i18nl10n"' >>$@ |
82835e01 |
45 | !NO!SUBS! |
46 | |
47 | if [ ! -z "$myttyname" ] ; then |
48 | $spitshell >>Makefile <<'!NO!SUBS!' |
49 | echo ' "ttyname"' >>$@ |
50 | !NO!SUBS! |
51 | fi |
52 | |
53 | $spitshell >>Makefile <<'!NO!SUBS!' |
54 | cat perl.linkexp >>$@ |
55 | |
56 | # grep -v '"\(malloc\|realloc\|free\)"' perl.linkexp >>$@ |
57 | |
58 | |
59 | # We assume here that perl is available somewhere ... |
60 | |
61 | perl.exports: perl.exp EXTERN.h perl.h |
62 | (echo '#include "EXTERN.h"'; echo '#include "perl.h"' ; \ |
63 | echo '#include "perl.exp"') | \ |
64 | $(CC) -DEMBED -E - | \ |
65 | awk '{if ($$2 == "") print $$1}' | sort | uniq > $@ |
66 | |
67 | # perl -ne 'print if (/^#!/ .. /^#\s/) && s/^(\w+) *$$/$$1/' > $@ |
68 | |
69 | perl.linkexp: perl.exports perl.map |
70 | cat perl.exports perl.map | sort | uniq -d | sed -e 's/\w\+/ "\0"/' > perl.linkexp |
71 | |
72 | perl.map: $(obj) perl$(OBJ_EXT) miniperlmain$(OBJ_EXT) |
e95c8f0e |
73 | $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o dummy.exe miniperlmain$(OBJ_EXT) perl$(OBJ_EXT) $(obj) $(libs) -Zmap -Zlinker /map |
82835e01 |
74 | awk '{if ($$3 == "") print $$2}' <dummy.map | sort | uniq > perl.map |
75 | rm dummy.exe dummy.map |
76 | |
e95c8f0e |
77 | depend: os2ish.h dlfcn.h |
82835e01 |
78 | |
79 | # Stupid make? Needed... |
80 | os2$(OBJ_EXT) : os2.c |
81 | |
82 | os2.c: os2/os2.c os2ish.h |
83 | cp $< $@ |
84 | |
e95c8f0e |
85 | dl_os2.c: os2/dl_os2.c os2ish.h |
86 | cp $< $@ |
87 | |
82835e01 |
88 | os2ish.h: os2/os2ish.h |
89 | cp $< $@ |
90 | |
e95c8f0e |
91 | dlfcn.h: os2/dlfcn.h |
92 | cp $< $@ |
93 | |
94 | |
82835e01 |
95 | installcmd : |
96 | perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR) |
97 | perl os2/perl2cmd.pl $(INSTALLCMDDIR) |
98 | |
e95c8f0e |
99 | # Aout section: |
100 | |
101 | aout_obj = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(obj))) |
102 | AOUT_DYNALOADER = $(addsuffix $(AOUT_LIB_EXT),$(basename $(DYNALOADER))) |
103 | aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(dynamic_ext))) |
104 | aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(dynamic_ext))) |
105 | |
106 | $(aout_perllib) : $(aout_obj) perl$(AOUT_OBJ_EXT) |
107 | rm -f $(perllib) |
108 | $(AOUT_AR) rcu $(aout_perllib) perl$(AOUT_OBJ_EXT) $(aout_obj) |
109 | |
110 | .c$(AOUT_OBJ_EXT): |
111 | $(AOUT_CCCMD) $(PLDLFLAGS) -c $*.c |
112 | |
113 | aout_perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit) |
114 | sh writemain $(DYNALOADER) $(aout_static_lib) > tmp |
115 | sh mv-if-diff tmp aout_perlmain.c |
116 | |
117 | miniperl_: $& miniperlmain$(AOUT_OBJ_EXT) $(aout_perllib) ext.libs |
118 | $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o miniperl_ miniperlmain$(AOUT_OBJ_EXT) $(aout_perllib) `cat ext.libs` $(libs) |
119 | |
120 | perl_: $& aout_perlmain$(AOUT_OBJ_EXT) $(aout_perllib) $(AOUT_DYNALOADER) $(aout_static_ext) ext.libs |
121 | $(CC) $(LARGE) $(AOUT_CLDFLAGS) $(CCDLFLAGS) -o perl_ aout_perlmain$(AOUT_OBJ_EXT) $(AOUT_DYNALOADER) $(aout_static_ext) $(aout_perllib) `cat ext.libs` $(libs) |
122 | |
760ac839 |
123 | perl : perl__ |
124 | |
125 | perl__: $& perlmain$(OBJ_EXT) $(perllib) $(DYNALOADER) $(static_ext) ext.libs |
126 | $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl__ perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(perllib) `cat ext.libs` $(libs) -Zlinker /PM:PM |
127 | |
e95c8f0e |
128 | aout_clean: |
129 | -rm *perl_.* *.o *.a lib/auto/*/*.a ext/*/Makefile.aout |
130 | |
131 | aout_install: perl_ aout_install.perl |
132 | |
133 | aout_install.perl: perl_ installperl |
134 | ./perl_ installperl |
135 | |
136 | aout_test: perl_ |
760ac839 |
137 | - cd t && (rm -f perl_$(EXE_EXT); $(LNS) ../perl_$(EXE_EXT) perl$(EXE_EXT)) && ./perl TEST </dev/tty |
138 | |
139 | lib/auto/OS2/*/%.a : ext/OS2/%/Makefile.aout |
140 | cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..." |
141 | cd ext/OS2/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS= |
e95c8f0e |
142 | |
143 | lib/auto/*/%.a : ext/%/Makefile.aout |
144 | cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout config || echo "$make config failed, continuing anyway..." |
145 | cd ext/$(basename $(notdir $@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS= |
146 | |
760ac839 |
147 | .PRECIOUS : ext/%/Makefile.aout ext/OS2/%/Makefile.aout |
148 | |
149 | ext/OS2/%/Makefile.aout : miniperl_ |
150 | cd $(dir $@) ; ../../../miniperl_ -I ../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl |
151 | |
e95c8f0e |
152 | ext/%/Makefile.aout : miniperl_ |
760ac839 |
153 | cd $(dir $@) ; ../../miniperl_ -I ../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl |
e95c8f0e |
154 | |
82835e01 |
155 | !NO!SUBS! |