turbo-editors/turbo-jspublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-js.git
git clone ssh://git@rickub.com/turbo-editors/turbo-js.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Makefile · 75 lines · 2.1 KBMakefile Blame HistoryRaw
📦 Turbo JS 91999d1 k33g 10h ago1BINARY := turbo-js
2BUILD_DIR := bin
3
4# The version the binary reports is stamped in by the linker, so that a release
5# cannot ship an About box still naming the previous one. git describe gives
6# the last tag, how far past it this is, and the commit; a checkout with no
7# tags, or no git at all, falls back to "devel".
8VERSION_PKG := rickub.com/turbo-editors/turbo-core/version
9VERSION := $(shell git describe --tags --dirty 2>/dev/null || echo devel)
10COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
11BUILT := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
12LDFLAGS := -X '$(VERSION_PKG).stamp=$(VERSION)' \
13 -X '$(VERSION_PKG).commit=$(COMMIT)' \
14 -X '$(VERSION_PKG).built=$(BUILT)'
15
16.DEFAULT_GOAL := help
17
18## help: list the available targets
19help:
20 @grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //'
21
22## test: run the whole test suite
23test:
24 go test ./...
25
26## test-verbose: run the whole test suite, naming every test
27test-verbose:
28 go test -v ./...
29
30## cover: run the tests and report statement coverage per package
31cover:
32 go test -cover ./...
33
34## build: compile the editor into bin/turbo-js, then check it reports its version
35build:
36 go build -ldflags "$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY) .
37 @scripts/check-version.sh $(BUILD_DIR)/$(BINARY) "$(VERSION)" "$(COMMIT)"
38
39## version: print the version this checkout would build
40version:
41 @echo "$(VERSION) ($(COMMIT))"
42
43## ldflags: print the linker flags a stamped build uses
44## (03-build-releases.sh reads this, so the stamp is defined once)
45ldflags:
46 @printf '%s\n' "$(LDFLAGS)"
47
48## install: build and install turbo-js where your shell can find it
49install:
50 @scripts/install.sh
51
52## uninstall: remove an installed turbo-js
53uninstall:
54 @scripts/install.sh --uninstall
55
56## run: build and start the editor (make run FILE=main.js)
57run: build
58 ./$(BUILD_DIR)/$(BINARY) $(FILE)
59
60## fmt: format every Go file in place
61fmt:
62 go fmt ./...
63
64## vet: run the standard Go static checks
65vet:
66 go vet ./...
67
68## check: format, vet and test — what to run before committing
69check: fmt vet test
70
71## clean: remove build artefacts
72clean:
73 rm -rf $(BUILD_DIR)
74
75.PHONY: help test test-verbose cover build version ldflags install uninstall run fmt vet check clean