forked from NextronSystems/thunderstorm-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (37 loc) · 1.41 KB
/
Makefile
File metadata and controls
42 lines (37 loc) · 1.41 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
# Thunderstorm Collector - Root Makefile
.PHONY: help
help:
@echo "Thunderstorm Collector - Release Build System"
@echo "============================================="
@echo ""
@echo "Available targets:"
@echo " make release - Build distribution packages (binary + config) and arrange scripts"
@echo " make clean - Remove all release artifacts"
@echo " make test - Run tests"
@echo " make help - Show this help menu"
@echo ""
@echo "Note: Use go/Makefile directly for more specific build options."
# Define version if not provided by the environment
VERSION ?= $(shell git describe --tags --always --dirty)
VERSION := ${VERSION:refs/tags/%=%}
.PHONY: release
release:
@mkdir -p release
@echo "Building release ${VERSION}"
@$(MAKE) --no-print-directory -C go release
@for f in go/dist/thunderstorm-collector*; do \
suffix=$${f##*thunderstorm-collector-}; \
cp "$$f" "release/thunderstorm-collector-${VERSION:v%=%}-$${suffix}"; done
@for f in scripts/thunderstorm-collector.* go/config.yml; do \
ext=$${f##*.}; if [ "$$ext" = "$$f" ]; then ext=''; else ext=".$$ext"; fi ; \
cp "$$f" "release/$$(basename $${f%$$ext})-${VERSION:v%=%}$${ext}"; done
@echo "Release artifacts placed in release/"
.PHONY: clean
clean: ## Remove all release artifacts
@echo "Cleaning release artifacts..."
@rm -rf release
@$(MAKE) --no-print-directory -C go clean
@echo "Clean complete."
.PHONY: test
test:
@$(MAKE) -C go test