burning.moe/justfile

36 lines
511 B
Makefile
Raw Permalink Normal View History

2024-03-06 18:09:26 -05:00
binary := "burningmoe"
build_dir := "bin"
cmd := "./cmd/web"
output := "." / build_dir / binary
# do the thing
default: run
# build binary
build:
2024-06-03 22:32:07 -04:00
go build -o {{ output }} {{ cmd }}
2024-03-06 18:09:26 -05:00
# run from source
run:
2024-06-03 22:32:07 -04:00
go run {{ cmd }}
2024-03-06 18:09:26 -05:00
# build 'n run
run-binary: build
2024-06-03 22:32:07 -04:00
exec {{ output }}
2024-03-06 18:09:26 -05:00
# run with args
run-args args:
2024-06-03 22:32:07 -04:00
go run {{ cmd }} {{ args }}
2024-03-06 18:09:26 -05:00
# install binary into $GOPATH
install:
2024-06-03 22:32:07 -04:00
go install {{ cmd }}
2024-03-06 18:09:26 -05:00
# clean up after yourself
clean:
2024-06-03 22:32:07 -04:00
rm {{ output }}
2024-03-06 18:09:26 -05:00
# run go tests
test:
2024-06-03 22:32:07 -04:00
go test ./...