Skip to content

Commit

Permalink
fix: makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
qfdk committed Apr 15, 2022
1 parent 1cc3311 commit 9e32538
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,5 @@ tmp/
/nginx-proxy-manager
/data.db
/nginx-proxy-manager.pid

dist/
23 changes: 22 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,34 @@ LDFLAGS=-ldflags "-X ${CONFIG_PATH}.BuildName=${BUILD_NAME} \
-X '${CONFIG_PATH}.GoVersion=${GoVersion}' \
-X ${CONFIG_PATH}.BuildVersion=${BUILD_VERSION}"

.PHONY: build clean help
.PHONY: build clean release help

all: clean build

build:
go build ${LDFLAGS} -v .


release:
# Clean
go clean
rm -rf dist
mkdir dist
rm -rf *.gz
# Build for mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -v .
tar czvf ${BUILD_NAME}-darwin-amd64-${BUILD_VERSION}.tar.gz ./${BUILD_NAME}
# Build for mac arm64
go clean
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build ${LDFLAGS} -v .
tar czvf ${BUILD_NAME}-darwin-arm64-${BUILD_VERSION}.tar.gz ./${BUILD_NAME}
# Build for linux
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -v .
tar czvf ${BUILD_NAME}-linux64-${BUILD_VERSION}.tar.gz ./${BUILD_NAME}
go clean
mv *.gz dist

clean:
rm -rf nginx-proxy-manager
go clean -i .
Expand Down

0 comments on commit 9e32538

Please sign in to comment.