Alexandre Julliard : makedep: Expand the winegcc target arguments into the generated rules.

Alexandre Julliard julliard at winehq.org
Mon Jan 13 12:46:32 CST 2014


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan 13 14:44:26 2014 +0100

makedep: Expand the winegcc target arguments into the generated rules.

---

 Make.vars.in    |    4 ++--
 tools/makedep.c |   28 +++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/Make.vars.in b/Make.vars.in
index 75cb1e6..9814b88 100644
--- a/Make.vars.in
+++ b/Make.vars.in
@@ -24,6 +24,7 @@ CPPFLAGS        = @CPPFLAGS@
 EXTRACFLAGS     = @EXTRACFLAGS@
 MSVCRTFLAGS     = @BUILTINFLAG@
 TARGETFLAGS     = @TARGETFLAGS@
+UNWINDFLAGS     = @UNWINDFLAGS@
 LIBS            = @LIBS@
 BISON           = @BISON@
 FLEX            = @FLEX@
@@ -59,12 +60,11 @@ WIDL            = $(TOOLSDIR)/tools/widl/widl$(TOOLSEXT)
 WINEBUILD       = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT)
 WMC             = $(TOOLSDIR)/tools/wmc/wmc$(TOOLSEXT)
 WRC             = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT)
+WINEGCC         = $(TOOLSDIR)/tools/winegcc/winegcc$(TOOLSEXT)
 LIBPORT         = $(top_builddir)/libs/port/libwine_port.a
 LIBWPP          = $(top_builddir)/libs/wpp/libwpp.a
 LIBWINE         = -L$(top_builddir)/libs/wine -lwine
 LIBWINE_STATIC  = $(top_builddir)/libs/wine/libwine_static.a
-WINEGCC         = $(TOOLSDIR)/tools/winegcc/winegcc -B$(TOOLSDIR)/tools/winebuild --sysroot=$(top_builddir) @UNWINDFLAGS@
-CROSSWINEGCC    = $(TOOLSDIR)/tools/winegcc/winegcc -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' -e 's, at PACKAGE_VERSION\@, at PACKAGE_VERSION@,g'
 LDRPATH_INSTALL = @LDRPATH_INSTALL@
 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
diff --git a/tools/makedep.c b/tools/makedep.c
index c968187..94609a2 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -104,6 +104,7 @@ static const char *src_dir;
 static const char *top_src_dir;
 static const char *top_obj_dir;
 static const char *parent_dir;
+static const char *tools_dir;
 static const char *makefile_name = "Makefile";
 static const char *Separator = "### Dependencies";
 static const char *input_file_name;
@@ -497,6 +498,17 @@ static char *top_dir_path( const char *path )
 
 
 /*******************************************************************
+ *         tools_dir_path
+ */
+static char *tools_dir_path( const char *path )
+{
+    if (tools_dir) return strmake( "%s/tools/%s", tools_dir, path );
+    if (top_obj_dir) return strmake( "%s/tools/%s", top_obj_dir, path );
+    return strmake( "tools/%s", path );
+}
+
+
+/*******************************************************************
  *         init_paths
  */
 static void init_paths(void)
@@ -504,6 +516,7 @@ static void init_paths(void)
     /* ignore redundant source paths */
     if (src_dir && !strcmp( src_dir, "." )) src_dir = NULL;
     if (top_src_dir && top_obj_dir && !strcmp( top_src_dir, top_obj_dir )) top_src_dir = NULL;
+    if (tools_dir && top_obj_dir && !strcmp( tools_dir, top_obj_dir )) tools_dir = NULL;
 
     strarray_insert( &include_args, 0, strmake( "-I%s", top_dir_path( "include" )));
 }
@@ -1718,7 +1731,10 @@ static struct strarray output_sources(void)
         output_filenames( res_files );
         output( "\n" );
         output( "\t$(WINEGCC) -o $@" );
+        output_filename( strmake( "-B%s", tools_dir_path( "winebuild" )));
+        if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir ));
         output_filenames( targetflags );
+        output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" ));
         if (spec_file)
         {
             output( " -shared %s", spec_file );
@@ -1854,7 +1870,10 @@ static struct strarray output_sources(void)
         strarray_add( &clean_files, strmake( "%s%s", stripped, dllext ));
         output( "%s%s:\n", testmodule, dllext );
         output( "\t$(WINEGCC) -o $@" );
+        output_filename( strmake( "-B%s", tools_dir_path( "winebuild" )));
+        if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir ));
         output_filenames( targetflags );
+        output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" ));
         output_filenames( appmode );
         output_filenames( object_files );
         output_filenames( res_files );
@@ -1863,7 +1882,10 @@ static struct strarray output_sources(void)
         output( "\n" );
         output( "%s%s:\n", stripped, dllext );
         output( "\t$(WINEGCC) -s -o $@" );
+        output_filename( strmake( "-B%s", tools_dir_path( "winebuild" )));
+        if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir ));
         output_filenames( targetflags );
+        output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" ));
         output_filename( strmake( "-Wb,-F,%s", testmodule ));
         output_filenames( appmode );
         output_filenames( object_files );
@@ -1895,7 +1917,10 @@ static struct strarray output_sources(void)
             output_filenames( crossobj_files );
             output_filenames( res_files );
             output( "\n" );
-            output( "\t$(CROSSWINEGCC) -o $@ -b %s", crosstarget );
+            output( "\t$(WINEGCC) -o $@ -b %s", crosstarget );
+            output_filename( strmake( "-B%s", tools_dir_path( "winebuild" )));
+            if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir ));
+            output_filename( "--lib-suffix=.cross.a" );
             output_filenames( crossobj_files );
             output_filenames( res_files );
             output_filenames( all_libs );
@@ -2104,6 +2129,7 @@ static void update_makefile( const char *path )
     top_src_dir = get_expanded_make_variable( "top_srcdir" );
     top_obj_dir = get_expanded_make_variable( "top_builddir" );
     parent_dir  = get_expanded_make_variable( "PARENTSRC" );
+    tools_dir   = get_expanded_make_variable( "TOOLSDIR" );
 
     appmode  = get_expanded_make_var_array( "APPMODE" );
     dllflags = get_expanded_make_var_array( "DLLFLAGS" );




More information about the wine-cvs mailing list