]> sourceware.org Git - lvm2.git/commitdiff
Revert "build: Calculate dependencies at same time as compiling."
authorJoe Thornber <ejt@redhat.com>
Fri, 4 May 2018 08:48:40 +0000 (09:48 +0100)
committerJoe Thornber <ejt@redhat.com>
Fri, 4 May 2018 08:48:40 +0000 (09:48 +0100)
This reverts commit 0931067dc5549c443e144d599683b53220021f44.

The dep files should be in the build dir, which is not necc. the src dir.

Easy to fix, but reverting for now until I have time to revisit.

make.tmpl.in

index d3a80ef0c405162cbc87c5f9bcc7fc03a1b53d53..9d5d3675713873397dbf865c7a58db6cb1d77521 100644 (file)
@@ -442,14 +442,12 @@ endif
 
 .LIBPATTERNS = lib%.so lib%.a
 
-DEPFLAGS=-MT $@ -MMD -MP -MF $*.d
-
 # still needed in 2018 for 32bit builds
 DEFS+=-D_FILE_OFFSET_BITS=64
 
 %.o: %.c
        @echo "    [CC] $<"
-       $(Q) $(CC) $(DEPFLAGS) -c $(INCLUDES) $(VALGRIND_CFLAGS) $(PROGS_CFLAGS) $(DEFS) $(DEFS_$@) $(WFLAGS) $(WCFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
+       $(Q) $(CC) -c $(INCLUDES) $(VALGRIND_CFLAGS) $(PROGS_CFLAGS) $(DEFS) $(DEFS_$@) $(WFLAGS) $(WCFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
 
 %.o: %.cpp
        @echo "    [CXX] $<"
@@ -509,9 +507,18 @@ $(LIB_STATIC): $(OBJECTS)
        $(Q) $(RM) $@
        $(Q) $(AR) rsv $@ $(OBJECTS) > /dev/null
 
-%.d: $(INC_LNS)
-.PRECIOUS: %.d
-       
+%.d: %.c $(INC_LNS)
+       @echo "    [DEP] $<"
+       $(Q) $(MKDIR_P) $(dir $@); \
+       set -e; \
+       FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
+       DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
+       $(CC) -MM $(INCLUDES) $(VALGRIND_CFLAGS) $(PROGS_CFLAGS) $(DEFS) -o $@ $<; \
+       sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
+       DEPLIST=`sed 's/ \\\\//;s/.*://;' < $@`; \
+       echo $$DEPLIST | fmt -1 | sed 's/ //g;s/\(.*\)/\1:/' >> $@; \
+       [ -s $@ ] || $(RM) $@
+
 %.mo: %.po
        @echo "    [MSGFMT] $<"
        $(Q) $(MSGFMT) -o $@ $<
This page took 0.038582 seconds and 5 git commands to generate.