forked from zenon-network/go-zenon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 887 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PHONY: all clean znnd
GO ?= latest
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
endif
ifeq ($(detected_OS),Windows)
EXECUTABLE=libznn.dll
endif
ifeq ($(detected_OS),Darwin)
EXECUTABLE=libznn.dylib
endif
ifeq ($(detected_OS),Linux)
EXECUTABLE=libznn.so
endif
SERVERMAIN = $(shell pwd)/cmd/znnd
LIBMAIN = $(shell pwd)/cmd/libznn
BUILDDIR = $(shell pwd)/build
GIT_COMMIT=$(shell git rev-parse HEAD)
GIT_COMMIT_FILE=$(shell pwd)/metadata/git_commit.go
$(EXECUTABLE):
go build -o $(BUILDDIR)/$(EXECUTABLE) -buildmode=c-shared -tags libznn $(LIBMAIN)
libznn: $(EXECUTABLE) ## Build binaries
@echo "Build libznn done."
znnd:
go build -o $(BUILDDIR)/znnd $(SERVERMAIN)
@echo "Build znnd done."
@echo "Run \"$(BUILDDIR)/znnd\" to start znnd."
clean:
rm -r $(BUILDDIR)/
all: znnd libznn