Alexandre Julliard : make_makefiles: Generate the top-level .gitignore file .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 28 07:40:18 CST 2006


Module: wine
Branch: master
Commit: 7035aa50413ef18f74a35a06c6aa258b0edb56a7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7035aa50413ef18f74a35a06c6aa258b0edb56a7

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 27 21:23:36 2006 +0100

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(-)

diff --git a/.gitignore b/.gitignore
index 158446c..2439e8a 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 af2c061..b988a3c 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) $(
 # 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 8a6627c..0a3eebc 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 677df33..b047063 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 47a8629..f3e365f 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- at PACKAGE_VERSION@") | sed -e 's/\(.*\)/const char wine_version[] = "\1";/' >$@ || ($(RM) $@ && exit 1)
diff --git a/programs/.gitignore b/programs/.gitignore
index fbb5a64..08910ef 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 fb22ad4..8b61cde 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, at 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 e1bf13e..0000000
--- a/programs/winedbg/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/winedbg.man
diff --git a/server/.gitignore b/server/.gitignore
deleted file mode 100644
index fa0508c..0000000
--- 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 767f5bd..0000000
--- 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 1fbd104..c0bfbc6 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 (<MAKE>)
@@ -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 444551b..0000000
--- 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 bfcd432..0000000
--- 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 a36a82c..0000000
--- 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 e20f448..0000000
--- 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 4e7d73f..0000000
--- 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 f0989d7..0000000
--- a/tools/wrc/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/wrc
-/wrc.man




More information about the wine-cvs mailing list