Automatically track per-file dependencies
This is enabled for platforms/compilers that support the -MMD option, which creates a dependency file named out.d when compiling to a file named out.o, only including local, not system headers. The additional -MP option adds phony targets for all included headers, to avoid having make error out due to "no rule to make target foo.h" if a header is renamed/removed. This makes sure that all the right files are rebuilt if a header is changed, avoiding the need for a full rebuild if only a few files are affected.
This commit is contained in:
parent
977768ac88
commit
a164436d98
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,6 +2,9 @@
|
||||
*.o
|
||||
*.ko
|
||||
|
||||
# Dependency files
|
||||
*.d
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
|
4
Makefile
4
Makefile
@ -94,7 +94,7 @@ CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSU
|
||||
all: libraries binaries
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(LIBRARIES) $(BINARIES)
|
||||
rm -f $(OBJS) $(OBJS:.o=.d) $(LIBRARIES) $(BINARIES)
|
||||
|
||||
gtest-bootstrap:
|
||||
svn co https://googletest.googlecode.com/svn/trunk/ gtest
|
||||
@ -119,3 +119,5 @@ ifeq ($(HAVE_GTEST),Yes)
|
||||
include build/gtest-targets.mk
|
||||
include test/targets.mk
|
||||
endif
|
||||
|
||||
-include $(OBJS:.o=.d)
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
ASM = nasm
|
||||
CFLAGS += -Wno-deprecated-declarations -Werror -fPIC -DMACOS -DMT_ENABLED
|
||||
CFLAGS += -Wno-deprecated-declarations -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP
|
||||
LDFLAGS += -lpthread
|
||||
ASMFLAGS += --prefix _ -DNOPREFIX
|
||||
ifeq ($(ENABLE64BIT), Yes)
|
||||
|
@ -1,5 +1,5 @@
|
||||
ASM = nasm
|
||||
CFLAGS += -Werror -fPIC -DLINUX -DMT_ENABLED
|
||||
CFLAGS += -Werror -fPIC -DLINUX -DMT_ENABLED -MMD -MP
|
||||
LDFLAGS += -lpthread
|
||||
ASMFLAGS += -DNOPREFIX
|
||||
ifeq ($(ENABLE64BIT), Yes)
|
||||
|
@ -1,5 +1,5 @@
|
||||
ASM = nasm
|
||||
CFLAGS += -DMT_ENABLED
|
||||
CFLAGS += -DMT_ENABLED -MMD -MP
|
||||
LDFLAGS +=
|
||||
ifeq ($(ENABLE64BIT), Yes)
|
||||
ASMFLAGS += -f win64
|
||||
|
Loading…
x
Reference in New Issue
Block a user