commit 75ba094174a543da3bd4551f62a699e7394698d4
parent e9c985881595a6bfc0534870c9c3d54fd88b4ef1
Author: Sean Enck <sean@ttypty.com>
Date: Tue, 17 Jun 2025 21:04:52 -0400
switch back to makefile
Diffstat:
4 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/.build.yml b/.build.yml
@@ -1,9 +1,9 @@
image: alpine/edge
packages:
- - just
+ - make
- go
tasks:
- build: |
- cd lockbox && just
+ cd lockbox && make
- check: |
- cd lockbox && just check
+ cd lockbox && make check
diff --git a/Makefile b/Makefile
@@ -0,0 +1,28 @@
+GOFLAGS := -trimpath -buildmode=pie -mod=readonly -modcacherw -buildvcs=false
+TARGET := target
+VERISON := `git log -n 1 --format=%h`
+OBJECT := $(TARGET)/lb
+GOTEST := LOCKBOX_CONFIG_TOML=fake go test
+CMD := cmd/lb
+cmd := "cmd/lb"
+
+all: setup $(OBJECT)
+
+setup:
+ @test -d $(TARGET) || mkdir -p $(TARGET)
+
+$(OBJECT): go.* $(shell find . -type f -name "*.go" -o -name "*.txt" -o -name "*.sh")
+ go build $(GOFLAGS) -ldflags "$(LDFLAGS) -X main.version=$(VERSION)" -o "$(OBJECT)" $(CMD)/main.go
+
+unittest:
+ $(GOTEST) ./...
+
+check: unittest tests
+
+tests: $(OBJECT)
+ $(GOTEST) $(CMD)/main_test.go
+
+clean:
+ rm -f "$(OBJECT)"
+ find internal/ $(CMD) -type f -wholename "*testdata*" -delete
+ find internal/ $(CMD) -type d -empty -delete
diff --git a/README.md b/README.md
@@ -119,11 +119,9 @@ Setup the `.gitattributes` for the repository to include
## build
-Requires `just`
-
Clone this repository and:
```
-just
+make
```
-_run `just check` to run tests_
+_run `make check` to run tests_
diff --git a/justfile b/justfile
@@ -1,27 +0,0 @@
-goflags := "-trimpath -buildmode=pie -mod=readonly -modcacherw -buildvcs=false"
-target := "target"
-version := `git log -n 1 --format=%h`
-object := target / "lb"
-ldflags := env_var_or_default("LDFLAGS", "")
-gotest := "LOCKBOX_CONFIG_TOML=fake go test"
-files := `find . -type f -name "*.go" | tr '\n' ' '`
-cmd := "cmd/lb"
-
-default: build
-
-build:
- mkdir -p "{{target}}"
- go build {{goflags}} -ldflags "{{ldflags}} -X main.version={{version}}" -o "{{object}}" {{cmd}}/main.go
-
-unittest:
- {{gotest}} ./...
-
-check: unittest tests
-
-tests: build
- {{gotest}} {{cmd}}/main_test.go
-
-clean:
- rm -f "{{object}}"
- find internal/ {{cmd}} -type f -wholename "*testdata*" -delete
- find internal/ {{cmd}} -type d -empty -delete