Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
chore: makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2026 committed Sep 23, 2023
1 parent 2b162cc commit b954fb0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
# Dependency directories (remove the comment below to include it)
# vendor/

# Do not touch this lines
talk.yaml

# Go workspace file
go.work
.idea
Expand All @@ -29,4 +26,10 @@ build+push.sh

#macOS
**/.DS_Store
web/html
web/html

# Project
build
## Do not touch this lines
talk.yaml

34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ENTRY = cmd/talk/talk.go
BINARY = talk

.PHONY: build
build:
go mod download
go build ${ENTRY}

.PHONY: test
test:
go test -v ./...

.PHONY: run
run:
make build
./${BINARY}

.PHONY: release
release:
go mod download
GOOS=linux GOARCH=amd64 go build -o build/${BINARY}-linux-amd64 ${ENTRY};
GOOS=darwin GOARCH=amd64 go build -o build/${BINARY}-darwin-amd64 ${ENTRY};
GOOS=windows GOARCH=amd64 go build -o build/${BINARY}-windows-amd64.exe ${ENTRY};
cd build; \
tar -zcvf ${BINARY}-linux-amd64.tar.gz ${BINARY}-linux-amd64; \
tar -zcvf ${BINARY}-darwin-amd64.tar.gz ${BINARY}-darwin-amd64; \
zip -r ${BINARY}-windows-amd64.exe.zip ${BINARY}-windows-amd64.exe;

.PHONY: clean
clean:
echo "Cleaning up..."
rm -f ${BINARY}
rm -rf build
go clean

0 comments on commit b954fb0

Please sign in to comment.