dplayx: Tests for GetCaps.
[wine/gsoc_dplay.git] / tools / make_makefiles
blob8f15011fa52e3927730c0fb855fe3fa8a33bd6f4
1 #!/usr/bin/perl -w
3 # Build the auto-generated parts of the Wine makefiles.
5 # Copyright 2006 Alexandre Julliard
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 # Make rules files
23 my %makerules =
25 "MAKE_RULES" => "Make.rules",
26 "MAKE_DLL_RULES" => "dlls/Makedll.rules",
27 "MAKE_IMPLIB_RULES" => "dlls/Makeimplib.rules",
28 "MAKE_TEST_RULES" => "dlls/Maketest.rules",
29 "MAKE_PROG_RULES" => "programs/Makeprog.rules",
32 # Programs that we want to install in the bin directory too
33 my %bin_install =
35 "msiexec" => 1,
36 "notepad" => 1,
37 "progman" => 1,
38 "regedit" => 1,
39 "regsvr32" => 1,
40 "uninstaller" => 1,
41 "wineboot" => 1,
42 "winebrowser" => 1,
43 "winecfg" => 1,
44 "wineconsole" => 1,
45 "winedbg" => 1,
46 "winefile" => 1,
47 "winemine" => 1,
48 "winepath" => 1,
51 # Programs that we don't want to install at all
52 my %dont_install =
54 "cmdlgtst" => 1,
55 "view" => 1,
56 "winetest" => 1,
59 # Special dlls that can be switched on or off by configure
60 my %special_dlls =
62 "glu32" => "GLU32FILES",
63 "opengl32" => "OPENGLFILES",
64 "winex11.drv" => "XFILES",
65 "winequartz.drv" => "QUARTZFILES"
68 # Default patterns for top-level .gitignore
69 my @ignores = (
70 "*.[oa]",
71 "*.ok",
72 "*.res",
73 "*.so",
74 "/autom4te.cache",
75 "/config.cache",
76 "/config.log",
77 "/config.status",
78 "/TAGS",
79 "/tags",
80 "Makefile",
81 "dlldata.c",
82 "dlls/*/*.def",
83 "dlls/*/tests/*crosstest.exe",
84 "dlls/*/tests/testlist.c",
85 "include/config.h",
86 "include/stamp-h"
89 # Source files and their resulting target to ignore
90 my @ignore_srcs = (
91 [ 'BISON_SRCS', '\.y', '.tab.c' ],
92 [ 'BISON_SRCS', '\.y', '.tab.h' ],
93 [ 'LEX_SRCS', '\.l', '.yy.c' ],
94 [ 'MC_SRCS', '\.mc', '.mc.rc' ],
95 [ 'IDL_TLB_SRCS', '\.idl', '.tlb' ],
96 [ 'IDL_H_SRCS', '\.idl', '.h' ],
97 [ 'IDL_C_SRCS', '\.idl', '.h' ],
98 [ 'IDL_I_SRCS', '\.idl', '.h' ],
99 [ 'IDL_P_SRCS', '\.idl', '.h' ],
100 [ 'IDL_S_SRCS', '\.idl', '.h' ],
101 [ 'IDL_C_SRCS', '\.idl', '_c.c' ],
102 [ 'IDL_I_SRCS', '\.idl', '_i.c' ],
103 [ 'IDL_P_SRCS', '\.idl', '_p.c' ],
104 [ 'IDL_S_SRCS', '\.idl', '_s.c' ],
107 my %exported_wine_headers = (
108 "wine/debug.h" => 1,
109 "wine/exception.h" => 1,
110 "wine/library.h" => 1,
111 "wine/unicode.h" => 1,
112 "wine/itss.idl" => 1,
113 "wine/svcctl.idl" => 1,
116 my %private_idl_headers = (
117 "axcore.idl" => 1,
118 "axextend.idl" => 1,
119 "dbinit.idl" => 1,
120 "dbprop.idl" => 1,
121 "dbs.idl" => 1,
122 "devenum.idl" => 1,
123 "dyngraph.idl" => 1,
124 "vmrender.idl" => 1,
127 my (@makefiles, %makefiles);
129 # update a file if changed
130 sub update_file($)
132 my $file = shift;
133 my $ret = !(-f $file) || system "cmp $file $file.new >/dev/null";
134 if (!$ret)
136 unlink "$file.new";
138 else
140 rename "$file.new", "$file";
141 print "$file updated\n";
142 if ($file eq "configure.ac")
144 system "autoconf";
145 print "configure updated\n";
148 return $ret;
151 # replace some lines in a file between two markers
152 sub replace_in_file($$$@)
154 my $file = shift;
155 my $start = shift;
156 my $end = shift;
158 open NEW_FILE, ">$file.new" or die "cannot create $file.new";
160 if (defined($start))
162 open OLD_FILE, "$file" or die "cannot open $file";
163 while (<OLD_FILE>)
165 last if /$start/;
166 print NEW_FILE $_;
170 print NEW_FILE @_;
172 if (defined($end))
174 my $skip=1;
175 while (<OLD_FILE>)
177 print NEW_FILE $_ unless $skip;
178 $skip = 0 if /$end/;
182 close OLD_FILE if defined($start);
183 close NEW_FILE;
184 return update_file($file);
187 # parse the specified makefile to identify the rules file
188 sub parse_makefile($)
190 my $file = shift;
191 my %make;
193 ($make{"=dir"} = $file) =~ s/[^\/]+$//;
195 open MAKE, "$file.in" or die "cannot open $file.in\n";
197 while (<MAKE>)
199 chomp;
200 while (/\\$/) { chop; $_ .= <MAKE>; chomp; } # merge continued lines
202 if (/^\@(MAKE.*RULES)\@/)
204 my $var = $1;
205 $make{"=rules"} = $makerules{$var};
206 next;
208 if (/^(MODULE|IMPORTLIB|TESTDLL)\s*=\s*(.*)/)
210 $make{$1} = $2;
211 next;
213 if (/^(BISON_SRCS|LEX_SRCS|IDL_[CHIPS]_SRCS|IDL_TLB_SRCS|IMPLIB_SRCS|MC_SRCS|RC_SRCS|RC_SRCS16|RC_BINARIES|SPEC_SRCS16|EXTRA_OBJS16|MANPAGES|PROGRAMS)\s*=\s*(.*)/)
215 my @list = split(/\s+/, $2);
216 $make{$1} = \@list;
217 next;
219 if (/^\#\s*MKDLL_SKIP/ || /^\#\s*MKPROG_SKIP/)
221 $make{"=skip"} = 1;
222 next;
225 return %make;
229 ################################################################
230 # update the makefile list in configure.ac
232 sub update_makerules(@)
237 ################################################################
238 # update the tests list in programs/winetest/Makefile.in and programs/winetest/winetest.rc
240 sub update_winetest(@)
242 my (@tests, @lines);
244 foreach my $file (@_)
246 if ($file =~ /^dlls\/(.*)\/tests\/Makefile/) { push @tests, $1; }
248 push @lines, "TESTBINS =";
249 push @lines, map { " \\\n\t" . $_ . "_test.exe"; } sort @tests;
250 push @lines, "\n\n";
252 foreach my $test (sort @tests)
254 push @lines, "${test}_test.exe: \$(DLLDIR)/$test/tests/${test}_test.exe\$(DLLEXT)\n";
255 push @lines, "\tcp \$(DLLDIR)/$test/tests/${test}_test.exe\$(DLLEXT) \$\@ && \$(STRIP) \$\@\n";
257 push @lines, "\n# Special rules\n";
259 replace_in_file( "programs/winetest/Makefile.in", '^TESTBINS\s*=', '^# Special rules', @lines );
261 replace_in_file( "programs/winetest/winetest.rc", ' TESTRES ', undef,
262 map { $_ . "_test.exe TESTRES \"" . $_ . "_test.exe\"\n"; } sort @tests );
264 # return a list of test exe files for .gitignore
265 return map { "programs/winetest/" . $_ . "_test.exe"; } sort @tests;
269 ################################################################
270 # update the makefile list in configure.ac and Makefile.in
272 sub update_makefiles(@)
274 my (@targets, @depends, @lines);
276 foreach my $var (sort { $makerules{$a} cmp $makerules{$b}; } keys %makerules)
278 push @lines, "$var=$makerules{$var}\n";
279 push @lines, "AC_SUBST_FILE($var)\n\n";
282 foreach my $var ((sort values %makerules), (sort @_))
284 push @lines, "AC_CONFIG_FILES([$var])\n";
287 push @lines, "\nAC_OUTPUT\n";
288 replace_in_file( "configure.ac", '^MAKE_RULES', '^AC_OUTPUT$', @lines);
290 foreach my $file (sort values %makerules)
292 push @targets, $file;
293 my %make = %{$makefiles{$file}};
294 if (!defined($make{"=rules"})) { push @depends, "$file: $file.in"; }
295 else { push @depends, "$file: $file.in Make.rules"; }
298 foreach my $file (sort @_)
300 push @targets, $file unless $file eq "Makefile";
301 my %makefile = %{$makefiles{$file}};
302 my $dep = $makefile{"=rules"};
303 push @depends, "$file: $file.in $dep";
307 @lines = ();
308 push @lines, "ALL_MAKEFILES = \\\n\t";
309 push @lines, join (" \\\n\t", @targets ), "\n\n";
310 push @lines, "Makefile \$(ALL_MAKEFILES): config.status\n";
311 push @lines, "\t\@./config.status \$\@\n";
312 push @lines, ".INIT: Makefile\n";
313 push @lines, ".BEGIN: Makefile\n\n";
314 push @lines, "\$(RECURSE_TARGETS) \$(MAKEDEP): \$(ALL_MAKEFILES)\n\n";
315 push @lines, "distclean::\n";
316 push @lines, "\t\$(RM) Makefile \$(ALL_MAKEFILES)\n\n";
317 push @lines, join ("\n", @depends ), "\n";
319 replace_in_file( "Makefile.in", '^ALL_MAKEFILES\s*=', undef, @lines );
323 ################################################################
324 # process ignore targets for generic source files
326 sub update_ignores(@)
328 my @ignores;
330 foreach my $file (sort @_)
332 my %makefile = %{$makefiles{$file}};
333 my @list;
335 foreach my $src (@ignore_srcs)
337 my @pattern = @{$src};
338 next unless defined $makefile{$pattern[0]};
339 push @list, map { (my $ret = $_) =~ s/$pattern[1]$/$pattern[2]/; $ret; } @{$makefile{$pattern[0]}};
341 push @list, @{$makefile{"RC_BINARIES"}} if defined $makefile{"RC_BINARIES"};
342 foreach my $f (@list)
344 push @ignores, $makefile{"=dir"} . $f unless $f =~ /\$\(.*\)/; # skip make variables
347 return @ignores;
350 ################################################################
351 # update dlls/Makefile.in
353 sub update_dlls(@)
355 my (%directories, %testdirs, %importlibs, %static_implibs, %staticlib_dirs, %altnames);
356 my $text = "";
357 my @ignores = ();
359 foreach my $make (@_)
361 my %makefile = %{$makefiles{$make}};
362 next if defined $makefile{"=skip"};
364 if ($make =~ /dlls\/(.*)\/tests\/Makefile/)
366 $testdirs{$1} = "$1/tests";
367 (my $crosstest = $makefile{"TESTDLL"}) =~ s/\.dll$//;
368 next;
371 next unless defined $makefile{"MODULE"};
372 my $module = $makefile{"MODULE"};
373 (my $dir = $makefile{"=dir"}) =~ s/^dlls\/(.*)\//$1/;
375 if ($makefile{"=rules"} eq $makerules{"MAKE_IMPLIB_RULES"})
377 $staticlib_dirs{$module} = $dir;
378 die "invalid module $module in dir $staticlib_dirs{$module}\n" if "$staticlib_dirs{$module}" ne $module;
380 else
382 die "invalid module $module" unless $module =~ /\./;
383 (my $mod = $module) =~ s/\.dll$//;
384 die "invalid directory $dir for module $module\n" unless $mod eq $dir;
385 $directories{$module} = $dir;
388 if (defined $makefile{"IMPORTLIB"})
390 if ($makefile{"IMPORTLIB"} =~ /^([a-zA-Z0-9_.]+)/)
392 $importlibs{$module} = $1;
394 else
396 die "invalid importlib name $makefile{IMPORTLIB} in $make";
400 $static_implibs{$module} = 1 if defined $makefile{"IMPLIB_SRCS"};
402 if (defined $makefile{"SPEC_SRCS16"})
404 my @list = map { $_ =~ s/\.spec$//; $_ .= ".dll" unless $_ =~ /\./; $_; } @{$makefile{"SPEC_SRCS16"}};
405 $altnames{$module} = \@list;
407 if (defined $makefile{"EXTRA_OBJS16"})
409 foreach my $obj (@{$makefile{"EXTRA_OBJS16"}})
411 if ($obj =~ /^(.*\.(exe|mod))\.o/) { push @{$altnames{$module}}, $1; }
416 # output special dlls configure definitions
418 $text .= "# special configure-dependent targets\n\n";
419 my %specials = ();
420 foreach my $mod (sort keys %special_dlls)
422 $specials{$special_dlls{$mod}} .= " " . $mod;
424 foreach my $i (sort keys %specials)
426 $text .= $i . " =" . $specials{$i} . "\n";
428 $text .= "EXTRADIRS =";
429 foreach my $i (sort keys %specials) { $text .= sprintf " \@%s\@", $i; }
430 $text .= "\n\n";
432 # output the subdirs list
434 $text .= "# Subdir list\n\n";
435 $text .= "BASEDIRS =";
436 foreach my $dir (sort values %directories)
438 next if defined($special_dlls{$dir}); # skip special dlls
439 $text .= " \\\n\t" . $dir;
442 $text .= "\n\nIMPLIBSUBDIRS = \\\n\t";
443 $text .= join " \\\n\t", sort values %staticlib_dirs;
445 $text .= "\n\nTESTSUBDIRS = \\\n\t";
446 $text .= join " \\\n\t", sort values %testdirs;
448 $text .= "\n\nSUBDIRS = \\\n\t";
449 $text .= join " \\\n\t", "\$(BASEDIRS)", "\$(IMPLIBSUBDIRS)", "\$(TESTSUBDIRS)", sort keys %special_dlls;
451 $text .= "\n\nBUILDSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS) \$(TESTSUBDIRS)\n";
452 $text .= "INSTALLSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS) \$(IMPLIBSUBDIRS)\n";
453 $text .= "DOCSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS)\n";
455 # output the list of 16-bit files
457 my @targets16 = ();
458 foreach my $mod (sort keys %directories)
460 next unless defined $altnames{$mod};
461 foreach my $i (sort @{$altnames{$mod}})
463 push @targets16, $i . "16";
466 $text .= "\n# 16-bit dlls\n\n";
467 $text .= "WIN16_FILES = \\\n";
468 $text .= "\t" . join( " \\\n\t", sort @targets16 ) . "\n\n";
469 $text .= "\@MAKE_RULES\@\n\n";
471 # output the all: target
473 $text .= "# Main target\n\n";
474 $text .= "all: \$(BUILDSUBDIRS) \@WIN16_FILES\@\n\n";
476 # output the lib name -> directory rules
478 $text .= "# Placeholders for 16-bit libraries\n\n";
479 foreach my $mod (sort keys %directories)
481 next unless defined $altnames{$mod};
482 $text .= sprintf "%s:\n", join(" ", map { $_ . "16"; } sort @{$altnames{$mod}});
483 $text .= sprintf "\techo \"%s\" >\$\@\n\n", $mod;
486 # output the import libraries rules
488 $text .= "# Import libraries\n\n";
489 $text .= "STATIC_IMPLIBEXT = \$(IMPLIBEXT:def=def.a)\n\n";
491 my @lib_symlinks = ();
492 foreach my $mod (sort keys %importlibs)
494 my $dir = $directories{$mod};
495 my $lib = $importlibs{$mod};
496 if ($lib ne $dir) { push @lib_symlinks, $mod; }
498 $text .= "IMPORT_SYMLINKS =";
499 foreach my $mod (sort @lib_symlinks)
501 $text .= sprintf " \\\n\tlib%s.\$(IMPLIBEXT)", $importlibs{$mod};
504 $text .= "\n\nIMPORT_LIBS = \\\n\t\$(IMPORT_SYMLINKS)";
505 foreach my $mod (sort keys %staticlib_dirs)
507 $text .= sprintf " \\\n\t%s/lib%s.a", $staticlib_dirs{$mod}, $mod;
509 foreach my $mod (sort keys %importlibs)
511 $text .= " \\\n\t$directories{$mod}/lib$importlibs{$mod}.\$(IMPLIBEXT)";
512 next unless defined $static_implibs{$mod};
513 $text .= " \\\n\t$directories{$mod}/lib$importlibs{$mod}.\$(STATIC_IMPLIBEXT)";
515 $text .= "\n\nCROSS_IMPLIBS =";
516 foreach my $mod (sort @lib_symlinks)
518 $text .= sprintf " \\\n\tlib%s.a", $importlibs{$mod};
520 foreach my $mod (sort keys %importlibs)
522 next if defined $static_implibs{$mod};
523 $text .= " \\\n\t$directories{$mod}/lib$importlibs{$mod}.a";
525 $text .= "\n\n";
526 $text .= "\$(TESTSUBDIRS:%=%/__crosstest__): \$(CROSS_IMPLIBS)\n\n";
527 $text .= "implib: \$(IMPORT_LIBS)\n\n";
528 $text .= ".PHONY: implib\n\n";
530 foreach my $mod (sort keys %importlibs)
532 my $dir = $directories{$mod};
533 my $lib = $importlibs{$mod};
534 my $spec = $mod;
535 $spec =~ s/\.dll$//;
536 if (defined($static_implibs{$mod}))
538 $text .= sprintf "%s/lib%s.def: %s/%s.spec \$(WINEBUILD)\n", $dir, $lib, $dir, $spec;
539 $text .= sprintf "\t\@cd %s && \$(MAKE) lib%s.def\n\n", $dir, $lib;
540 $text .= sprintf "%s/lib%s.\$(STATIC_IMPLIBEXT): dummy\n", $dir, $lib, $dir, $spec;
541 $text .= sprintf "\t\@cd %s && \$(MAKE) lib%s.\$(STATIC_IMPLIBEXT)\n\n", $dir, $lib;
543 else
545 $text .= sprintf "%s/lib%s.def %s/lib%s.a: %s/%s.spec \$(WINEBUILD)\n",
546 $dir, $lib, $dir, $lib, $dir, $spec;
547 $text .= sprintf "\t\@cd %s && \$(MAKE) `basename \$\@`\n\n", $dir;
550 foreach my $mod (sort @lib_symlinks)
552 my $dir = $directories{$mod};
553 my $lib = "lib" . $importlibs{$mod};
554 $text .= sprintf "%s.a: %s/%s.a\n", $lib, $dir, $lib;
555 $text .= sprintf "\t\$(RM) \$@ && \$(LN_S) %s/%s.a \$@\n\n", $dir, $lib;
556 $text .= sprintf "%s.def: %s/%s.def\n", $lib, $dir, $lib;
557 $text .= sprintf "\t\$(RM) \$@ && \$(LN_S) %s/%s.def \$@\n\n", $dir, $lib;
560 $text .= "\$(BUILDSUBDIRS): \$(IMPORT_LIBS)\n";
561 $text .= "\$(INSTALLSUBDIRS:%=%/__install__) \$(INSTALLSUBDIRS:%=%/__install-lib__): \$(IMPORT_LIBS)\n\n";
563 # output the inter-dll dependencies and rules
565 $text .= "# Map library name to the corresponding directory\n\n";
567 foreach my $mod (sort keys %staticlib_dirs)
569 $text .= sprintf "%s/lib%s.a: %s\n", $staticlib_dirs{$mod}, $mod, $staticlib_dirs{$mod};
571 $text .= "\n# Misc rules\n";
573 replace_in_file( "dlls/Makefile.in",
574 '^# special configure-dependent targets',
575 '^# Misc rules',
576 $text );
578 # .gitignore file
580 foreach my $mod (sort @lib_symlinks)
582 push @ignores, "dlls/lib$importlibs{$mod}.def";
584 foreach my $mod (sort keys %directories)
586 next unless defined $altnames{$mod};
587 push @ignores, map { "dlls/" . $_ . "16"; } @{$altnames{$mod}};
590 return @ignores;
594 ################################################################
595 # update programs/Makefile.in
597 sub update_progs(@)
599 my (@subdirs, @install_subdirs, @install_progs);
601 my @ignores = ();
603 foreach my $make (@_)
605 my %makefile = %{$makefiles{$make}};
606 my $module = $makefile{"MODULE"};
607 (my $dir = $make) =~ s/^programs\/(.*)\/Makefile$/$1/;
608 die "Invalid module $module in $make" unless "$dir.exe" eq $module;
609 next if defined $makefile{"=skip"};
610 push @subdirs, $dir;
611 push @ignores, "programs/$dir/$dir";
612 push @install_subdirs, $dir unless $dont_install{$dir};
613 push @install_progs, $dir if $bin_install{$dir};
616 replace_in_file( "programs/Makefile.in", '^SUBDIRS\s*=', '^INSTALLDIRS',
617 "SUBDIRS = \\\n\t",
618 join( " \\\n\t", @subdirs ),
619 "\n\n# Sub-directories to run make install into\nINSTALLSUBDIRS = \\\n\t",
620 join( " \\\n\t", @install_subdirs ),
621 "\n\n# Programs to install in bin directory\nINSTALLPROGS = \\\n\t",
622 join( " \\\n\t", @install_progs ),
623 "\n\nINSTALLDIRS = \$(DESTDIR)\$(bindir)\n" );
625 return @ignores;
629 ################################################################
630 # update include/Makefile.in
632 sub update_includes()
634 return unless -d ".git";
635 my (@h_srcs, @idl_srcs, @tlb_srcs, %subdirs);
636 my @includes = map { s/^include\///; $_; } split /\0/, `git ls-files -c -z include`;
637 foreach my $incl (@includes)
639 if ($incl =~ /(.*)\//) { $subdirs{$1} = 1; }
640 next if ($incl =~ /^wine\// && !$exported_wine_headers{$incl});
641 if ($incl =~ /stdole2\.idl$/) { push @tlb_srcs, $incl; }
642 elsif ($private_idl_headers{$incl}) { push @h_srcs, $incl; }
643 elsif ($incl =~ /\.h$/) { push @h_srcs, $incl; }
644 elsif ($incl =~ /\.inl$/) { push @h_srcs, $incl; }
645 elsif ($incl =~ /\.idl$/) { push @idl_srcs, $incl; }
647 replace_in_file( "include/Makefile.in", '^IDL_H_SRCS\s*=', '^INSTALLDIRS',
648 "IDL_H_SRCS = \\\n\t",
649 join( " \\\n\t", sort @idl_srcs ),
650 "\n\nIDL_TLB_SRCS = \\\n\t",
651 join( " \\\n\t", sort @tlb_srcs ),
652 "\n\nSRCDIR_INCLUDES = \\\n\t\$(IDL_TLB_SRCS) \\\n\t\$(IDL_H_SRCS) \\\n\t",
653 join( " \\\n\t", sort @h_srcs ),
654 "\n\nEXTRASUBDIRS = ",
655 join( " ", sort keys %subdirs ),
656 "\n\nINSTALLDIRS = \\\n" );
660 ################################################################
661 # update the main .gitignore
663 sub update_gitignore(@)
665 my @ignores = values %makerules;
667 foreach my $make (@makefiles)
669 my %makefile = %{$makefiles{$make}};
670 my $dir = $makefile{"=dir"};
671 if (defined $makefile{"MANPAGES"})
673 push @ignores, map { $dir . $_; } @{$makefile{"MANPAGES"}};
675 if (defined $makefile{"PROGRAMS"})
677 push @ignores, map { s/\$\(EXEEXT\)//; $dir . $_; } @{$makefile{"PROGRAMS"}};
681 # prepend a slash to paths that don't have one
682 @ignores = map { $_ =~ s/^([^\/]+)$/\/$1/; $_; } @ignores;
684 # get rid of duplicates
685 my %ignores = ();
686 foreach my $i (@ignores, @_) { $ignores{$i} = 1; }
688 replace_in_file( ".gitignore", undef, undef,
689 "# Automatically generated by make_makefiles; DO NOT EDIT!!\n",
690 join("\n", sort keys %ignores), "\n" );
694 if (-d ".git")
696 @makefiles = map { s/\.in$//; $_; } split /\0/, `git ls-files -c -z Makefile.in \\*/Makefile.in`;
698 else
700 @makefiles = map { s/^\.\/(.*)\.in/$1/; $_; } split(/\s/,`find . -name Makefile.in -print`);
703 update_includes();
705 foreach my $file (sort values %makerules, @makefiles)
707 my %make = parse_makefile( $file );
708 $makefiles{$file} = \%make;
711 update_makefiles( @makefiles );
712 push @ignores, update_ignores( @makefiles );
713 push @ignores, update_winetest( @makefiles );
714 push @ignores, update_dlls( sort grep /^dlls\//, @makefiles );
715 push @ignores, update_progs( sort grep /^programs\/.*\/Makefile$/, @makefiles );
716 update_gitignore( @ignores );