From 4499422308b9fdb7c93b10c51a828285cb614d34 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 5 Mar 2022 21:53:50 -0800 Subject: swig -go: fail test if "go build" fails --- Examples/Makefile.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Examples/Makefile.in') diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 67db611b7..5a1fa7188 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1472,6 +1472,10 @@ go: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod CGO_LDFLAGS="$(LDFLAGS) -lm"; \ export CGO_LDFLAGS; \ (cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)); \ + stat=$$?; \ + if test $$stat != 0; then \ + exit $$stat; \ + fi; \ if $(GOGCC); then \ cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \ fi; \ @@ -1480,6 +1484,10 @@ go: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod mkdir gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=) 2>/dev/null || true; \ cp $(GOPATHDIR)/* gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=)/; \ (cd gopath/$(GOMOD)/src/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme $(RUNME).go); \ + stat=$$?; \ + if test $$stat != 0; then \ + exit $$stat; \ + fi; \ cp gopath/$(GOMOD)/src/runme/runme $(RUNME); \ fi @@ -1523,6 +1531,10 @@ go_cpp: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod CGO_LDFLAGS="$(LDFLAGS) -lm"; \ export CGO_LDFLAGS; \ (cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)); \ + stat=$$?; \ + if test $$stat != 0; then \ + exit $$stat; \ + fi; \ if $(GOGCC); then \ cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \ fi; \ @@ -1531,6 +1543,10 @@ go_cpp: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod mkdir gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=) 2>/dev/null || true; \ cp $(GOPATHDIR)/* gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=)/; \ (cd gopath/$(GOMOD)/src/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme $(RUNME).go); \ + stat=$$?; \ + if test $$stat != 0; then \ + exit $$stat; \ + fi; \ cp gopath/$(GOMOD)/src/runme/runme $(RUNME); \ fi -- cgit v1.2.1