pimp makefile

This commit is contained in:
tavo-wasd 2024-08-18 01:22:28 -06:00
parent 1ff85e982a
commit 59ea41ed74

View file

@ -1,12 +1,17 @@
BIN = builder
SRC = main.go
GOFILES = go.sum go.mod
GOMODS = github.com/joho/godotenv
all: ${BIN}
${BIN}: ${SRC}
${BIN}: ${SRC} ${GOFILES}
go build -o $@
${GOFILES}:
go mod init ${BIN}
go get ${GOMODS}
run: ${BIN}
@./$< &
@ -15,9 +20,7 @@ stop:
restart: stop run
bootstrap:
go mod init ${BIN}
go get ${GOMODS}
clean-all: clean clean-mods
clean:
rm -f ${BIN}