-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (48 loc) · 1.52 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
SHELL = /bin/sh
.DEFAULT_GOAL := release
COMMIT_HASH := $(shell git rev-parse --short HEAD)
WIDGET_DIR := ./x-payment-widget
WEBUI_DIR := ./x-webui
build:
@mkdir -p bin && \
echo Building x-server for all architectures.
GOOS=linux GOARCH=arm go build -o bin/x-server-linux-arm; \
GOOS=linux GOARCH=arm64 go build -o bin/x-server-linux-arm64; \
GOOS=linux GOARCH=386 go build -o bin/x-server-linux-386; \
GOOS=linux GOARCH=amd64 go build -o bin/x-server-linux-amd64; \
GOOS=darwin GOARCH=amd64 go build -o bin/x-server-darwin-amd64; \
GOOS=darwin GOARCH=arm64 go build -o bin/x-server-darwin-arm64; \
build-local:
@mkdir -p bin && \
echo Building x-server for all currenct architecture.
go build -o bin/x-server; \
build-widget:
@cd x-payment-widget && \
echo Building payment widget. && \
yarn && \
yarn build
build-webui:
@cd x-webui && \
echo Building merchant web UI. && \
yarn && \
yarn build
clean:
@rm -rf bin
@rm -rf release
@rm -rf widget
@rm -rf webui
dev: build-widget build-webui
@mkdir -p ./widget
@mkdir -p ./webui
@cp -r ${WIDGET_DIR}/public/* ./widget
@cp -r ${WEBUI_DIR}/public/* ./webui
release: build-widget build-webui build
@mkdir -p release
@mkdir -p release/x-server-${COMMIT_HASH}
@mv bin/* release/x-server-${COMMIT_HASH}
@rmdir bin
@mkdir -p release/x-server-${COMMIT_HASH}/widget
@mkdir -p release/x-server-${COMMIT_HASH}/webui
@cp -r ${WIDGET_DIR}/public/* release/x-server-${COMMIT_HASH}/widget
@cp -r ${WEBUI_DIR}/public/* release/x-server-${COMMIT_HASH}/webui
release-docker: release