commit 55516135bcc05097facc97735dfde75f1ff793c0
parent 643e1d694c158cb7bd4c374836afbecef2799363
Author: Michael Forney <mforney@mforney.org>
Date: Fri, 22 Nov 2013 17:40:14 -0800
Makefile: Make dependencies work for both .o and .lo
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -27,7 +27,8 @@ define check_deps
@$(PKG_CONFIG) --exists --print-errors $2
endef
-compile = $(call quiet,CC) $(CFLAGS) $(CPPFLAGS) -I . -c -MMD -MP -MF .deps/$(basename $<).d -o $@ $<
+compile = $(call quiet,CC) $(CFLAGS) $(CPPFLAGS) -I . -c -o $@ $< \
+ -MMD -MP -MF .deps/$(basename $<).d -MT $(basename $@).o -MT $(basename $@).lo
link = $(call quiet,CCLD,$(CC)) $(CFLAGS) -o $@ $^
pkgconfig = $(sort $(foreach pkg,$(1),$(if $($(pkg)_$(3)),$($(pkg)_$(3)), \
$(shell $(PKG_CONFIG) --$(2) $(pkg)))))