diff --git a/Makefile b/Makefile index ed1a0f4..c3a0486 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ DOCDIR ?= $(DATADIR)/$(LIBNAME)/doc SRCS := $(notdir $(wildcard src/*.cpp)) OBJS := $(SRCS:.cpp=.o) -DEPS := $(SRCS:.cpp=.d) +DEPS := $(SRCS:.cpp=.dep) HDRS ?= $(wildcard src/*.hpp) CXX ?= g++ @@ -50,7 +50,7 @@ RM := /bin/rm -rf INSTALL := /usr/bin/install -c vpath %.cpp src -vpath %.d $(BUILDDIR) +vpath %.dep $(BUILDDIR) vpath %.o $(BUILDDIR) .PHONY: all clean install prebuild test @@ -71,9 +71,9 @@ ifeq ($(UNAME_S),Linux) $(CXX) -g -shared -Wl,-soname,$(SONAME) -o $(OUTDIR)$(REALNAME) $(LDFLAGS) $(LDLIBS) $(addprefix $(BUILDDIR),$(OBJS)) endif -%.o %.d: %.cpp - $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $< - @mv $@ $*.d $(BUILDDIR) +%.o %.dep: %.cpp + $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.dep -c $< + @mv $@ $*.dep $(BUILDDIR) -include $(addprefix $(BUILDDIR), $(DEPS))