diff --git a/Makefile b/Makefile index 43531409e..6f6ff2dd4 100644 --- a/Makefile +++ b/Makefile @@ -220,6 +220,9 @@ am__v_AR_1 = AM_LINK = $(AM_V_CCLD)$(CXX) -L. $(patsubst lib%.a, -l%, $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^)) $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS) AM_SHARE = $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$@ -L. $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^) $(EXEC_LDFLAGS) $(LDFLAGS) -o $@ +# Only regenerate make_config.mk if it doesn't exists or if we're invoked in a mode +# that executes target recipes (i.e. not -n or -q) +ifeq ($(and $(or $(findstring n,$(MAKEFLAGS)),$(findstring q,$(MAKEFLAGS))),$(wildcard make_config.mk)),) # Detect what platform we're building on. # Export some common variables that might have been passed as Make variables # instead of environment variables. @@ -236,6 +239,7 @@ dummy := $(shell (export ROCKSDB_ROOT="$(CURDIR)"; \ export ROCKSDB_CXX_STANDARD="$(ROCKSDB_CXX_STANDARD)"; \ export USE_FOLLY="$(USE_FOLLY)"; \ "$(CURDIR)/build_tools/build_detect_platform" "$(CURDIR)/make_config.mk")) +endif # this file is generated by the previous line to set build flags and sources include make_config.mk