-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
cd5ad55
commit bc6fe83
Showing
2 changed files
with
53 additions
and
5 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,7 +1,3 @@ | ||
# Executable | ||
|
||
cmd/xcrawl3r/xcrawl3r | ||
|
||
# Notes | ||
|
||
notes.txt | ||
bin |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Go(Golang) Options | ||
GOCMD=go | ||
GOMOD=$(GOCMD) mod | ||
GOGET=$(GOCMD) get | ||
GOFMT=$(GOCMD) fmt | ||
GOTEST=$(GOCMD) test | ||
GOBUILD=$(GOCMD) build | ||
GOINSTALL=$(GOCMD) install | ||
GOFLAGS := -v | ||
LDFLAGS := -s -w | ||
|
||
# Golangci Options | ||
GOLANGCILINTCMD=golangci-lint | ||
GOLANGCILINTRUN=$(GOLANGCILINTCMD) run | ||
|
||
ifneq ($(shell go env GOOS),darwin) | ||
LDFLAGS := -extldflags "-static" | ||
endif | ||
|
||
all: build | ||
|
||
.PHONY: tidy | ||
tidy: | ||
$(GOMOD) tidy | ||
|
||
.PHONY: update-deps | ||
update-deps: | ||
$(GOGET) -f -t -u ./... | ||
$(GOGET) -f -u ./... | ||
|
||
.PHONY: _gofmt | ||
_gofmt: | ||
$(GOFMT) ./... | ||
|
||
.PHONY: _golangci-lint | ||
_golangci-lint: | ||
$(GOLANGCILINTRUN) $(GOLANGCILINT) ./... | ||
|
||
.PHONY: lint | ||
lint: _gofmt _golangci-lint | ||
|
||
.PHONY: test | ||
test: | ||
$(GOTEST) $(GOFLAGS) ./... | ||
|
||
.PHONY: build | ||
build: | ||
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o bin/xcrawl3r cmd/xcrawl3r/main.go | ||
|
||
.PHONY: install | ||
install: | ||
$(GOINSTALL) $(GOFLAGS) ./... |