]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - tools/build/fixdep.c
tools build: Make fixdep parsing wait for last target
[mirror_ubuntu-zesty-kernel.git] / tools / build / fixdep.c
index 1521d36cef0dff64f5d11f56044430badc8b92d3..734d1547cbaed61820a2b4563680d21a04aa527a 100644 (file)
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)
        char *end = m + len;
        char *p;
        char s[PATH_MAX];
-       int is_target;
+       int is_target, has_target = 0;
        int saw_any_target = 0;
        int is_first_dep = 0;
 
@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)
                if (is_target) {
                        /* The /next/ file is the first dependency */
                        is_first_dep = 1;
-               } else {
+                       has_target = 1;
+               } else if (has_target) {
                        /* Save this token/filename */
                        memcpy(s, m, p-m);
                        s[p - m] = 0;