summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2022-09-13 21:00:21 +0700
committerShulhan <m.shulhan@gmail.com>2022-09-13 21:00:21 +0700
commitf9bfc4b0f1cb1fcea35baa0a7b512c103168876f (patch)
treed63fa15773c4ab3643e24609143cda96f9ade1d9 /Makefile
parente96ae32fe5061bac41b7a8c8ec4a460760261141 (diff)
downloadgolang-id-web-f9bfc4b0f1cb1fcea35baa0a7b512c103168876f.tar.xz
all: gabungkan script go:generate menjadi sub-perintah "embed"
Daripada memanggil "go generate", yang terpisah dengan program cmd/www-golangid, gabungkan mereka sehingga untuk menghasilkan berkas static.go tinggal memanggil perintah $ go run ./cmd/www-golangid embed
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 4ab855f..b33e2c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: clean all generate build build-deploy deploy
+.PHONY: clean all embed build build-deploy deploy
MACOS_SERVICE=local.golangid
PROGRAM_NAME=www-golangid
@@ -10,13 +10,13 @@ clean:
rm -f ./$(PROGRAM_NAME)
find ./content -name "*.html" -delete
-generate:
- go generate
+embed:
+ go run ./cmd/www-golangid embed
-build: generate
+build: embed
go build ./cmd/$(PROGRAM_NAME)
-install: generate
+install: embed
go install ./cmd/$(PROGRAM_NAME)
serve:
@@ -25,7 +25,7 @@ serve:
deploy: build-deploy
rsync --progress ./$(PROGRAM_NAME) www-golangid:/data/app/bin/
-build-deploy: generate
+build-deploy: embed
unset CGO_ENABLED; \
GOOS=linux GOARCH=amd64 go build ./cmd/$(PROGRAM_NAME)