Commit | Line | Data |
f6d6199c |
1 | package ExtUtils::MM_Win95; |
2 | |
3 | use vars qw($VERSION @ISA); |
dedf98bc |
4 | $VERSION = 0.03; |
f6d6199c |
5 | |
6 | require ExtUtils::MM_Win32; |
7 | @ISA = qw(ExtUtils::MM_Win32); |
479d2113 |
8 | |
a7d1454b |
9 | use Config;\r |
479d2113 |
10 | my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i; |
11 | my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i; |
12 | |
f6d6199c |
13 | |
f582e489 |
14 | =head1 NAME |
15 | |
16 | ExtUtils::MM_Win95 - method to customize MakeMaker for Win9X |
17 | |
18 | =head1 SYNOPSIS |
19 | |
20 | You should not be using this module directly. |
21 | |
22 | =head1 DESCRIPTION |
23 | |
24 | This is a subclass of ExtUtils::MM_Win32 containing changes necessary |
25 | to get MakeMaker playing nice with command.com and other Win9Xisms. |
26 | |
479d2113 |
27 | =head2 Overriden methods |
28 | |
29 | Most of these make up for limitations in the Win9x command shell. |
30 | Namely the lack of && and that a chdir is global, so you have to chdir |
31 | back at the end. |
32 | |
33 | =over 4 |
34 | |
35 | =item dist_test |
36 | |
37 | && and chdir problem. |
38 | |
f582e489 |
39 | =cut |
f6d6199c |
40 | |
e0678a30 |
41 | sub dist_test { |
42 | my($self) = shift; |
43 | return q{ |
44 | disttest : distdir |
415c4738 |
45 | cd $(DISTVNAME) |
46 | $(ABSPERLRUN) Makefile.PL |
47 | $(MAKE) $(PASTHRU) |
48 | $(MAKE) test $(PASTHRU) |
49 | cd .. |
e0678a30 |
50 | }; |
51 | } |
52 | |
479d2113 |
53 | =item subdir_x |
54 | |
55 | && and chdir problem. |
56 | |
57 | Also, dmake has an odd way of making a command series silent. |
58 | |
59 | =cut |
60 | |
61 | sub subdir_x { |
62 | my($self, $subdir) = @_; |
63 | |
64 | # Win-9x has nasty problem in command.com that can't cope with |
65 | # &&. Also, Dmake has an odd way of making a commandseries silent: |
66 | if ($DMAKE) { |
67 | return sprintf <<'EOT', $subdir; |
68 | |
69 | subdirs :: |
70 | @[ |
71 | cd %s |
72 | $(MAKE) all $(PASTHRU) |
73 | cd .. |
74 | ] |
75 | EOT |
76 | } |
77 | else { |
78 | return sprintf <<'EOT', $subdir; |
79 | |
80 | subdirs :: |
81 | $(NOECHO)cd %s |
82 | $(NOECHO)$(MAKE) all $(PASTHRU) |
83 | $(NOECHO)cd .. |
84 | EOT |
85 | } |
86 | } |
87 | |
88 | =item xs_c |
89 | |
90 | The && problem. |
91 | |
92 | =cut |
93 | |
f6d6199c |
94 | sub xs_c { |
95 | my($self) = shift; |
96 | return '' unless $self->needs_linking(); |
97 | ' |
98 | .xs.c: |
479d2113 |
99 | $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c |
f6d6199c |
100 | ' |
101 | } |
102 | |
479d2113 |
103 | |
104 | =item xs_cpp |
105 | |
106 | The && problem |
107 | |
108 | =cut |
109 | |
f6d6199c |
110 | sub xs_cpp { |
111 | my($self) = shift; |
112 | return '' unless $self->needs_linking(); |
113 | ' |
114 | .xs.cpp: |
479d2113 |
115 | $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp |
f6d6199c |
116 | '; |
117 | } |
118 | |
479d2113 |
119 | =item xs_o |
120 | |
121 | The && problem. |
122 | |
123 | =cut |
124 | |
f6d6199c |
125 | sub xs_o { |
126 | my($self) = shift; |
127 | return '' unless $self->needs_linking(); |
128 | ' |
129 | .xs$(OBJ_EXT): |
479d2113 |
130 | $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c |
f6d6199c |
131 | $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c |
132 | '; |
133 | } |
4da32025 |
134 | |
479d2113 |
135 | =item clean_subdirs_target |
136 | |
137 | && and chdir problem. |
138 | |
139 | =cut |
140 | |
141 | sub clean_subdirs_target { |
142 | my($self) = shift; |
143 | |
144 | # No subdirectories, no cleaning. |
145 | return <<'NOOP_FRAG' unless @{$self->{DIR}}; |
146 | clean_subdirs : |
147 | $(NOECHO)$(NOOP) |
148 | NOOP_FRAG |
149 | |
150 | |
151 | my $clean = "clean_subdirs :\n"; |
152 | |
153 | for my $dir (@{$self->{DIR}}) { |
154 | $clean .= sprintf <<'MAKE_FRAG', $dir; |
155 | cd %s |
156 | $(TEST_F) $(FIRST_MAKEFILE) |
157 | $(MAKE) clean |
158 | cd .. |
159 | MAKE_FRAG |
160 | } |
161 | |
162 | return $clean; |
163 | } |
164 | |
165 | |
166 | =item realclean_subdirs_target |
167 | |
168 | && and chdir problem. |
169 | |
170 | =cut |
171 | |
172 | sub realclean_subdirs_target { |
173 | my $self = shift; |
174 | |
175 | return <<'NOOP_FRAG' unless @{$self->{DIR}}; |
176 | realclean_subdirs : |
177 | $(NOECHO)$(NOOP) |
178 | NOOP_FRAG |
179 | |
180 | my $rclean = "realclean_subdirs :\n"; |
181 | |
182 | foreach my $dir (@{$self->{DIR}}){ |
183 | $rclean .= sprintf <<'RCLEAN', $dir; |
184 | -cd %s |
185 | -$(PERLRUN) -e "exit unless -f shift; system q{$(MAKE) realclean}" $(FIRST_MAKEFILE) |
186 | -cd .. |
187 | RCLEAN |
188 | |
189 | } |
190 | |
191 | return $rclean; |
192 | } |
193 | |
194 | |
dedf98bc |
195 | =item os_flavor |
196 | |
197 | Win95 and Win98 and WinME are collectively Win9x and Win32 |
198 | |
199 | =cut |
200 | |
201 | sub os_flavor { |
202 | my $self = shift; |
203 | return ($self->SUPER::os_flavor, 'Win9x'); |
204 | } |
205 | |
206 | |
479d2113 |
207 | =back |
208 | |
209 | |
210 | =head1 AUTHOR |
211 | |
a7d1454b |
212 | Code originally inside MM_Win32. Original author unknown. |
479d2113 |
213 | |
a7d1454b |
214 | Currently maintained by Michael G Schwern C<schwern@pobox.com>. |
479d2113 |
215 | |
a7d1454b |
216 | Send patches and ideas to C<makemaker@perl.org>. |
479d2113 |
217 | |
218 | See http://www.makemaker.org. |
219 | |
220 | =cut |
221 | |
222 | |
4da32025 |
223 | 1; |