11
22ROOT =../../..
33
4- VERSION ?= 2.0.0
4+ export VERSION ?= 2.0.0
55OSNICK ?= buster
66
77# ----------------------------------------------------------------------------------------------
88
99S3_URL =redismodules/tensorflow
1010
1111OS: =$(shell $(ROOT ) /opt/readies/bin/platform --os)
12- ifeq ($(OS ) ,macosx)
13- OS: =macos
12+
13+ ifeq ($(OS ) ,linux)
14+ OS.publish: =$(OS )
15+ ARCH.publish: =$(ARCH )
16+
17+ else ifeq ($(OS),macosx)
18+ OS.publish: =darwin
19+ ARCH.publish: =x86_64
1420endif
15- STEM =libtensorflowlite-$(OS )
21+
22+ STEM =libtensorflowlite-$(OS.publish )
1623
1724DOCKER_OS.bionic =ubuntu:bionic
1825DOCKER_OS.stretch =debian:stretch-slim
@@ -21,6 +28,8 @@ DOCKER_OS=$(DOCKER_OS.$(OSNICK))
2128
2229# ----------------------------------------------------------------------------------------------
2330
31+ ifeq ($(OS ) ,linux)
32+
2433define targets # (1=OP, 2=op)
2534$(1 ) _TARGETS :=
2635$(1 ) _TARGETS += $(if $(findstring $(X64 ) ,1) ,$(2 ) _x64)
@@ -30,6 +39,14 @@ $(1)_TARGETS += $(if $(findstring $(ARM8),1),$(2)_arm64v8)
3039$(1 ) _TARGETS += $$(if $$(strip $$($(1 ) _TARGETS) ) ,,$(2 ) _x64 $(2 ) _arm32v7 $(2 ) _arm64v8)
3140endef
3241
42+ else ifeq ($(OS),macosx)
43+
44+ define targets # (1=OP, 2=op)
45+ $(1 ) _TARGETS := $(2 ) _x64
46+ endef
47+
48+ endif
49+
3350$(eval $(call targets,BUILD,build))
3451$(eval $(call targets,PUBLISH,publish))
3552
@@ -95,12 +112,6 @@ $(error Please run 'aws configure' and provide it with access credentials)
95112endif
96113endif
97114
98- else ifeq ($(OS),macosx)
99-
100- build : ;
101-
102- endif # macosx
103-
104115publish : $(PUBLISH_TARGETS )
105116
106117$(eval $(call publish_x64,x64,x86_64))
@@ -110,4 +121,19 @@ $(eval $(call publish_arm,arm32v7,arm))
110121help :
111122 @echo " make [build|publish] [X64=1|ARM7=1|ARM8=1]"
112123
124+ else ifeq ($(OS),macosx)
125+
126+ build :
127+ @VERSION=$(VERSION ) ./build.macos
128+ @mv macos/dest/$(STEM ) -$(ARCH.publish ) -$(VERSION ) .tar.gz .
129+
130+ publish : $(PUBLISH_TARGETS )
131+
132+ $(eval $(call publish_x64,x64,x86_64))
133+
134+ help :
135+ @echo " make [build|publish]"
136+
137+ endif # macosx
138+
113139.PHONY : all build publish help
0 commit comments