-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1 KB
/
Copy pathMakefile
File metadata and controls
47 lines (38 loc) · 1 KB
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
42
43
44
45
46
47
# init command params
GO := go
OS_NAME := linux
NATIVE_LIB := awesome.so
ifeq ($(OS),Windows_NT)
OS_NAME = win32
NATIVE_LIB = awesome.dll
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS_NAME = linux
NATIVE_LIB = libawesome.so
endif
ifeq ($(UNAME_S),Darwin)
OS_NAME = darwin
NATIVE_LIB = libawesome.dylib
endif
endif
# env
export GO111MODULE := on
build-go: ## build go shared library
cd go && $(GO) build -ldflags="-w -s" -o $(NATIVE_LIB) -buildmode=c-shared awesome.go
cp go/$(NATIVE_LIB) src/main/resources/$(OS_NAME)-x86-64
build: ## build jar
make build-go
mvn clean package assembly:single
test: ## test
make build-go
mvn clean test -Djna.debug_load=true
clean: ## go clean && rm build output
rm -f awesome.so
mvn clean
cd go && $(GO) clean
help: ## show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: build clean test help
## default target
.DEFAULT_GOAL := help