30ebf962e08ac77fc0e08bbe2b1925a767af0482
[samba.git] / source4 / build / smb_build / makefile.pm
1 # Samba Build System
2 # - create output for Makefile
3 #
4 #  Copyright (C) Stefan (metze) Metzmacher 2004
5 #  Copyright (C) Jelmer Vernooij 2005
6 #  Released under the GNU GPL
7
8 package smb_build::makefile;
9 use smb_build::env;
10 use strict;
11
12 use base 'smb_build::env';
13 use Cwd 'abs_path';
14
15 sub new($$$)
16 {
17         my ($myname, $config, $mkfile) = @_;
18         my $self = new smb_build::env($config);
19         
20         bless($self, $myname);
21
22         $self->{manpages} = [];
23         $self->{sbin_progs} = [];
24         $self->{bin_progs} = [];
25         $self->{torture_progs} = [];
26         $self->{static_libs} = [];
27         $self->{shared_libs} = [];
28         $self->{installable_shared_libs} = [];
29         $self->{headers} = [];
30         $self->{shared_modules} = [];
31         $self->{plugins} = [];
32         $self->{install_plugins} = "";
33         $self->{uninstall_plugins} = "";
34         $self->{pc_files} = [];
35         $self->{proto_headers} = [];
36         $self->{output} = "";
37
38         $self->{mkfile} = $mkfile;
39
40         $self->output("#!gmake\n");
41         $self->output("################################################\n");
42         $self->output("# Autogenerated by build/smb_build/makefile.pm #\n");
43         $self->output("################################################\n");
44         $self->output("\n");
45
46         $self->output("default: all\n\n");
47
48         $self->_prepare_path_vars();
49         $self->_prepare_compiler_linker();
50
51         if (!$self->{automatic_deps}) {
52                 $self->output("ALL_PREDEP = proto\n");
53                 $self->output(".NOTPARALLEL:\n");
54         }
55
56         return $self;
57 }
58
59 sub output($$)
60 {
61         my ($self, $text) = @_;
62
63         $self->{output} .= $text;
64 }
65
66 sub _prepare_path_vars($)
67 {
68         my ($self) = @_;
69
70         $self->output(<< "__EOD__"
71 prefix = $self->{config}->{prefix}
72 exec_prefix = $self->{config}->{exec_prefix}
73 selftest_prefix = $self->{config}->{selftest_prefix}
74 VPATH = $self->{config}->{srcdir}:heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
75 srcdir = $self->{config}->{srcdir}
76 builddir = $self->{config}->{builddir}
77 datarootdir = $self->{config}->{datarootdir}
78
79 BASEDIR = $self->{config}->{prefix}
80 BINDIR = $self->{config}->{bindir}
81 SBINDIR = $self->{config}->{sbindir}
82 LIBDIR = $self->{config}->{libdir}
83 TORTUREDIR = $self->{config}->{libdir}/torture
84 MODULESDIR = $self->{config}->{modulesdir}
85 INCLUDEDIR = $self->{config}->{includedir}
86 CONFIGDIR = $self->{config}->{sysconfdir}
87 DATADIR = $self->{config}->{datadir}
88 SWATDIR = $self->{config}->{datadir}/swat
89 SERVICESDIR = $self->{config}->{datadir}/services
90 JSDIR = $self->{config}->{datadir}/js
91 SETUPDIR = $self->{config}->{datadir}/setup
92 VARDIR = $self->{config}->{localstatedir}
93 LOGFILEBASE = $self->{config}->{logfilebase}
94 NCALRPCDIR = $self->{config}->{localstatedir}/ncalrpc
95 LOCKDIR = $self->{config}->{lockdir}
96 PIDDIR = $self->{config}->{piddir}
97 MANDIR = $self->{config}->{mandir}
98 PRIVATEDIR = $self->{config}->{privatedir}
99 WINBINDD_SOCKET_DIR = $self->{config}->{winbindd_socket_dir}
100
101 __EOD__
102 );
103 }
104
105 sub _prepare_compiler_linker($)
106 {
107         my ($self) = @_;
108
109         my $devld_install = "";
110         my $builddir_headers = "";
111
112         if ($self->{config}->{LIBRARY_OUTPUT_TYPE} eq "SHARED_LIBRARY") {
113                 $devld_install = " -Wl,-rpath-link,\$(builddir)/bin";
114         }
115         
116         if (!(abs_path($self->{config}->{srcdir}) eq abs_path($self->{config}->{builddir}))) {
117             $builddir_headers= "-I\$(builddir)/include -I\$(builddir) -I\$(builddir)/lib ";
118         }
119
120         $self->output(<< "__EOD__"
121 SHELL=$self->{config}->{SHELL}
122
123 PERL=$self->{config}->{PERL}
124
125 CPP=$self->{config}->{CPP}
126 CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
127
128 CC=$self->{config}->{CC}
129 CFLAGS=$self->{config}->{CFLAGS} \$(CPPFLAGS)
130 PICFLAG=$self->{config}->{PICFLAG}
131 HOSTCC=$self->{config}->{HOSTCC}
132
133 INSTALL_LINK_FLAGS=$devld_install
134
135 LD=$self->{config}->{LD} 
136 LDFLAGS=$self->{config}->{LDFLAGS} -L\$(builddir)/bin
137
138 STLD=$self->{config}->{STLD}
139 STLD_FLAGS=$self->{config}->{STLD_FLAGS}
140
141 SHLD=$self->{config}->{SHLD}
142 SHLD_FLAGS=$self->{config}->{SHLD_FLAGS} -L\$(builddir)/bin
143 SHLIBEXT=$self->{config}->{SHLIBEXT}
144
145 XSLTPROC=$self->{config}->{XSLTPROC}
146
147 LEX=$self->{config}->{LEX}
148 YACC=$self->{config}->{YACC}
149 YAPP=$self->{config}->{YAPP}
150 PIDL_ARGS=$self->{config}->{PIDL_ARGS}
151
152 GCOV=$self->{config}->{GCOV}
153
154 DEFAULT_TEST_TARGET=$self->{config}->{DEFAULT_TEST_TARGET}
155
156 __EOD__
157 );
158 }
159
160 sub _prepare_mk_files($)
161 {
162         my $self = shift;
163         my @tmp = ();
164
165         foreach (@smb_build::config_mk::parsed_files) {
166                 s/ .*$//g;
167                 push (@tmp, $_);
168         }
169
170         $self->output("MK_FILES = " . array2oneperline(\@tmp) . "\n");
171 }
172
173 sub array2oneperline($)
174 {
175         my $array = shift;
176         my $output = "";
177
178         foreach (@$array) {
179                 next unless defined($_);
180
181                 $output .= " \\\n\t\t$_";
182         }
183
184         return $output;
185 }
186
187 sub _prepare_list($$$)
188 {
189         my ($self,$ctx,$var) = @_;
190
191         my $tmplist = array2oneperline($ctx->{$var});
192         return if ($tmplist eq "");
193
194         $self->output("$ctx->{TYPE}\_$ctx->{NAME}_$var =$tmplist\n");
195 }
196
197 sub Integrated($$)
198 {
199         my ($self,$ctx) = @_;
200
201         $self->_prepare_list($ctx, "OBJ_LIST");
202         $self->_prepare_list($ctx, "FULL_OBJ_LIST");
203         $self->_prepare_list($ctx, "LINK_FLAGS");
204 }
205
206 sub SharedLibrary($$)
207 {
208         my ($self,$ctx) = @_;
209
210         my $installdir;
211         my $init_obj = "";
212         
213         $installdir = $ctx->{DEBUGDIR};
214
215         if ($ctx->{TYPE} eq "LIBRARY") {
216                 push (@{$self->{shared_libs}}, "$ctx->{DEBUGDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION}));
217                 push (@{$self->{installable_shared_libs}}, "$installdir/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION}));
218         } elsif ($ctx->{TYPE} eq "MODULE") {
219                 push (@{$self->{shared_modules}}, "$ctx->{TARGET}");
220                 push (@{$self->{plugins}}, "$installdir/$ctx->{LIBRARY_REALNAME}");
221
222                 $self->{install_plugins} .= "\t\@echo Installing $installdir/$ctx->{LIBRARY_REALNAME} as \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
223                 $self->{install_plugins} .= "\t\@mkdir -p \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/\n";
224                 $self->{install_plugins} .= "\t\@cp $installdir/$ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
225                 $self->{uninstall_plugins} .= "\t\@echo Uninstalling \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
226                 $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
227                 if (defined($ctx->{ALIASES})) {
228                         foreach (@{$ctx->{ALIASES}}) {
229                                 $self->{install_plugins} .= "\t\@ln -fs $ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$_.\$(SHLIBEXT)\n";
230                                 $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$_.\$(SHLIBEXT)\n";
231                         }
232                 }
233         }
234
235         $self->output("$ctx->{TYPE}_$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n");
236         $self->_prepare_list($ctx, "OBJ_LIST");
237         $self->_prepare_list($ctx, "FULL_OBJ_LIST");
238         $self->_prepare_list($ctx, "DEPEND_LIST");
239         $self->_prepare_list($ctx, "LINK_FLAGS");
240
241         push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
242
243         if ($ctx->{TYPE} eq "MODULE" and defined($ctx->{INIT_FUNCTION})) {
244                 my $init_fn = $ctx->{INIT_FUNCTION_TYPE};
245                 $init_fn =~ s/\(\*\)/init_module/;
246                 my $proto_fn = $ctx->{INIT_FUNCTION_TYPE};
247                 $proto_fn =~ s/\(\*\)/$ctx->{INIT_FUNCTION}/;
248
249                 $self->output(<< "__EOD__"
250 bin/$ctx->{NAME}_init_module.c:
251         \@echo Creating \$\@
252         \@echo \"#include \\\"includes.h\\\"\" > \$\@
253         \@echo \"$proto_fn;\" >> \$\@
254         \@echo -e \"_PUBLIC_ $init_fn \\n{\\n\\treturn $ctx->{INIT_FUNCTION}();\\n}\\n\" >> \$\@
255 __EOD__
256 );
257                 $init_obj = "bin/$ctx->{NAME}_init_module.o";
258         }
259
260         my $soarg = "";
261         my $soargdebug = "";
262         if ($self->{config}->{SONAMEFLAG} ne "" and 
263                 defined($ctx->{LIBRARY_SONAME})) {
264                 $soarg = "$self->{config}->{SONAMEFLAG}$ctx->{LIBRARY_SONAME} ";
265                 if ($ctx->{LIBRARY_REALNAME} ne $ctx->{LIBRARY_SONAME}) {
266                         $soargdebug = "\n\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{DEBUGDIR}/$ctx->{LIBRARY_SONAME}";
267                 }
268         }
269
270         my $singlesoarg = "";
271         
272         if ($ctx->{DEBUGDIR} ne $installdir) {
273                 $self->output(<< "__EOD__"
274 #
275
276 $ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST) $init_obj
277         \@echo Linking \$\@
278         \@mkdir -p $ctx->{DEBUGDIR}
279         \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\
280                 \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $soarg \\
281                 $init_obj $soargdebug
282 __EOD__
283 );
284                 if (defined($ctx->{ALIASES})) {
285                         foreach (@{$ctx->{ALIASES}}) {
286                                 $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{DEBUGDIR}/$_.\$(SHLIBEXT)\n");
287                         }
288                 }
289
290                 $self->output("\n");
291         } else {
292                 if ($self->{config}->{SONAMEFLAG} ne "" and 
293                         defined($ctx->{LIBRARY_SONAME}) and 
294                         $ctx->{LIBRARY_REALNAME} ne $ctx->{LIBRARY_SONAME}) {
295                         $singlesoarg = "\n\t\@ln -fs $ctx->{LIBRARY_REALNAME} $installdir/$ctx->{LIBRARY_SONAME}";
296                 }
297
298         }
299
300         $self->output(<< "__EOD__"
301 #
302
303 $installdir/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST) $init_obj
304         \@echo Linking \$\@
305         \@mkdir -p $installdir
306         \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
307                 \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) $soarg \\
308                 $init_obj $singlesoarg
309
310 __EOD__
311 );
312 }
313
314 sub StaticLibrary($$)
315 {
316         my ($self,$ctx) = @_;
317
318         return unless (defined($ctx->{OBJ_FILES}));
319
320         push (@{$self->{static_libs}}, $ctx->{TARGET}) if ($ctx->{TYPE} eq "LIBRARY");
321
322         $self->output("$ctx->{TYPE}_$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n");
323         $self->_prepare_list($ctx, "OBJ_LIST");
324         $self->_prepare_list($ctx, "FULL_OBJ_LIST");
325
326         $self->_prepare_list($ctx, "LINK_FLAGS");
327
328         push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
329                 
330         $self->output(<< "__EOD__"
331 #
332 $ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)
333         \@echo Linking \$@
334         \@rm -f \$@
335         \@\$(STLD) \$(STLD_FLAGS) \$@ \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)
336
337 __EOD__
338 );
339 }
340
341 sub Header($$)
342 {
343         my ($self,$ctx) = @_;
344
345         my $dir = $ctx->{BASEDIR};
346
347         $dir =~ s/^\.\///g;
348
349         foreach (@{$ctx->{PUBLIC_HEADERS}}) {
350                 push (@{$self->{headers}}, "$dir/$_");
351         }
352 }
353
354 sub Binary($$)
355 {
356         my ($self,$ctx) = @_;
357
358         my $installdir;
359         my $extradir = "";
360
361         if (defined($ctx->{INSTALLDIR}) && $ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
362                 $extradir = "/torture" . substr($ctx->{INSTALLDIR}, length("TORTUREDIR"));
363         }
364         my $localdir = "bin$extradir";
365
366         my $dynconfig = "dynconfig.o";
367         my $dynconfig_install = "dynconfig.o";
368         
369         $installdir = "bin$extradir";
370
371         push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
372                 
373         unless (defined($ctx->{INSTALLDIR})) {
374         } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") {
375                 push (@{$self->{sbin_progs}}, "$installdir/$ctx->{BINARY}");
376         } elsif ($ctx->{INSTALLDIR} eq "BINDIR") {
377                 push (@{$self->{bin_progs}}, "$installdir/$ctx->{BINARY}");
378         } elsif ($ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
379                 push (@{$self->{torture_progs}}, "$installdir/$ctx->{BINARY}");
380         }
381
382
383         push (@{$self->{binaries}}, "$localdir/$ctx->{BINARY}");
384
385         $self->_prepare_list($ctx, "OBJ_LIST");
386         $self->_prepare_list($ctx, "FULL_OBJ_LIST");
387         $self->_prepare_list($ctx, "DEPEND_LIST");
388         $self->_prepare_list($ctx, "LINK_FLAGS");
389
390 $self->output(<< "__EOD__"
391 $installdir/$ctx->{BINARY}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST) $dynconfig_install
392         \@echo Linking \$\@
393         \@\$(LD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
394                 $dynconfig_install \$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) 
395
396 __EOD__
397 );
398 }
399
400 sub Manpage($$)
401 {
402         my ($self,$ctx) = @_;
403
404         my $dir = $ctx->{BASEDIR};
405         
406         $dir =~ s/^\.\///g;
407
408         push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
409 }
410
411 sub PkgConfig($$)
412 {
413         my ($self,$ctx) = @_;
414         
415         my $link_name = $ctx->{NAME};
416
417         $link_name =~ s/^LIB//g;
418         $link_name = lc($link_name);
419
420         return if (not defined($ctx->{DESCRIPTION}));
421
422         my $path = "$ctx->{BASEDIR}/$link_name.pc";
423
424         push (@{$self->{pc_files}}, $path);
425
426         my $pubs;
427         my $privs;
428
429         if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
430                 foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
431 #                       next unless ($self-> ) {
432
433 #FIXME                  $pubs .= "$_ ";
434                 }
435         }
436
437         if (defined($ctx->{PRIVATE_DEPENDENCIES})) {
438                 foreach (@{$ctx->{PRIVATE_DEPENDENCIES}}) {
439 #                       next unless ($self-> ) {
440
441 #FIXME                  $privs .= "$_ ";
442                 }
443         }
444
445         smb_build::env::PkgConfig($self,
446                 $path,
447                 $link_name,
448                 "-l$link_name",
449                 "",
450                 "$ctx->{VERSION}",
451                 $ctx->{DESCRIPTION},
452                 defined($ctx->{INIT_FUNCTIONS}),
453                 $pubs,
454                 $privs
455         ); 
456 }
457
458 sub ProtoHeader($$)
459 {
460         my ($self,$ctx) = @_;
461
462         my $dir = $ctx->{BASEDIR};
463
464         $dir =~ s/^\.\///g;
465
466         my $target = "";
467
468         my $comment = "Creating ";
469         if (defined($ctx->{PRIVATE_PROTO_HEADER})) {
470                 $target.= "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
471                 $comment.= "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
472                 if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
473                         $comment .= " and ";
474                         $target.= " ";
475                 }
476                 push (@{$self->{proto_headers}}, "$dir/$ctx->{PRIVATE_PROTO_HEADER}");
477         } else {
478                 $ctx->{PRIVATE_PROTO_HEADER} = $ctx->{PUBLIC_PROTO_HEADER};
479         }
480         
481         if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
482                 $comment.= "$dir/$ctx->{PUBLIC_PROTO_HEADER}";
483                 $target .= "$dir/$ctx->{PUBLIC_PROTO_HEADER}";
484                 push (@{$self->{proto_headers}}, "$dir/$ctx->{PUBLIC_PROTO_HEADER}");
485         } else {
486                 $ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER};
487         }       
488
489         $self->output("$dir/$ctx->{PUBLIC_PROTO_HEADER}: $ctx->{MK_FILE} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n");
490         $self->output("\t\@echo \"$comment\"\n");
491
492         $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --private=$dir/$ctx->{PRIVATE_PROTO_HEADER} --public=$dir/$ctx->{PUBLIC_PROTO_HEADER} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n\n");
493 }
494
495 sub write($$)
496 {
497         my ($self,$file) = @_;
498
499         $self->output("MANPAGES = ".array2oneperline($self->{manpages})."\n");
500         $self->output("BIN_PROGS = " . array2oneperline($self->{bin_progs}) . "\n");
501         $self->output("SBIN_PROGS = " . array2oneperline($self->{sbin_progs}) . "\n");
502         $self->output("TORTURE_PROGS = " . array2oneperline($self->{torture_progs}) . "\n");
503         $self->output("BINARIES = " . array2oneperline($self->{binaries}) . "\n");
504         $self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n");
505         $self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
506         $self->output("INSTALLABLE_SHARED_LIBS = " . array2oneperline($self->{installable_shared_libs}) . "\n");
507         $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
508         $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
509         $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n");
510         $self->output("PROTO_HEADERS = " . array2oneperline($self->{proto_headers}) .  "\n");
511         $self->output("SHARED_MODULES = " . array2oneperline($self->{shared_modules}) . "\n");
512         $self->output("PLUGINS = " . array2oneperline($self->{plugins}) . "\n");
513
514         $self->output("\ninstallplugins: \$(PLUGINS)\n".$self->{install_plugins}."\n");
515         $self->output("\nuninstallplugins:\n".$self->{uninstall_plugins}."\n");
516
517         $self->_prepare_mk_files();
518
519         $self->output($self->{mkfile});
520
521         if ($self->{automatic_deps}) {
522                 $self->output("
523 ifneq (\$(MAKECMDGOALS),clean)
524 ifneq (\$(MAKECMDGOALS),distclean)
525 ifneq (\$(MAKECMDGOALS),realdistclean)
526 -include \$(DEP_FILES)
527 endif
528 endif
529 endif
530 ");
531         } else {
532                 $self->output("include \$(srcdir)/static_deps.mk\n");
533         }
534
535         open(MAKEFILE,">$file") || die ("Can't open $file\n");
536         print MAKEFILE $self->{output};
537         close(MAKEFILE);
538
539         print __FILE__.": creating $file\n";
540 }
541
542 1;