-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (44 loc) · 1.05 KB
/
Makefile
File metadata and controls
53 lines (44 loc) · 1.05 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
# db-gen Makefile
# Build and publish db-gen for Windows and Linux
BINARY_NAME := db-gen
BUILD_DIR := build
# Detect OS and use appropriate build script
ifeq ($(OS),Windows_NT)
BUILD_SCRIPT = powershell -ExecutionPolicy Bypass -File build.ps1
else
BUILD_SCRIPT = ./build.sh
endif
# Default target
.PHONY: all
all: build
# Build for all platforms
.PHONY: build
build:
$(BUILD_SCRIPT) all
# Build for Windows (64-bit)
.PHONY: build-windows
build-windows:
$(BUILD_SCRIPT) windows
# Build for Linux (64-bit)
.PHONY: build-linux
build-linux:
$(BUILD_SCRIPT) linux
# Clean build artifacts
.PHONY: clean
clean:
$(BUILD_SCRIPT) clean
# Run tests
.PHONY: test
test:
go test -v ./...
# Help
.PHONY: help
help:
@echo "db-gen Makefile targets:"
@echo " make build - Build for Windows and Linux"
@echo " make build-windows - Build for Windows only"
@echo " make build-linux - Build for Linux only"
@echo " make clean - Remove build artifacts"
@echo " make test - Run tests"
@echo ""
@echo "Output directory: $(BUILD_DIR)/"