22EXECUTABLE := device-cli
33GOFILES := $(shell find . -type f -name "* .go")
44TAGS ?=
5- TEMPL_VERSION ?= latest
65
76ifneq ($(shell uname) , Darwin)
87 EXTLDFLAGS = -extldflags "-static" $(null)
@@ -19,7 +18,7 @@ COMMIT ?= $(shell git rev-parse --short HEAD)
1918
2019LDFLAGS ?=
2120# # build: build the authgate binary
22- build : generate $(EXECUTABLE )
21+ build : $(EXECUTABLE )
2322
2423$(EXECUTABLE ) : $(GOFILES )
2524 $(GO ) build -v -tags ' $(TAGS)' -ldflags ' $(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@ .
@@ -39,7 +38,7 @@ install: $(GOFILES)
3938 $(GO ) install -v -tags ' $(TAGS)' -ldflags ' $(EXTLDFLAGS)-s -w $(LDFLAGS)'
4039
4140# # test: run tests
42- test : generate
41+ test :
4342 @$(GO ) test -v -cover -coverprofile coverage.txt ./... && echo " \n==>\033[32m Ok\033[m\n" || exit 1
4443
4544# # coverage: view test coverage in browser
@@ -59,39 +58,26 @@ lint: install-golangci-lint
5958 golangci-lint run
6059
6160# # build_linux_amd64: build the authgate binary for linux amd64
62- build_linux_amd64 : generate
61+ build_linux_amd64 :
6362 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO ) build -a -tags ' $(TAGS)' -ldflags ' $(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/amd64/$(EXECUTABLE ) .
6463
6564# # build_linux_arm64: build the authgate binary for linux arm64
66- build_linux_arm64 : generate
65+ build_linux_arm64 :
6766 CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO ) build -a -tags ' $(TAGS)' -ldflags ' $(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm64/$(EXECUTABLE ) .
6867
6968# # clean: remove build artifacts and test coverage
7069clean :
7170 rm -rf bin/ release/ coverage.txt
72- find internal/templates -name " *_templ.go" -delete
7371
7472# # rebuild: clean and build
7573rebuild : clean build
7674
7775.PHONY : help build install test coverage fmt lint clean rebuild
7876.PHONY : build_linux_amd64 build_linux_arm64
79- .PHONY : install-templ generate watch air dev
77+ .PHONY : air dev
8078.PHONY : install-golangci-lint mod-download mod-tidy mod-verify check-tools version
8179.PHONY : docker-build docker-run
8280
83- # # install-templ: install templ CLI if not installed
84- install-templ :
85- @command -v templ > /dev/null 2>&1 || $(GO ) install github.com/a-h/templ/cmd/templ@$(TEMPL_VERSION )
86-
87- # # generate: run templ generate to compile .templ files
88- generate : install-templ
89- templ generate
90-
91- # # watch: watch mode for automatic regeneration
92- watch : install-templ
93- templ generate --watch
94-
9581# # help: print this help message
9682help :
9783 @echo ' Usage:'
@@ -112,7 +98,6 @@ mod-verify:
11298# # check-tools: verify required tools are installed
11399check-tools :
114100 @command -v $(GO ) > /dev/null 2>&1 || (echo " Go not found" && exit 1)
115- @command -v templ > /dev/null 2>&1 || echo " templ not installed (run: make install-templ)"
116101 @command -v golangci-lint > /dev/null 2>&1 || echo " golangci-lint not installed (run: make install-golangci-lint)"
117102
118103# # version: display version information
0 commit comments