Change the suffix rule to ensure that version.h is 
built before we try to create any .o file.

Reported-by: Roy Li <rongqing...@windriver.com>
Signed-off-by: Eric Sandeen <sand...@redhat.com>
---

I dunno, does this work?  My gnu make is rusty.

diff --git a/Makefile b/Makefile
index 3d715d8..d25054f 100644
--- a/Makefile
+++ b/Makefile
@@ -107,13 +107,13 @@ endif
 %.o.d: %.c
        $(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT 
$@ $(AM_CFLAGS) $(CFLAGS) $<
 
-.c.o:
+%.o: %.c version.h
        @$(check_echo) "    [SP]     $<"
        $(Q)$(check) $(AM_CFLAGS) $(CFLAGS) $<
        @echo "    [CC]     $@"
        $(Q)$(CC) $(AM_CFLAGS) $(CFLAGS) -c $<
 
-%.static.o: %.c
+%.static.o: %.c version.h
        @echo "    [CC]     $@"
        $(Q)$(CC) $(AM_CFLAGS) $(STATIC_CFLAGS) -c $< -o $@
 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to