Skip to content

Commit

Permalink
🐛 fix Makefile: compatible with macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx authored and actions-user committed Aug 27, 2020
1 parent ab34ebc commit 51ce757
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ SWAP_TAG ?= latest
BINDIR ?= /usr/local/bin

UNAME := $(eval UNAME := $(shell uname))$(UNAME)

ifeq ($(UNAME),Linux)
CPU_INFO_FLAGS := $(eval CPU_INFO_FLAGS := $(shell cat /proc/cpuinfo | grep flags | cut -d " " -f 2- | head -1))$(CPU_INFO_FLAGS)
else
CPU_INFO_FLAGS := ""
endif

GIT_COMMIT := $(eval GIT_COMMIT := $(shell git rev-list -1 HEAD))$(GIT_COMMIT)

MAKELISTS := Makefile $(shell find Makefile.d -type f -regex ".*\.mk")
Expand Down Expand Up @@ -243,7 +249,6 @@ format: \
license \
update/goimports \
format/yaml
# format/docker

.PHONY: update/goimports
## run goimports for all go files
Expand Down Expand Up @@ -322,11 +327,16 @@ ngt/install: /usr/local/include/NGT/Capi.h
.PHONY: tensorflow/install
## install TensorFlow for C
tensorflow/install: /usr/local/lib/libtensorflow.so
ifeq ($(UNAME),Darwin)
/usr/local/lib/libtensorflow.so:
brew install libtensorflow@1
else
/usr/local/lib/libtensorflow.so:
curl -LO https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-$(TENSORFLOW_C_VERSION).tar.gz
tar -C /usr/local -xzf libtensorflow-cpu-linux-x86_64-$(TENSORFLOW_C_VERSION).tar.gz
rm -f libtensorflow-cpu-linux-x86_64-$(TENSORFLOW_C_VERSION).tar.gz
ldconfig
endif

.PHONY: lint
## run lints
Expand Down

0 comments on commit 51ce757

Please sign in to comment.