aboutsummaryrefslogtreecommitdiffstats
path: root/wireguard-go-bridge
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-31 02:49:59 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-31 02:49:59 +0100
commit3ed88cd858f6d56399cdfbd44038a0eb8c51402a (patch)
tree0a4e79b0cb7a955625f1fe4a65f41f1f15092b7d /wireguard-go-bridge
parentUI: More elegant copy-to-clipboard behavior (diff)
downloadwireguard-apple-3ed88cd858f6d56399cdfbd44038a0eb8c51402a.tar.xz
wireguard-apple-3ed88cd858f6d56399cdfbd44038a0eb8c51402a.zip
wireguard-go-bridge: handle errors in makefile
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wireguard-go-bridge')
-rw-r--r--wireguard-go-bridge/Makefile13
1 files changed, 5 insertions, 8 deletions
diff --git a/wireguard-go-bridge/Makefile b/wireguard-go-bridge/Makefile
index 330ef600..349977fa 100644
--- a/wireguard-go-bridge/Makefile
+++ b/wireguard-go-bridge/Makefile
@@ -40,21 +40,18 @@ $(BUILDDIR)/.prepared:
define libwg-go-a
$(BUILDDIR)/libwg-go-$(1).a: $(BUILDDIR)/.prepared
- cd "$(BUILDDIR)" && \
+ cd "$(BUILDDIR)" || exit $$$$?; \
export CC="$(CC_$(1))" \
CGO_CFLAGS="$(CGO_FLAGS_$(1))" \
CGO_LDFLAGS="$(CGO_FLAGS_$(1))" \
GOARCH="$(GOARCH_$(1))" \
GOPATH="$(BUILDDIR)/gopath"; \
- if ! go get -tags ios; then \
- ret=$$$$?; \
- chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; \
- rm -rf "$(BUILDDIR)/gopath/pkg/mod"; \
- exit $$$$ret; \
- fi; \
+ go get -tags ios || { ret=$$$$?; chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; rm -rf "$(BUILDDIR)/gopath/pkg/mod"; exit $$$$ret; }; \
chmod -fR +w "$(BUILDDIR)/gopath/pkg/mod"; \
go build -tags ios -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive; \
- rm -f "$(BUILDDIR)/libwg-go-$(1).h"
+ ret=$$$$?; \
+ rm -f "$(BUILDDIR)/libwg-go-$(1).h"; \
+ exit $$$$ret
endef
$(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH))))