diff --git a/makefile b/makefile index 8e176b6bc..9218eaf14 100755 --- a/makefile +++ b/makefile @@ -298,10 +298,16 @@ $(BUILD_DIR)/%.pyh: %.py $(Q) $(PYTHONEXE) scripts/compile_tools/hexdump.py "$<" "$@" # Calculate dependencies -$(BUILD_DIR)/%.d: $(PYHEADERS) %.cpp - @echo "Checking dependencies for $*.cpp" +$(BUILD_DIR)/%.d: %.cpp + @echo "Checking dependencies for $<" $(Q) if [ ! -d "$(@D)" ]; then mkdir -p "$(@D)"; fi; - $(Q) $(SMILEICXX) $(CXXFLAGS) -MF"$@" -MM -MP -MT"$@ $(@:.d=.o)" $*.cpp + $(Q) $(SMILEICXX) $(CXXFLAGS) -MF"$@" -MM -MP -MT"$@ $(@:.d=.o)" $< + +# Calculate dependencies: special for Params.cpp which needs pyh files +$(BUILD_DIR)/src/Params/Params.d: src/Params/Params.cpp $(PYHEADERS) + @echo "Checking dependencies for $<" + $(Q) if [ ! -d "$(@D)" ]; then mkdir -p "$(@D)"; fi; + $(Q) $(SMILEICXX) $(CXXFLAGS) -MF"$@" -MM -MP -MT"$@ $(@:.d=.o)" $< ifeq ($(findstring icpc, $(COMPILER_INFO)), icpc)