From d7f95dc97dc395cacc5aed65735546effd7a033d Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sun, 8 Aug 2021 00:18:56 -0400 Subject: [PATCH 1/2] Various changes and fixes - Remove GOFLAGS variable; it's not needed - Make GOFLAGS variable first on all Go related functions Signed-off-by: TheRealKeto --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b321e544..2d4fca54 100644 --- a/Makefile +++ b/Makefile @@ -2,15 +2,14 @@ TARGET ?= bettercap PACKAGES ?= core firewall log modules network packets session tls PREFIX ?= /usr/local GO ?= go -GOFLAGS ?= all: build build: resources - $(GO) $(GOFLAGS) build -o $(TARGET) . + $(GOFLAGS) $(GO) build -o $(TARGET) . build_with_race_detector: resources - $(GO) $(GOFLAGS) build -race -o $(TARGET) . + $(GOFLAGS) $(GO) build -race -o $(TARGET) . resources: network/manuf.go @@ -25,13 +24,13 @@ docker: @docker build -t bettercap:latest . test: - $(GO) $(GOFLAGS) test -covermode=atomic -coverprofile=cover.out ./... + $(GOFLAGS) $(GO) test -covermode=atomic -coverprofile=cover.out ./... html_coverage: test - $(GO) $(GOFLAGS) tool cover -html=cover.out -o cover.out.html + $(GOFLAGS) $(GO) tool cover -html=cover.out -o cover.out.html benchmark: server_deps - $(GO) $(GOFLAGS) test -v -run=doNotRunTests -bench=. -benchmem ./... + $(GOFLAGS) $(GO) test -v -run=doNotRunTests -bench=. -benchmem ./... fmt: $(GO) fmt -s -w $(PACKAGES) @@ -40,4 +39,4 @@ clean: $(RM) $(TARGET) $(RM) -r build -.PHONY: all build build_with_race_detector resources install docker test html_coverage benchmark fmt clean \ No newline at end of file +.PHONY: all build build_with_race_detector resources install docker test html_coverage benchmark fmt clean From c78a67d43915ad0ac70ebe764a5d2e1b4e93d943 Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sun, 8 Aug 2021 00:19:47 -0400 Subject: [PATCH 2/2] Add DESTDIR variable Signed-off-by: TheRealKeto --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2d4fca54..65a2e917 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ network/manuf.go: @python3 ./network/make_manuf.py install: - @mkdir -p $(PREFIX)/share/bettercap/caplets - @cp bettercap $(PREFIX)/bin/ + @mkdir -p $(DESTDIR)$(PREFIX)/share/bettercap/caplets + @cp bettercap $(DESTDIR)$(PREFIX)/bin/ docker: @docker build -t bettercap:latest .