On 2018-04-05 07:50 +0000, Mike Leach wrote:
On 2018-03-22 02:59 +0000, Wookey wrote:
The .d problem:
My understanding is that because of the -MMD option the .d files should be built alongside the .o files as part of the compilation. Why might that not happen?
Not sure - that is my understanding too.
Not managed to reproduce this yet - but will revisit as soon as I get back from vacation (Mon 9th).
I had a proper peer at the entrails and eventually worked out how to reproduce this. It's the presence or otherwise of the decoder/build/linux/ref_trace_decode_lib/builddir build directory.
That needs to exist _before_ the first g++ command otherwise it fails, confusingly talking about the .d file it can't read, when really the problem is that it didn't _create_ it.
The fix is simple enough: add this dependency. This was an ommission from the rearangement of the dependcies in the sonames patch.
And it wasn't revealed (and thus much more obvious) because those two sub-builddirs weren't getting cleaned, so once they existed that source tree would always build.
This patch fixes both issues. Index: libopencsd-0.8.1/decoder/build/linux/rctdl_c_api_lib/makefile =================================================================== --- libopencsd-0.8.1.orig/decoder/build/linux/rctdl_c_api_lib/makefile +++ libopencsd-0.8.1/decoder/build/linux/rctdl_c_api_lib/makefile @@ -85,7 +85,7 @@ DEPS := $(OBJECTS:%.o=%.d) -include $(DEPS)
## object compile -$(BUILD_DIR)/%.o : %.cpp +$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR) $(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
@@ -96,6 +96,7 @@ clean: rm -f $(DEPS) rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so* + -rmdir $(BUILD_DIR)
#### install the necessary include files for the c-api library on linux install_inc: Index: libopencsd-0.8.1/decoder/build/linux/ref_trace_decode_lib/makefile =================================================================== --- libopencsd-0.8.1.orig/decoder/build/linux/ref_trace_decode_lib/makefile +++ libopencsd-0.8.1/decoder/build/linux/ref_trace_decode_lib/makefile @@ -144,7 +144,7 @@ DEPS := $(OBJECTS:%.o=%.d) -include $(DEPS)
## object compile -$(BUILD_DIR)/%.o : %.cpp +$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR) $(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
@@ -155,3 +155,4 @@ clean: rm -f $(DEPS) rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so* + -rmdir $(BUILD_DIR)
Wookey