forked from instructor-ai/instructor-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 816 Bytes
/
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
# Set default target
.DEFAULT_GOAL := build
# Define variables
BINARY_NAME := instructor
BINARY_DIR := bin
GO_SOURCES := $(shell find . -name '*.go')
GO_LINT_TOOLS := golangci-lint
# Build target
build: $(GO_SOURCES)
mkdir -p $(BINARY_DIR)
go build -o $(BINARY_DIR)/$(BINARY_NAME)
# Clean target
.PHONY: clean
clean:
rm -rf $(BINARY_DIR)
# Format target
.PHONY: fmt
fmt:
go fmt ./...
# Lint target
.PHONY: lint
lint:
$(GO_LINT_TOOLS) run
# Test target
.PHONY: test
test:
go test ./...
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " build Build the binary (default)"
@echo " clean Remove the binary"
@echo " fmt Format the source code"
@echo " lint Run linter checks"
@echo " test Run tests"
@echo " help Show this help message"