-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
40 lines (28 loc) · 1.31 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
SHELL := /bin/bash
BINARY_NAME ?= docxgo
BUILD_DIR ?= bin
COVERAGE_PROFILE ?= coverage.out
COVERAGE_HTML ?= coverage.html
DOTNET_ARTIFACTS ?= /tmp/docxgo-dotnet-artifacts
.PHONY: help test build install run coverage dotnet-build examples check clean
help: ## Show available targets
@awk 'BEGIN {FS = ":.*## "; printf "Available targets:\n"} /^[a-zA-Z0-9_-]+:.*## / {printf " %-14s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
test: ## Run all Go tests
go test ./...
build: ## Build the docxgo CLI into bin/
mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/docxgo
install: ## Install the docxgo CLI into GOPATH/bin
go install ./cmd/docxgo
run: ## Run the docxgo CLI from source, for example: make run ARGS="version"
go run ./cmd/docxgo $(ARGS)
coverage: ## Generate Go coverage profile and HTML report
go test -coverprofile=$(COVERAGE_PROFILE) ./...
go tool cover -html=$(COVERAGE_PROFILE) -o $(COVERAGE_HTML)
dotnet-build: ## Build the Open XML validator
dotnet build DocxValidator/DocxValidator.csproj --artifacts-path $(DOTNET_ARTIFACTS)
examples: ## Run example programs and optional Open XML validation
./examples/run_all_examples.sh
check: test build dotnet-build ## Run the core validation suite
clean: ## Remove local build and coverage artifacts
rm -rf $(BUILD_DIR) $(COVERAGE_PROFILE) $(COVERAGE_HTML)