chore(keycard): add USE_MOCKED_KEYCARD_LIB

Use of TEST_ENVIRONMENT variable is just adding confusion, since that
variable is supposed to be used at runtime and not build time.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-10-11 18:47:05 +02:00
parent 629d8b62b1
commit 55833dad2d
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 4 additions and 11 deletions

View File

@ -389,21 +389,14 @@ status-go-clean:
rm -f $(STATUSGO) rm -f $(STATUSGO)
STATUSKEYCARDGO := vendor/status-keycard-go/build/libkeycard/libkeycard.$(LIBSTATUS_EXT) STATUSKEYCARDGO := vendor/status-keycard-go/build/libkeycard/libkeycard.$(LIBSTATUS_EXT)
STATUSKEYCARDGO_LIBDIR := $(shell pwd)/$(shell dirname "$(STATUSKEYCARDGO)") export STATUSKEYCARDGO_LIBDIR := "$(shell pwd)/$(shell dirname "$(STATUSKEYCARDGO)")"
export STATUSKEYCARDGO_LIBDIR
STATUSKEYCARDGO_RULE := build-lib
ifeq ($(TEST_ENVIRONMENT),true)
STATUSKEYCARDGO_RULE := build-mocked-lib
else ifeq ($(TEST_ENVIRONMENT),1)
STATUSKEYCARDGO_RULE := build-mocked-lib
endif
status-keycard-go: $(STATUSKEYCARDGO) status-keycard-go: $(STATUSKEYCARDGO)
$(STATUSKEYCARDGO): | deps $(STATUSKEYCARDGO): | deps
echo -e $(BUILD_MSG) "status-keycard-go" echo -e $(BUILD_MSG) "status-keycard-go"
+ cd vendor/status-keycard-go && \ + $(MAKE) -C vendor/status-keycard-go \
$(MAKE) $(STATUSKEYCARDGO_RULE) $(STATUSKEYCARDGO_MAKE_PARAMS) $(HANDLE_OUTPUT) $(if $(filter 1 true,$(USE_MOCKED_KEYCARD_LIB)), build-mocked-lib, build-lib) \
$(STATUSKEYCARDGO_MAKE_PARAMS) $(HANDLE_OUTPUT)
QRCODEGEN := vendor/QR-Code-generator/c/libqrcodegen.a QRCODEGEN := vendor/QR-Code-generator/c/libqrcodegen.a