This repository was archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (52 loc) · 1.61 KB
/
Copy pathMakefile
File metadata and controls
60 lines (52 loc) · 1.61 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
48
49
50
51
52
53
54
55
56
57
58
59
60
BUILD_DIR = ./bin
APP_NAME = "TimeFarmBot"
build: build-windows-arm build-windows-amd64 build-linux-arm build-linux-amd64
@mkdir "$(BUILD_DIR)/configs"
@touch "$(BUILD_DIR)/configs/query.conf"
build-windows-arm:
@GOOS=windows GOARCH=arm go build -o $(BUILD_DIR)/$(APP_NAME)-windows-arm.exe
build-windows-amd64:
@GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(APP_NAME)-windows-x86_64.exe
build-linux-arm:
@GOOS=linux GOARCH=arm go build -o $(BUILD_DIR)/$(APP_NAME)-linux-arm
build-linux-amd64:
@GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(APP_NAME)-linux-x86_64
clean:
@rm -rf $(BUILD_DIR)
#
#run: build
# @./bin/blumbot
run: build
@sh -c '\
OS=$$(uname -s | tr A-Z a-z); \
ARCH=$$(uname -m); \
case "$${OS}" in \
linux) \
case "$${ARCH}" in \
x86_64) \
echo "Running Linux AMD64 binary..."; \
$(BUILD_DIR)/$(APP_NAME)-linux-x86_64 ;; \
arm*|aarch64) \
echo "Running Linux ARM binary..."; \
$(BUILD_DIR)/$(APP_NAME)-linux-arm ;; \
esac ;; \
darwin) \
case "$${ARCH}" in \
x86_64) \
echo "Running macOS AMD64 binary..."; \
$(BUILD_DIR)/$(APP_NAME)-darwin-x86_64 ;; \
arm*|aarch64) \
echo "Running macOS ARM binary..."; \
$(BUILD_DIR)/$(APP_NAME)-darwin-arm ;; \
esac ;; \
msys*|cygwin*|mingw*) \
case "$${ARCH}" in \
x86_64) \
echo "Running Windows AMD64 binary..."; \
$(BUILD_DIR)/$(APP_NAME)-windows-x86_64.exe ;; \
arm*|aarch64) \
echo "Running Windows ARM binary..."; \
$(BUILD_DIR)/$(APP_NAME)-windows-arm.exe ;; \
esac ;; \
*) echo "Unsupported OS: $${OS}" ;; \
esac'