Alexandre Julliard : makedep: Allow overriding makefile variables through the MAKEFLAGS environment variable .

Alexandre Julliard julliard at winehq.org
Fri Dec 27 13:31:09 CST 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 26 19:26:37 2013 +0100

makedep: Allow overriding makefile variables through the MAKEFLAGS environment variable.

---

 tools/makedep.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/tools/makedep.c b/tools/makedep.c
index f347d90..2cb32b9 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1838,6 +1838,29 @@ static void update_makefile( const char *path )
 
 
 /*******************************************************************
+ *         parse_makeflags
+ */
+static void parse_makeflags( const char *flags )
+{
+    const char *p = flags;
+    char *var, *buffer = xmalloc( strlen(flags) + 1 );
+
+    while (*p)
+    {
+        while (isspace(*p)) p++;
+        var = buffer;
+        while (*p && !isspace(*p))
+        {
+            if (*p == '\\' && p[1]) p++;
+            *var++ = *p++;
+        }
+        *var = 0;
+        if (var > buffer) set_make_variable( &cmdline_vars, buffer );
+    }
+}
+
+
+/*******************************************************************
  *         parse_option
  */
 static int parse_option( const char *opt )
@@ -1893,9 +1916,12 @@ static int parse_option( const char *opt )
  */
 int main( int argc, char *argv[] )
 {
+    const char *makeflags = getenv( "MAKEFLAGS" );
     struct incl_file *pFile;
     int i, j;
 
+    if (makeflags) parse_makeflags( makeflags );
+
     i = 1;
     while (i < argc)
     {




More information about the wine-cvs mailing list