Alexandre Julliard : makefiles: Generate rules from makedep for .in files.

Alexandre Julliard julliard at winehq.org
Fri Dec 13 12:46:28 CST 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 12 20:04:53 2013 +0100

makefiles: Generate rules from makedep for .in files.

---

 Make.rules.in        |    2 +-
 Make.vars.in         |    2 +-
 configure            |    6 ------
 configure.ac         |    6 ------
 loader/Makefile.in   |    4 ++++
 tools/Makefile.in    |    6 +++---
 tools/make_makefiles |    8 +++++++-
 tools/makedep.c      |   12 +++++++-----
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index 6b9a996..27e5667 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -78,7 +78,7 @@ $(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_SRCS:.c=.cross.o)
 
 DEPEND_SRCS = $(C_SRCS) $(OBJC_SRCS) $(RC_SRCS) $(MC_SRCS) \
               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) $(IDL_R_SRCS) $(IDL_TLB_SRCS) \
-              $(BISON_SRCS) $(LEX_SRCS) $(XTEMPLATE_SRCS) $(EXTRA_OBJS) $(MANPAGES)
+              $(BISON_SRCS) $(LEX_SRCS) $(XTEMPLATE_SRCS) $(IN_SRCS) $(EXTRA_OBJS) $(MANPAGES)
 
 depend: dummy
 	$(MAKEDEP) $(MAKEDEPFLAGS) -C$(srcdir) -S$(top_srcdir) -T$(top_builddir) $(PARENTSRC:%=-P%) $(EXTRAINCL) $(DEPEND_SRCS)
diff --git a/Make.vars.in b/Make.vars.in
index 73bb0ae..a002c92 100644
--- a/Make.vars.in
+++ b/Make.vars.in
@@ -70,7 +70,7 @@ LIBWINE         = -L$(top_builddir)/libs/wine -lwine
 LIBWINE_STATIC  = $(top_builddir)/libs/wine/libwine_static.a
 WINEGCC         = $(TOOLSDIR)/tools/winegcc/winegcc $(TARGETFLAGS) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(top_builddir) @UNWINDFLAGS@
 CROSSWINEGCC    = $(TOOLSDIR)/tools/winegcc/winegcc $(CROSSTARGET:%=-b %) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(top_builddir) --lib-suffix=.cross.a
-SED_CMD         = LC_ALL=C sed -e 's, at bindir\@,$(bindir),g' -e 's, at dlldir\@,$(dlldir),g' -e 's, at PACKAGE_STRING\@, at PACKAGE_STRING@,g'
+SED_CMD         = LC_ALL=C sed -e 's, at bindir\@,$(bindir),g' -e 's, at dlldir\@,$(dlldir),g' -e 's, at PACKAGE_STRING\@, at PACKAGE_STRING@,g' -e 's, at PACKAGE_VERSION\@, at PACKAGE_VERSION@,g'
 LDRPATH_INSTALL = @LDRPATH_INSTALL@
 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
diff --git a/configure b/configure
index 1b160db..c080f84 100755
--- a/configure
+++ b/configure
@@ -7493,9 +7493,6 @@ $wine_binary: main.o wine_info.plist
 
 wine-installed: main.o wine_info.plist
 	\$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL)
-
-wine_info.plist: wine_info.plist.in \$(top_builddir)/include/config.h
-	LC_ALL=C sed -e 's, at PACKAGE_VERSION@,$PACKAGE_VERSION,g' \$(srcdir)/wine_info.plist.in >\$@ || (\$(RM) \$@ && false)
 "
     ;;
 
@@ -17566,9 +17563,6 @@ else
     as_fn_append LOADER_RULES "
 all: wine.inf
 
-wine.inf: wine.inf.in \$(top_builddir)/include/config.h
-	LC_ALL=C sed -e 's, at PACKAGE_STRING@,$PACKAGE_STRING,g' \$(srcdir)/wine.inf.in >\$@ || (\$(RM) \$@ && false)
-
 install install-lib:: wine.inf \$(DESTDIR)\$(datadir)/wine install-man-pages
 	\$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf
 	\$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls
diff --git a/configure.ac b/configure.ac
index c2c7460..38594e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,9 +878,6 @@ $wine_binary: main.o wine_info.plist
 
 wine-installed: main.o wine_info.plist
 	\$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL)
-
-wine_info.plist: wine_info.plist.in \$(top_builddir)/include/config.h
-	LC_ALL=C sed -e 's, at PACKAGE_VERSION@,$PACKAGE_VERSION,g' \$(srcdir)/wine_info.plist.in >\$@ || (\$(RM) \$@ && false)
 "])
     ;;
 
