Skip to content

Commit

Permalink
build: only build one of roach and roachccl
Browse files Browse the repository at this point in the history
roachccl depends on roach internally, so specifying them both from the
top-level Makefile is redundant.

Also introduce `libs` target for testing.

Release note: None
  • Loading branch information
jordanlewis committed Dec 28, 2017
1 parent 2159023 commit 03806d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,9 @@ LIBROACH_DIR := $(BUILD_DIR)/libroach
PROTOC_DIR := $(GOPATH)/native/$(HOST_TRIPLE)/protobuf
PROTOC := $(PROTOC_DIR)/protoc

C_LIBS_OSS = $(if $(USE_STDMALLOC),,libjemalloc) libprotobuf libsnappy librocksdb libroach
C_LIBS_CCL = $(C_LIBS_OSS) libcryptopp libroachccl
C_LIBS_COMMON = $(if $(USE_STDMALLOC),,libjemalloc) libprotobuf libsnappy librocksdb
C_LIBS_OSS = $(C_LIBS_COMMON) libroach
C_LIBS_CCL = $(C_LIBS_COMMON) libcryptopp libroachccl

# Go does not permit dashes in build tags. This is undocumented. Fun!
NATIVE_SPECIFIER_TAG := $(subst -,_,$(NATIVE_SPECIFIER))$(STDMALLOC_SUFFIX)
Expand Down Expand Up @@ -636,7 +637,7 @@ libroach: $(LIBROACH_DIR)/Makefile $(CPP_PROTOS_TARGET)
@$(MAKE) --no-print-directory -C $(LIBROACH_DIR) roach

.PHONY: libroachccl
libroachccl: $(LIBROACH_DIR)/Makefile $(CPP_PROTOS_CCL_TARGET) libroach
libroachccl: $(LIBROACH_DIR)/Makefile $(CPP_PROTOS_CCL_TARGET)
@$(MAKE) --no-print-directory -C $(LIBROACH_DIR) roachccl

PHONY: check-libroach
Expand Down Expand Up @@ -677,6 +678,9 @@ CPP_PROTOS_CCL_TARGET := $(LOCAL_BIN)/.cpp_ccl_protobuf_sources
.DEFAULT_GOAL := all
all: $(COCKROACH)

.PHONY: c-deps
c-deps: $(C_LIBS_CCL)

buildoss: BUILDTARGET = ./pkg/cmd/cockroach-oss
buildoss: $(C_LIBS_OSS) $(UI_ROOT)/distoss/bindata.go

Expand Down
1 change: 1 addition & 0 deletions build/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ define VALID_VARS
CXX_PATH
C_DEPS_DIR
C_LIBS_CCL
C_LIBS_COMMON
C_LIBS_OSS
DUPLFLAGS
ENABLE_ROCKSDB_ASSERTIONS
Expand Down

0 comments on commit 03806d0

Please sign in to comment.