From: Johannes Berg <johannes.berg@xxxxxxxxx> If header files are changed, currently 'make clean' is needed. Fix that by having the compiler write dependency files and including them appropriately. --- .gitignore | 1 + wmediumd/Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 04c2b8047d3e..df3bfda9f922 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.o +*.d wmediumd/wmediumd diff --git a/wmediumd/Makefile b/wmediumd/Makefile index 0e5e6d2ee006..395215b74089 100644 --- a/wmediumd/Makefile +++ b/wmediumd/Makefile @@ -8,6 +8,7 @@ NL31FOUND := $(shell $(PKG_CONFIG) --exact-version=3.1 libnl-3.1 && echo Y) NL3xFOUND := $(shell $(PKG_CONFIG) --atleast-version=3.2 libnl-3.0 && echo Y) CFLAGS += -g -Wall -Wextra -Wno-unused-parameter -O2 +CFLAGS += -MMD -MP LDFLAGS += -levent -lm ifeq ($(NL2FOUND),Y) @@ -53,6 +54,9 @@ all: wmediumd wmediumd: $(OBJECTS) $(CC) -o $@ $(OBJECTS) $(LDFLAGS) - + +DEPS := $(patsubst %.o,%.d,$(OBJECTS)) clean: - rm -f $(OBJECTS) wmediumd + rm -f $(OBJECTS) $(DEPS) wmediumd + +-include *.d -- 2.24.1