Skip to content

Commit

Permalink
feat: Add Makefile to project
Browse files Browse the repository at this point in the history
Add a makefile to the project to support the following operations:

- build
- install
- clean
- deps
- watch
- help

Update the README to use the Makefile command as well and move from
using `go build` to `go install` in the Makefile.
  • Loading branch information
awalvie committed Dec 13, 2023
1 parent 64f8936 commit e185302
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
NAME=slick
VERSION=0.0.1

.DEFAULT_GOAL := help

.PHONY: build
## build: Compile the packages.
build:
@go build -v -o bin/$(NAME) cmd/$(NAME)/main.go

.PHONY: install
## install: Install the packages.
install: build
@mv bin/$(NAME) $(GOPATH)/bin/$(NAME)

.PHONY: clean
## clean: Clean projects and previous builds
clean:
@rm -rf bin/*

.PHONY: deps
## deps: Download modules
deps:
@go mod download

.PHONY: watch
## watch: Reload the app whenever the source changes
watch:
@which reflex > /dev/null || (go install github.com/cespare/reflex@latest)
reflex -s -r '\.go$$' make run

.PHONY: help
all: help
## help: show this help message
help: Makefile
@echo
@echo " Choose a command to run:"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ To start using Slick Deploy, install it right from the source:
```bash
git clone https://github.com/scmmishra/slick-deploy.git
cd slick-deploy
go build -o slick ./cmd/slick
make install
```

You can now move the slick binary to a directory in your PATH to make it globally accessible.

### Usage

To deploy an application:
Expand Down

0 comments on commit e185302

Please sign in to comment.