From 7035aa50413ef18f74a35a06c6aa258b0edb56a7 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 27 Dec 2006 21:23:36 +0100 Subject: [PATCH] make_makefiles: Generate the top-level .gitignore file. Add a PROGRAMS variable in some makefiles to make things easier. --- .gitignore | 46 +++++++++++++++++++++++++++--- Makefile.in | 6 ++-- dlls/.gitignore | 3 -- loader/.gitignore | 6 ---- loader/Makefile.in | 9 +++++- programs/.gitignore | 3 -- programs/Makefile.in | 7 ++--- programs/winedbg/.gitignore | 1 - server/.gitignore | 2 -- tools/.gitignore | 10 ------- tools/make_makefiles | 57 +++++++++++++++++++++++++++++-------- tools/widl/.gitignore | 2 -- tools/winebuild/.gitignore | 2 -- tools/winedump/.gitignore | 2 -- tools/winegcc/.gitignore | 4 --- tools/wmc/.gitignore | 2 -- tools/wrc/.gitignore | 2 -- 17 files changed, 100 insertions(+), 64 deletions(-) delete mode 100644 programs/winedbg/.gitignore delete mode 100644 server/.gitignore delete mode 100644 tools/.gitignore delete mode 100644 tools/widl/.gitignore delete mode 100644 tools/winebuild/.gitignore delete mode 100644 tools/winedump/.gitignore delete mode 100644 tools/winegcc/.gitignore delete mode 100644 tools/wmc/.gitignore delete mode 100644 tools/wrc/.gitignore diff --git a/.gitignore b/.gitignore index 158446c06a2..2439e8a3f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,6 @@ *.cur *.ico *.mc.rc -*.orig -*.rej *.res *.so *.tab.[ch] @@ -14,12 +12,52 @@ *.yy.c *_[cips].c *~ -/Make.rules /TAGS /autom4te.cache /config.cache /config.log /config.status /tags -/wine Makefile +# Everything below this line is generated by make_makefiles +/Make.rules +/wine +dlls/Makedll.rules +dlls/Makeimplib.rules +dlls/Maketest.rules +loader/wine +loader/wine-glibc +loader/wine-kthread +loader/wine-preloader +loader/wine-pthread +loader/wine.man +programs/Makeprog.rules +programs/wineapploader +programs/winedbg/winedbg.man +programs/winelauncher +server/wineserver +server/wineserver.man +tools/bin2res +tools/fnt2bdf +tools/fnt2fon +tools/make_ctests +tools/makedep +tools/relpath +tools/sfnt2fnt +tools/widl/widl +tools/widl/widl.man +tools/winebuild/winebuild +tools/winebuild/winebuild.man +tools/winedump/winedump +tools/winedump/winedump.man +tools/winegcc/winecpp +tools/winegcc/wineg++ +tools/winegcc/winegcc +tools/winegcc/winegcc.man +tools/winemaker.man +tools/wineprefixcreate +tools/wineprefixcreate.man +tools/wmc/wmc +tools/wmc/wmc.man +tools/wrc/wrc +tools/wrc/wrc.man diff --git a/Makefile.in b/Makefile.in index af2c06104ff..b988a3c5efe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,6 +25,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ LIBEXT = @LIBEXT@ MODULE = none +PROGRAMS = wine FONTSSUBDIRS = @FONTSSUBDIRS@ @@ -58,7 +59,7 @@ INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS) # Sub-directories to run make test into TESTSUBDIRS = dlls -all: Make.rules wine +all: Make.rules $(PROGRAMS) @echo "Wine build complete." WINAPI_CHECK_EXTRA_FLAGS = --global @@ -139,9 +140,6 @@ tags ctags: manpages htmlpages sgmlpages: dummy @cd documentation && $(MAKE) $@ -clean:: - $(RM) wine - distclean:: clean $(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h $(RM) -r autom4te.cache diff --git a/dlls/.gitignore b/dlls/.gitignore index 8a6627c333d..0a3eebc12e5 100644 --- a/dlls/.gitignore +++ b/dlls/.gitignore @@ -1,9 +1,6 @@ # Automatically generated by make_makefiles; DO NOT EDIT!! */tests/*.ok */tests/testlist.c -/Makedll.rules -/Makeimplib.rules -/Maketest.rules /avifile.dll16 /comm.drv16 /commdlg.dll16 diff --git a/loader/.gitignore b/loader/.gitignore index 677df335e11..b0470638e83 100644 --- a/loader/.gitignore +++ b/loader/.gitignore @@ -1,8 +1,2 @@ /version-stamp /version.c -/wine -/wine-glibc -/wine-kthread -/wine-preloader -/wine-pthread -/wine.man diff --git a/loader/Makefile.in b/loader/Makefile.in index 47a86292eca..f3e365f7262 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -18,6 +18,13 @@ MAIN_BINARY = @MAIN_BINARY@ EXTRA_BINARIES = @EXTRA_BINARIES@ WINE_BINARIES = $(MAIN_BINARY) $(EXTRA_BINARIES) +PROGRAMS = \ + wine \ + wine-glibc \ + wine-kthread \ + wine-preloader \ + wine-pthread\ + MANPAGES = wine.man INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext) @@ -58,7 +65,7 @@ uninstall:: $(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/wine.$(prog_manext) clean:: - $(RM) $(WINE_BINARIES) $(MODULE) version.c version-stamp + $(RM) version.c version-stamp version-stamp: dummy (GIT_DIR=$(TOPSRCDIR)/.git git-describe 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -e 's/\(.*\)/const char wine_version[] = "\1";/' >$@ || ($(RM) $@ && exit 1) diff --git a/programs/.gitignore b/programs/.gitignore index fbb5a64fd70..08910efb089 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -1,7 +1,4 @@ # Automatically generated by make_makefiles; DO NOT EDIT!! -/Makeprog.rules -/wineapploader -/winelauncher clock/clock cmd/cmd cmdlgtst/cmdlgtst diff --git a/programs/Makefile.in b/programs/Makefile.in index fb22ad4e6a0..8b61cdeceb4 100644 --- a/programs/Makefile.in +++ b/programs/Makefile.in @@ -99,9 +99,11 @@ INSTALLPROGS = \ INSTALLDIRS = $(DESTDIR)$(bindir) +PROGRAMS = wineapploader winelauncher + @MAKE_RULES@ -all: wineapploader winelauncher $(SUBDIRS) +all: $(PROGRAMS) $(SUBDIRS) wineapploader: wineapploader.in sed -e 's,@bindir\@,$(bindir),g' $(SRCDIR)/wineapploader.in >$@ || ($(RM) $@ && false) @@ -131,9 +133,6 @@ uninstall:: -cd $(DESTDIR)$(bindir) && $(RM) wineapploader winelauncher $(INSTALLPROGS) -rmdir $(DESTDIR)$(dlldir) -clean:: - $(RM) wineapploader winelauncher - # Rules for testing check test:: $(SUBDIRS:%=%/__test__) diff --git a/programs/winedbg/.gitignore b/programs/winedbg/.gitignore deleted file mode 100644 index e1bf13e3823..00000000000 --- a/programs/winedbg/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/winedbg.man diff --git a/server/.gitignore b/server/.gitignore deleted file mode 100644 index fa0508c8bf3..00000000000 --- a/server/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/wineserver -/wineserver.man diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index 767f5bd5c4d..00000000000 --- a/tools/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/bin2res -/fnt2bdf -/fnt2fon -/make_ctests -/makedep -/relpath -/sfnt2fnt -/winemaker.man -/wineprefixcreate -/wineprefixcreate.man diff --git a/tools/make_makefiles b/tools/make_makefiles index 1fbd1041c66..c0bfbc6a12a 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -77,12 +77,16 @@ sub update_file($) if (!$ret) { unlink "$file.new"; - #print "$file is unchanged\n"; } else { rename "$file.new", "$file"; print "$file updated\n"; + if ($file eq "configure.ac") + { + system "autoconf"; + print "configure updated\n"; + } } return $ret; } @@ -129,6 +133,8 @@ sub parse_makefile($) my $file = shift; my %make; + ($make{"=dir"} = $file) =~ s/[^\/]+$//; + open MAKE, "$file.in" or die "cannot open $file.in\n"; while () @@ -147,7 +153,7 @@ sub parse_makefile($) $make{$1} = $2; next; } - if (/^(IDL_H_SRCS|IMPLIB_SRCS|SPEC_SRCS16)\s*=\s*(.*)/) + if (/^(IDL_H_SRCS|IMPLIB_SRCS|SPEC_SRCS16|MANPAGES|PROGRAMS)\s*=\s*(.*)/) { my @list = split(/\s+/, $2); $make{$1} = \@list; @@ -275,9 +281,6 @@ sub update_dlls(@) my @ignores = ( - "/Makedll.rules", - "/Makeimplib.rules", - "/Maketest.rules", "*/tests/testlist.c", "*/tests/*.ok", ); @@ -526,7 +529,6 @@ sub update_dlls(@) } - ################################################################ # update programs/Makefile.in and programs/.gitignore @@ -534,12 +536,7 @@ sub update_progs(@) { my (@subdirs, @install_subdirs, @install_progs); - my @ignores = - ( - "/Makeprog.rules", - "/wineapploader", - "/winelauncher", - ); + my @ignores = (); foreach my $make (@_) { @@ -568,5 +565,41 @@ sub update_progs(@) join("\n", sort @ignores), "\n" ); } + +################################################################ +# update the main .gitignore + +sub update_gitignore() +{ + my @ignores = (); + + push @ignores, values %makerules; + + foreach my $make (@makefiles) + { + my %makefile = %{$makefiles{$make}}; + my $dir = $makefile{"=dir"}; + if (defined $makefile{"MANPAGES"}) + { + push @ignores, map { $dir . $_; } @{$makefile{"MANPAGES"}}; + } + if (defined $makefile{"PROGRAMS"}) + { + push @ignores, map { s/\$\(EXEEXT\)//; $dir . $_; } @{$makefile{"PROGRAMS"}}; + } + } + + # prepend a slash to paths that don't have one + @ignores = map { $_ =~ s/^([^\/]+)$/\/$1/; $_; } @ignores; + + replace_in_file( ".gitignore", + '^# Everything below this line is generated by make_makefiles', + undef, + "# Everything below this line is generated by make_makefiles\n", + join("\n", sort @ignores), "\n" ); +} + + update_dlls( sort grep /^dlls\//, @makefiles ); update_progs( sort grep /^programs\/.*\/Makefile$/, @makefiles ); +update_gitignore(); diff --git a/tools/widl/.gitignore b/tools/widl/.gitignore deleted file mode 100644 index 444551bf7cd..00000000000 --- a/tools/widl/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/widl -/widl.man diff --git a/tools/winebuild/.gitignore b/tools/winebuild/.gitignore deleted file mode 100644 index bfcd432105d..00000000000 --- a/tools/winebuild/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/winebuild -/winebuild.man diff --git a/tools/winedump/.gitignore b/tools/winedump/.gitignore deleted file mode 100644 index a36a82c1d12..00000000000 --- a/tools/winedump/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/winedump -/winedump.man diff --git a/tools/winegcc/.gitignore b/tools/winegcc/.gitignore deleted file mode 100644 index e20f448a73f..00000000000 --- a/tools/winegcc/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/winecpp -/wineg++ -/winegcc -/winegcc.man diff --git a/tools/wmc/.gitignore b/tools/wmc/.gitignore deleted file mode 100644 index 4e7d73f1849..00000000000 --- a/tools/wmc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/wmc -/wmc.man diff --git a/tools/wrc/.gitignore b/tools/wrc/.gitignore deleted file mode 100644 index f0989d73e13..00000000000 --- a/tools/wrc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/wrc -/wrc.man