Skip to content

Commit

Permalink
make: remove redundant build flags and go version check (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Sep 20, 2024
1 parent 2488cbe commit bd22394
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 44 deletions.
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
BUILD_REQUIRE_GO_MAJOR ?= 1
BUILD_REQUIRE_GO_MINOR ?= 20

GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GO = go
GOBUILD = $(GO) build
GOTEST = $(GO) test

BINARY_NAME=crowdsec-cloudflare-bouncer
TARBALL_NAME=$(BINARY_NAME).tgz
Expand All @@ -19,7 +16,7 @@ LD_OPTS_VARS=\
-X 'github.com/crowdsecurity/go-cs-lib/version.Tag=$(BUILD_TAG)'

export CGO_ENABLED=0
export LD_OPTS=-ldflags "-a -s -w -extldflags '-static' $(LD_OPTS_VARS)" \
export LD_OPTS=-ldflags "-s -extldflags '-static' $(LD_OPTS_VARS)" \
-trimpath -tags netgo

.PHONY: all
Expand Down Expand Up @@ -55,7 +52,7 @@ clean: clean-release-dir clean-debian clean-rpm
#

.PHONY: binary
binary: goversion
binary:
$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)

.PHONY: build
Expand All @@ -80,7 +77,7 @@ export CF_TOKEN
export CF_ZONE_ID

.PHONY: test
test: goversion
test:
@$(GOTEST) $(LD_OPTS) ./...

.PHONY: func-tests
Expand All @@ -96,7 +93,7 @@ RELDIR = $(BINARY_NAME)-$(BUILD_VERSION)

.PHONY: vendor
vendor: vendor-remove
$(GOCMD) mod vendor
$(GO) mod vendor
tar czf vendor.tgz vendor
tar --create --auto-compress --file=$(RELDIR)-vendor.tar.xz vendor

Expand Down Expand Up @@ -134,7 +131,5 @@ release: clean tarball
#

.PHONY: platform-all
platform-all: goversion clean
platform-all: clean
python3 .github/release.py run-build $(BINARY_NAME)

include mk/goversion.mk
31 changes: 0 additions & 31 deletions mk/goversion.mk

This file was deleted.

0 comments on commit bd22394

Please sign in to comment.