Skip to content

Commit

Permalink
build: -
Browse files Browse the repository at this point in the history
  • Loading branch information
enenumxela committed Nov 27, 2023
1 parent cd5ad55 commit bc6fe83
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Executable

cmd/xcrawl3r/xcrawl3r

# Notes

notes.txt
bin
52 changes: 52 additions & 0 deletions Makefile
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) ./...

0 comments on commit bc6fe83

Please sign in to comment.