Skip to content

Commit

Permalink
makefile: fix shell tab-completions (#147)
Browse files Browse the repository at this point in the history
Shell tab-completions are currently broken due to the regeneration of
`make_config.mk` on every invocation, which also causes a make restart.

Prevent regeneration if the file exists and we're in an invocation that
doesn't execute rule recipes (-n or -q).
  • Loading branch information
isaac-io authored and Yuval-Ariel committed Nov 23, 2022
1 parent ba54c8e commit d2ad959
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,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.
Expand All @@ -249,6 +252,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

Expand Down

0 comments on commit d2ad959

Please sign in to comment.