backblaze-backup/Makefile

45 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2023-07-10 11:34:19 +02:00
BIN_DIR := ./bin
APP_NAME := backblaze-backup
2023-07-10 12:57:38 +02:00
MAIN := ./cmd/main.go
2023-07-10 11:34:19 +02:00
2023-07-10 12:43:51 +02:00
.PHONY: local_run
local_run:
go run ./cmd/main.go --dir "$(DIR)" --bucket "$(BUCKET)"
.PHONY: build_linux_amd64
build_linux_amd64:
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=linux GOARCH=amd64 go build -o $(BIN_DIR)/$(APP_NAME)_linux_amd64 $(MAIN)
.PHONY: build_linux_arm64
build_linux_arm64:
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=linux GOARCH=arm64 go build -o $(BIN_DIR)/$(APP_NAME)_linux_arm64 $(MAIN)
.PHONY: build_windows_amd64
build_windows_amd64:
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=windows GOARCH=amd64 go build -o $(BIN_DIR)/$(APP_NAME)_windows_amd64.exe $(MAIN)
.PHONY: build_windows_386
build_windows_386:
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=windows GOARCH=386 go build -o $(BIN_DIR)/$(APP_NAME)_windows_386.exe $(MAIN)
.PHONY: build_mac_amd64
build_mac_amd64:
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=darwin GOARCH=amd64 go build -o $(BIN_DIR)/$(APP_NAME)_mac_amd64 $(MAIN)
.PHONY: build_mac_arm64
build_mac_arm64:
2023-07-10 11:34:19 +02:00
@mkdir -p $(BIN_DIR)
2023-07-10 12:57:38 +02:00
GOOS=darwin GOARCH=arm64 go build -o $(BIN_DIR)/$(APP_NAME)_mac_arm64 $(MAIN)
2023-07-10 11:34:19 +02:00
.PHONY: clean
clean:
rm -rf $(BIN_DIR)
.PHONY: rebuild
rebuild: clean build_linux_amd64 build_linux_arm64 build_windows_amd64 build_windows_386 build_mac_amd64 build_mac_arm64