My Current makefile looks like the following, and it build the targets correctly. But it fails to build the targets in one instance, that is when the length of the path to source files becomes too long. Therefore I want to collect all my source files in different folders into one single source directory and then do the make.
Any leads on how I can modify the following makefile to create a flat source directory and use the files in that directory to build using make
PROJ_DIR := ../SRC_DIR += $(PROJ_DIR)projectSRC_FILES += $(wildcard $(SRC_DIR)/*/source/*.cpp)OBJ_DIR := $(PROJ_DIR)TASKOBJ_FILES += $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))CXXFLAGS := --c++14CC_INCLUDE_PATH += -I$(PROJ_DIR)project/include.PHONY: all clean dirsall: $(OBJ_DIR) $(OBJ_FILES) "$(COMPILERBIN)"/cc.exe -rvn crackLib.a $(OBJ_FILES)clean: @rm -rf crackLib.a $(OBJ_DIR) $(FLAT_INC_DIR) # Build target for directory creation. Intermediate build files will be placed here.$(OBJ_DIR): mkdir -p $@$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp "$(COMPILERBIN)"/cc.exe $(CXXFLAGS) -c -o $@ $< $(CC_INCLUDE_PATH) $(OBJ_DIR)/%.o: $(TSM_SRC_DIR)/%.cpp"$(COMPILERBIN)"/cc.exe $(CXXFLAGS) -c -o $@ $< $(CC_INCLUDE_PATH) $(OBJ_DIR)/%.o: $(SL_SRC_DIR)/%.cpp"$(COMPILERBIN)"/cc.exe $(CXXFLAGS) -c -o $@ $< $(CC_INCLUDE_PATH) -include $(OBJ_FILES:.o=.d)