muraena/Makefile
2021-02-17 17:31:01 +01:00

35 lines
940 B
Makefile

BUILD ?= build
TARGET ?= muraena
PACKAGES ?= core log proxy session module module/crawler module/necrobrowser module/statichttp module/tracking
GO ?= go
all: build
# This will be triggered before any command, or when just calling $ make
pre:
mkdir -p $(BUILD)
# GO111MODULE is required only when inside GOPATH
env GO111MODULE=on go get -d ./
build: pre
$(GO) build -o $(BUILD)/$(TARGET) .
build_with_race_detector: pre
$(GO) build -race -o $(BUILD)/$(TARGET) .
buildall: pre
env GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -o $(BUILD)/macos/$(TARGET) .
env GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o $(BUILD)/linux/$(TARGET) .
env GO111MODULE=on GOOS=windows GOARCH=amd64 go build -o $(BUILD)/windows/$(TARGET).exe .
update:
go get -u
go mod tidy
lint: fmt
@git add . && git commit -a -m "Linting :star2:"
fmt:
gofmt -s -w $(PACKAGES)
.PHONY: all build build_with_race_detector lint fmt