-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
build-and-run: | ||
make install_deps | ||
make build | ||
make run | ||
# Define variables | ||
GO_BUILD_FLAGS = -o bin/main | ||
|
||
# Define targets | ||
|
||
.PHONY: install_deps build run clean | ||
|
||
install_deps: | ||
go mod download | ||
@echo "Downloading dependencies..." | ||
@go mod download | ||
|
||
build: install_deps | ||
@echo "Building server..." | ||
@go build $(GO_BUILD_FLAGS) cmd/main/main.go | ||
|
||
run: build | ||
@echo "Running mail server" | ||
@./bin/main | ||
|
||
clean: | ||
@echo "Cleaning up...." | ||
@rm -rf bin/main | ||
|
||
build: | ||
go build -o bin/main cmd/main/main.go | ||
# Help target | ||
.PHONY: help | ||
|
||
run: | ||
go run ./cmd/main | ||
help: | ||
@echo "Available targets:" | ||
@grep -E '^.+:' Makefile |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters