From f41833681972c9276f8d548aa955237fbc5be5d0 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Fri, 3 Nov 2017 14:43:17 +0300 Subject: [PATCH] Fixed CORE-5654: Mixed intermediate build files for plugins examples --- builds/posix/Makefile.in | 4 ++-- builds/posix/Makefile.in.plugins_examples | 11 ++--------- builds/posix/make.rules | 4 ++++ builds/posix/make.shared.variables | 2 +- configure.ac | 10 +++++----- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index abb67158b0..70604e794d 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -270,7 +270,7 @@ cross2: $(MAKE) utilities $(MAKE) $(GPRE) $(MAKE) plugins - $(MAKE) -f Makefile.plugins_examples -C $(GEN_ROOT)/examples/ + $(MAKE) -f Makefile.plugins_examples $(MAKE) cross_rest #___________________________________________________________________________ @@ -590,7 +590,7 @@ $(QLI): $(QLI_Objects) $(COMMON_LIB) examples: include_generic $(MAKE) -f Makefile.examples -C $(GEN_ROOT)/examples/ - $(MAKE) -f Makefile.plugins_examples -C $(GEN_ROOT)/examples/ + $(MAKE) -f Makefile.plugins_examples message_file: $(FIREBIRD_MSG) diff --git a/builds/posix/Makefile.in.plugins_examples b/builds/posix/Makefile.in.plugins_examples index d7adcd3650..93fbfb17f0 100644 --- a/builds/posix/Makefile.in.plugins_examples +++ b/builds/posix/Makefile.in.plugins_examples @@ -28,7 +28,7 @@ # Adriano dos Santos Fernandes # -ROOT=$(shell cd ../..; pwd) +ROOT=$(shell cd ..; pwd) ifeq ($(IsDeveloper), Y) DefaultTarget := Debug @@ -50,19 +50,12 @@ include $(ROOT)/gen/make.shared.variables @SET_MAKE@ -# Override make.defaults -LINK_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,../$(PLUGIN_VERS)) - - .PHONY: all udrcpp_example dc_example kh_example crypt_app all: udrcpp_example dc_example kh_example crypt_app -UDR_Objects = $(call makeObjects,../examples/udr,Functions.cpp) \ - $(call makeObjects,../examples/udr,Procedures.cpp) \ - $(call makeObjects,../examples/udr,Triggers.cpp) - +UDR_Objects = $(call dirObjects,../examples/udr) UDR_Plugin = $(PLUGINS)/udr/$(LIB_PREFIX)udrcpp_example.$(SHRLIB_EXT) AllObjects = $(UDR_Objects) diff --git a/builds/posix/make.rules b/builds/posix/make.rules index 546bcaae04..6745d0f0ea 100644 --- a/builds/posix/make.rules +++ b/builds/posix/make.rules @@ -110,6 +110,10 @@ $(OBJ)/%.o: $(SRC_ROOT)/%.cpp $(CXX) $(WCXXFLAGS) -c $(firstword $<) -o $@ @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@) +$(OBJ)/%.o: $(ROOT)/%.cpp + $(CC) $(WCFLAGS) -c $(firstword $<) -o $@ + @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@) + .SUFFIXES: .epp .e # Rules for making resource files diff --git a/builds/posix/make.shared.variables b/builds/posix/make.shared.variables index 551d08b1ff..7ae11b4fef 100644 --- a/builds/posix/make.shared.variables +++ b/builds/posix/make.shared.variables @@ -1,6 +1,6 @@ # Helper functions doObjects= $(patsubst %.y,%.o,$(patsubst %.epp,%.o,$(patsubst %.c,%.o,$(1:.cpp=.o)))) -makeObjects= $(addprefix $(OBJ)/$(1)/,$(call doObjects,$2)) +makeObjects= $(addprefix $(OBJ)/$(patsubst ../%,%,$(1))/,$(call doObjects,$2)) dirFiles= $(sort $(notdir $(wildcard ../src/$(1)/*.cpp)) $(notdir $(wildcard ../src/$(1)/*.c)) \ $(notdir $(wildcard ../src/$(1)/*.epp)) $(notdir $(wildcard ../src/$(1)/*.y))) dirInPath= $(call makeObjects,$(1),$(call dirFiles,$(1))) diff --git a/configure.ac b/configure.ac index d7fe32a260..52020e3cca 100644 --- a/configure.ac +++ b/configure.ac @@ -1232,6 +1232,10 @@ dnl ### TEMP ### directories for generated .cpp, .o and .d by module name mkdir -p temp/\$fb_tgt/\$src_dir done + for src_dir in `ls -R -1 examples | grep : | tr -d : | tr "\n" " "`; do + mkdir -p temp/\$fb_tgt/\$src_dir + done + src/misc/writeBuildNum.sh createMakeVersion gen/Make.Version dnl # sql files for UDF declarations @@ -1240,10 +1244,6 @@ dnl # sql files for UDF declarations done done -for src_dir in `ls -R -1 examples | grep : | tr -d : | tr "\n" " "`; do - mkdir -p temp/\$src_dir -done - dnl # rebuild version header if needed ./src/misc/writeBuildNum.sh rebuildHeader @@ -1393,7 +1393,7 @@ gen/make.shared.variables:${MAKE_SRC_DIR}/make.shared.variables gen/make.shared.targets:${MAKE_SRC_DIR}/make.shared.targets gen/Makefile:${MAKE_SRC_DIR}/Makefile.in gen/examples/Makefile.examples:${MAKE_SRC_DIR}/Makefile.in.examples -gen/examples/Makefile.plugins_examples:${MAKE_SRC_DIR}/Makefile.in.plugins_examples +gen/Makefile.plugins_examples:${MAKE_SRC_DIR}/Makefile.in.plugins_examples gen/Makefile.install:builds/install/arch-specific/${INSTALL_PREFIX}/Makefile.in Makefile:Makefile.in )