-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
39 lines (30 loc) · 871 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
TARGET = Yelaa
DYN_TARGET = DynYelaa
SRC = main.go
GROUP_ID = $$(id -g)
USER_ID = $$(id -u)
.PHONY: all
all: compile
.PHONY: help
help:
@echo "\033[34mYelaa targets:\033[0m"
@perl -nle'print $& if m{^[a-zA-Z_-\d]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}'
.PHONY: compile
compile: ## compile the project
@go build -o $(TARGET) $(SRC)
.PHONY: docker
docker: ## Builds a docker image from source
@docker build -t yelaa \
--build-arg USER_ID=$(USER_ID) \
--build-arg GROUP_ID=$(GROUP_ID) \
.
.PHONY: dynamic
dynamic: ## Builds a dynamically linked binary (if you really need to use Proxychains)
@./scripts/compile_dyn.sh
.PHONY: clean
clean: ## Cleans up the project
rm -f $(TARGET) $(DynYelaa)
.PHONY: tidy
tidy: ## runs tidy and formatting
@go mod tidy
@gofmt -s -w .