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 udi-speedb committed Dec 3, 2023
1 parent 7fd49ac commit b11a315
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 @@ -85,6 +85,9 @@ endif

$(info $$DEBUG_LEVEL is $(DEBUG_LEVEL), $$LIB_MODE is $(LIB_MODE))

# 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 @@ -101,6 +104,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 b11a315

Please sign in to comment.