Skip to content

Commit

Permalink
Refs fibercrypto#342, Adding granulated Os detection, fixing the dele…
Browse files Browse the repository at this point in the history
…tion of a symlink, in windows works strange
  • Loading branch information
stdevPavelmc committed Dec 13, 2019
1 parent 20d31b7 commit 54997cb
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ define is_version_correct
$(if $(shell echo $1 | egrep '^[0-9]+\.[0-9]+\.[0-9]+$$'),1,0)
endef

ifeq ($(TRAVIS),true)
OS_NAME=$(TRAVIS_OS_NAME)
else
ifeq ($(UNAME_S),Linux)
OS_NAME=linux
endif
ifeq ($(UNAME_S),Darwin)
OS_NAME=osx
endif
UNAME_W = $(shell uname -s | cut -d "_" -f1 )
ifeq ($(UNAME_W),MINGW64)
OS_NAME=windows
endif
endif

VERSION_IS_SEMANTIC_COMPLIANT = 0
ifeq ($(call is_version_correct,$(VERSION_FIRMWARE)),0)
VERSION_FIRMWARE = $(VERSION_FIRMWARE_RAW)
Expand All @@ -69,11 +84,12 @@ ID_PRODUCT=1
LANG=1
COMBINED_VERSION=v$(VERSION_BOOTLOADER)-v$(VERSION_FIRMWARE)-$(ID_VENDOR)-$(ID_PRODUCT)-$(LANG)

ifeq ($(UNAME_S), Darwin)
ifeq ($(OS_NAME), osx)
LD_VAR=DYLD_LIBRARY_PATH
else
LD_VAR=LD_LIBRARY_PATH
endif

check-version: ## Check that the tiny-firmware/VERSION match the current tag
@./ci-scripts/version.sh > tiny-firmware/VERSION
@if [ $$VERSION_IS_SEMANTIC_COMPLIANT -eq 1 ]; then git diff --exit-code tiny-firmware/VERSION; fi
Expand Down Expand Up @@ -106,7 +122,7 @@ build-deps: ## Build common dependencies (protob)
$(MAKE) -C tiny-firmware/protob/ build-c
# UNIX symbolic links don't supported by Windows, so the best way
# to use them is to create proper one in the begining of build
ifeq ($(OS),Windows_NT)
ifeq ($(OS_NAME), windows)
( cd ./tiny-firmware/vendor && rm skycoin-crypto)
( cd ./tiny-firmware/vendor && cmd /c 'mklink /d skycoin-crypto ..\..\skycoin-api\')
endif
Expand Down Expand Up @@ -287,7 +303,11 @@ clean-lib: ## Delete all files generated by tiny-firmware library dependencies

clean: bootloader-clean firmware-clean setup-libskycoin ## Delete all files generated by build
make -C tiny-firmware/vendor/libskycoin clean-libc
rm -fd ./tiny-firmware/vendor/libskycoin
ifeq ($(OS_NAME), windows)
rm -rdf ./tiny-firmware/vendor/libskycoin
else
rm -f ./tiny-firmware/vendor/libskycoin
endif
$(MAKE) -C skycoin-api/ clean
$(MAKE) -C tiny-firmware/emulator/ clean
$(MAKE) -C tiny-firmware/protob/ clean-c
Expand Down

0 comments on commit 54997cb

Please sign in to comment.