From f3fe972025f1e904c119d0ca16b144d4729749aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 22 Feb 2021 11:45:20 +0100 Subject: [PATCH] GNUMakefile: use go build -trimpath To fix build with go.mod file present. This change also simplifies the entire build process significantly. --- GNUmakefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index cdc9e49..6bc5348 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,14 +5,8 @@ BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/share/man DOCDIR ?= $(PREFIX)/share/doc/$(NAME) -IMPORTPATH = src/github.com/nmeum/$(NAME) -export GOPATH = $(CURDIR) - -$(NAME): $(IMPORTPATH) - cd $< && env PWD="$(CURDIR)/$<" go build -o $@ -$(IMPORTPATH): $(GOPATH) - mkdir -p $(shell dirname $@) - ln -fs $< $@ +$(NAME): + go build -trimpath -o $@ install: $(NAME) $(NAME).1 README.md install -Dm755 $(NAME) "$(DESTDIR)$(BINDIR)/$(NAME)"