@@ -3538,9 +3535,6 @@ else
     AS_VAR_APPEND([LOADER_RULES],["
 all: wine.inf
 
-wine.inf: wine.inf.in \$(top_builddir)/include/config.h
-	LC_ALL=C sed -e 's, at PACKAGE_STRING@,$PACKAGE_STRING,g' \$(srcdir)/wine.inf.in >\$@ || (\$(RM) \$@ && false)
-
 install install-lib:: wine.inf \$(DESTDIR)\$(datadir)/wine install-man-pages
 	\$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf
 	\$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls
diff --git a/loader/Makefile.in b/loader/Makefile.in
index df8d0fd..1bdefb2 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -20,6 +20,10 @@ MANPAGES = \
 	wine.man.in \
 	wine.pl.UTF-8.man.in
 
+IN_SRCS = \
+	wine.inf.in \
+	wine_info.plist.in
+
 INSTALLDIRS = \
 	$(DESTDIR)$(bindir) \
 	$(DESTDIR)$(datadir)/wine
diff --git a/tools/Makefile.in b/tools/Makefile.in
index ec6921a..6d889b0 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -20,6 +20,9 @@ C_SRCS = \
 	makedep.c \
 	sfnt2fnt.c
 
+IN_SRCS = \
+	wineapploader.in
+
 INSTALLDIRS = \
 	$(DESTDIR)$(bindir) \
 	$(DESTDIR)$(datadir)/applications
@@ -42,9 +45,6 @@ fnt2fon$(EXEEXT): fnt2fon.o
 sfnt2fnt$(EXEEXT): sfnt2fnt.o
 	$(CC) $(CFLAGS) -o $@ sfnt2fnt.o $(LIBWINE_STATIC) $(LIBPORT) $(LDFLAGS) $(FREETYPELIBS)
 
-wineapploader: wineapploader.in
-	sed -e 's, at bindir\@,$(bindir),g' $(srcdir)/wineapploader.in >$@ || ($(RM) $@ && false)
-
 install install-lib:: $(DESTDIR)$(datadir)/applications
 	$(INSTALL_DATA) $(srcdir)/wine.desktop $(DESTDIR)$(datadir)/applications/wine.desktop
 	-$(UPDATE_DESKTOP_DATABASE)
diff --git a/tools/make_makefiles b/tools/make_makefiles
index d24dffc..8d94bfe 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -328,7 +328,7 @@ sub parse_makefile($)
             ${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB";
             next;
         }
-        if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_[CHIPRS]_SRCS|IDL_TLB_SRCS|IMPLIB_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|PO_SRCS|SVG_SRCS|PROGRAMS|MANPAGES)\s*=\s*(.*)/)
+        if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_[CHIPRS]_SRCS|IDL_TLB_SRCS|IMPLIB_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|PO_SRCS|SVG_SRCS|IN_SRCS|PROGRAMS|MANPAGES)\s*=\s*(.*)/)
         {
             my $var = $1;
             my @list = split(/\s+/, $2);
@@ -422,6 +422,7 @@ sub assign_sources_to_makefiles(@)
     foreach my $file (@_)
     {
         next if defined $ignored_source_files{$file};
+        next if $file =~ /Makefile\.in$/;
         my $dir = dirname( $file );
         my $subdir = $dir;
 
@@ -501,6 +502,10 @@ sub assign_sources_to_makefiles(@)
                 push @{${$make}{"=MANPAGES"}}, $name;
                 ${${$make}{"=flags"}}{"manpage"} = 1;
             }
+            elsif ($name =~ /\.in$/)
+            {
+                push @{${$make}{"=IN_SRCS"}}, $name;
+            }
         }
     }
 
@@ -625,6 +630,7 @@ sub update_makefiles(@)
         replace_makefile_variable( $file, "IDL_S_SRCS" );
         replace_makefile_variable( $file, "IDL_TLB_SRCS" );
         replace_makefile_variable( $file, "XTEMPLATE_SRCS" );
+        replace_makefile_variable( $file, "IN_SRCS" );
         replace_makefile_variable( $file, "IMPLIB_SRCS" );
         replace_makefile_variable( $file, "SRCDIR_INCLUDES" );
         replace_makefile_variable( $file, "MANPAGES" );
diff --git a/tools/makedep.c b/tools/makedep.c
index 32383f4..f29aa44 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -914,15 +914,17 @@ static void parse_rc_file( struct incl_file *pFile, FILE *file )
 
 
 /*******************************************************************
- *         parse_man_page
+ *         parse_in_file
  */
-static void parse_man_page( struct incl_file *source, FILE *file )
+static void parse_in_file( struct incl_file *source, FILE *file )
 {
     char *p, *buffer;
 
     /* make sure it gets rebuilt when the version changes */
     add_include( source, "config.h", 1 );
 
+    if (!strendswith( source->filename, ".man.in" )) return;  /* not a man page */
+
     input_line = 0;
     while ((buffer = get_line( file )))
     {
@@ -1012,8 +1014,8 @@ static void parse_file( struct incl_file *source, int src )
         parse_c_file( source, file );
     else if (strendswith( source->filename, ".rc" ))
         parse_rc_file( source, file );
-    else if (strendswith( source->filename, ".man.in" ))
-        parse_man_page( source, file );
+    else if (strendswith( source->filename, ".in" ))
+        parse_in_file( source, file );
     fclose(file);
     input_file_name = NULL;
 }
@@ -1269,7 +1271,7 @@ static void output_sources(void)
             }
             column += output( " %s", source->filename );
         }
-        else if (!strcmp( ext, "in" ))  /* man page */
+        else if (!strcmp( ext, "in" ))  /* .in file or man page */
         {
             if (strendswith( obj, ".man" ) && source->sourcename)
             {




More information about the wine-cvs mailing list