Alexandre Julliard : makefiles: Expand more variables into the generated makefiles.

Alexandre Julliard julliard at winehq.org
Fri Nov 30 14:34:41 CST 2018


Module: wine
Branch: master
Commit: 1fd60d5656d9dda8486f1e4fcf8a45ab2188de43
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1fd60d5656d9dda8486f1e4fcf8a45ab2188de43

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Nov 30 13:26:36 2018 +0100

makefiles: Expand more variables into the generated makefiles.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 Makefile.in     |  2 +-
 tools/makedep.c | 26 ++++++++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 13b5a5a..5e7ad68 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -75,7 +75,7 @@ RUNTESTFLAGS    = -q -P wine
 MAKEDEP         = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
 WRC             = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT)
 PACKAGE_VERSION = @PACKAGE_VERSION@
-SED_CMD         = LC_ALL=C sed -e 's, at bindir\@,$(bindir),g' -e 's, at dlldir\@,$(dlldir),g' -e 's, at srcdir\@,$(srcdir),g' -e 's, at PACKAGE_STRING\@, at PACKAGE_STRING@,g' -e 's, at PACKAGE_VERSION\@, at PACKAGE_VERSION@,g'
+SED_CMD         = LC_ALL=C sed -e 's, at bindir\@,${bindir},g' -e 's, at dlldir\@,${dlldir},g' -e 's, at srcdir\@,${srcdir},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_PROGRAM = STRIPPROG="$(STRIP)" $(top_srcdir)/tools/install-sh $(INSTALL_PROGRAM_FLAGS)
diff --git a/tools/makedep.c b/tools/makedep.c
index 355f7fc..6b631b6 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -148,11 +148,16 @@ static const char *man_ext;
 static const char *crosstarget;
 static const char *fontforge;
 static const char *convert;
+static const char *flex;
+static const char *bison;
+static const char *ar;
+static const char *ranlib;
 static const char *rsvg;
 static const char *icotool;
 static const char *dlltool;
 static const char *msgfmt;
 static const char *ln_s;
+static const char *sed_cmd;
 
 struct makefile
 {
@@ -2492,15 +2497,15 @@ static void output_source_y( struct makefile *make, struct incl_file *source, co
     if (find_include_file( make, header ))
     {
         output( "%s: %s\n", obj_dir_path( make, header ), source->filename );
-        output( "\t$(BISON) -p %s_ -o %s.tab.c -d %s\n",
-                obj, obj_dir_path( make, obj ), source->filename );
+        output( "\t%s -p %s_ -o %s.tab.c -d %s\n",
+                bison, obj, obj_dir_path( make, obj ), source->filename );
         output( "%s.tab.c: %s %s\n", obj_dir_path( make, obj ),
                 source->filename, obj_dir_path( make, header ));
         strarray_add( &make->clean_files, header );
     }
     else output( "%s.tab.c: %s\n", obj, source->filename );
 
-    output( "\t$(BISON) -p %s_ -o $@ %s\n", obj, source->filename );
+    output( "\t%s -p %s_ -o $@ %s\n", bison, obj, source->filename );
 }
 
 
@@ -2510,7 +2515,7 @@ static void output_source_y( struct makefile *make, struct incl_file *source, co
 static void output_source_l( struct makefile *make, struct incl_file *source, const char *obj )
 {
     output( "%s.yy.c: %s\n", obj_dir_path( make, obj ), source->filename );
-    output( "\t$(FLEX) -o$@ %s\n", source->filename );
+    output( "\t%s -o$@ %s\n", flex, source->filename );
 }
 
 
@@ -2825,7 +2830,7 @@ static void output_source_in( struct makefile *make, struct incl_file *source, c
     strarray_add( &make->in_files, xstrdup(obj) );
     strarray_add( &make->all_targets, xstrdup(obj) );
     output( "%s: %s\n", obj_dir_path( make, obj ), source->filename );
-    output( "\t$(SED_CMD) %s >$@ || (rm -f $@ && false)\n", source->filename );
+    output( "\t%s %s >$@ || (rm -f $@ && false)\n", sed_cmd, source->filename );
     output( "%s:", obj_dir_path( make, obj ));
     output_filenames( source->dependencies );
     output( "\n" );
@@ -3177,9 +3182,9 @@ static void output_static_lib( struct makefile *make )
     output( "%s:", obj_dir_path( make, make->staticlib ));
     output_filenames_obj_dir( make, make->object_files );
     output( "\n\trm -f $@\n" );
-    output( "\t$(AR) $(ARFLAGS) $@" );
+    output( "\t%s rc $@", ar );
     output_filenames_obj_dir( make, make->object_files );
-    output( "\n\t$(RANLIB) $@\n" );
+    output( "\n\t%s $@\n", ranlib );
     add_install_rule( make, make->staticlib, make->staticlib,
                       strmake( "d$(dlldir)/%s", make->staticlib ));
     if (crosstarget && make->module)
@@ -3190,7 +3195,7 @@ static void output_static_lib( struct makefile *make )
         output( "%s:", obj_dir_path( make, name ));
         output_filenames_obj_dir( make, make->crossobj_files );
         output( "\n\trm -f $@\n" );
-        output( "\t%s-ar $(ARFLAGS) $@", crosstarget );
+        output( "\t%s-ar rc $@", crosstarget );
         output_filenames_obj_dir( make, make->crossobj_files );
         output( "\n\t%s-ranlib $@\n", crosstarget );
     }
@@ -4229,10 +4234,15 @@ int main( int argc, char *argv[] )
     crosstarget  = get_expanded_make_variable( top_makefile, "CROSSTARGET" );
     fontforge    = get_expanded_make_variable( top_makefile, "FONTFORGE" );
     convert      = get_expanded_make_variable( top_makefile, "CONVERT" );
+    flex         = get_expanded_make_variable( top_makefile, "FLEX" );
+    bison        = get_expanded_make_variable( top_makefile, "BISON" );
+    ar           = get_expanded_make_variable( top_makefile, "AR" );
+    ranlib       = get_expanded_make_variable( top_makefile, "RANLIB" );
     rsvg         = get_expanded_make_variable( top_makefile, "RSVG" );
     icotool      = get_expanded_make_variable( top_makefile, "ICOTOOL" );
     dlltool      = get_expanded_make_variable( top_makefile, "DLLTOOL" );
     msgfmt       = get_expanded_make_variable( top_makefile, "MSGFMT" );
+    sed_cmd      = get_expanded_make_variable( top_makefile, "SED_CMD" );
     ln_s         = get_expanded_make_variable( top_makefile, "LN_S" );
 
     if (root_src_dir && !strcmp( root_src_dir, "." )) root_src_dir = NULL;




More information about the wine-cvs mailing list