111
|
1 # Makefile for gotools
|
|
2 # Copyright (C) 2015-2016 Free Software Foundation, Inc.
|
|
3 #
|
|
4 # This file is free software; you can redistribute it and/or modify
|
|
5 # it under the terms of the GNU General Public License as published by
|
|
6 # the Free Software Foundation; either version 3 of the License, or
|
|
7 # (at your option) any later version.
|
|
8 #
|
|
9 # This program is distributed in the hope that it will be useful,
|
|
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 # GNU General Public License for more details.
|
|
13 #
|
|
14 # You should have received a copy of the GNU General Public License
|
|
15 # along with this program; see the file COPYING3. If not see
|
|
16 # <http://www.gnu.org/licenses/>.
|
|
17
|
|
18 ACLOCAL_AMFLAGS = -I ./config -I ../config
|
|
19
|
|
20 gcc_version := $(shell $(GCC_FOR_TARGET) -dumpversion)
|
|
21
|
|
22 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
|
|
23
|
|
24 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
|
|
25 PWD_COMMAND = $${PWDCMD-pwd}
|
|
26 STAMP = echo timestamp >
|
|
27
|
|
28 libgodir = ../$(target_noncanonical)/libgo
|
|
29 LIBGODEP = $(libgodir)/libgo.la
|
|
30
|
|
31 LIBGOTOOL = $(libgodir)/libgotool.a
|
|
32
|
|
33 if NATIVE
|
|
34 # Use the compiler we just built.
|
|
35 GOCOMPILER = $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET)
|
|
36 else
|
|
37 GOCOMPILER = $(GOC)
|
|
38 endif
|
|
39
|
|
40 GOCFLAGS = $(CFLAGS_FOR_TARGET)
|
|
41 GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
|
|
42
|
|
43 AM_GOCFLAGS = -I $(libgodir)
|
|
44 AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
|
|
45 GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
|
|
46
|
|
47 libgosrcdir = $(srcdir)/../libgo/go
|
|
48 cmdsrcdir = $(libgosrcdir)/cmd
|
|
49 libgomiscdir = $(srcdir)/../libgo/misc
|
|
50
|
|
51 go_cmd_go_files = \
|
|
52 $(cmdsrcdir)/go/alldocs.go \
|
|
53 $(cmdsrcdir)/go/go11.go \
|
|
54 $(cmdsrcdir)/go/main.go
|
|
55
|
|
56 go_cmd_gofmt_files = \
|
|
57 $(cmdsrcdir)/gofmt/doc.go \
|
|
58 $(cmdsrcdir)/gofmt/gofmt.go \
|
|
59 $(cmdsrcdir)/gofmt/internal.go \
|
|
60 $(cmdsrcdir)/gofmt/rewrite.go \
|
|
61 $(cmdsrcdir)/gofmt/simplify.go
|
|
62
|
|
63 go_cmd_cgo_files = \
|
|
64 $(cmdsrcdir)/cgo/ast.go \
|
|
65 $(cmdsrcdir)/cgo/doc.go \
|
|
66 $(cmdsrcdir)/cgo/gcc.go \
|
|
67 $(cmdsrcdir)/cgo/godefs.go \
|
|
68 $(cmdsrcdir)/cgo/main.go \
|
|
69 $(cmdsrcdir)/cgo/out.go \
|
|
70 $(cmdsrcdir)/cgo/util.go
|
|
71
|
131
|
72 go_cmd_vet_files = \
|
|
73 $(cmdsrcdir)/vet/asmdecl.go \
|
|
74 $(cmdsrcdir)/vet/assign.go \
|
|
75 $(cmdsrcdir)/vet/atomic.go \
|
|
76 $(cmdsrcdir)/vet/bool.go \
|
|
77 $(cmdsrcdir)/vet/buildtag.go \
|
|
78 $(cmdsrcdir)/vet/cgo.go \
|
|
79 $(cmdsrcdir)/vet/composite.go \
|
|
80 $(cmdsrcdir)/vet/copylock.go \
|
|
81 $(cmdsrcdir)/vet/deadcode.go \
|
|
82 $(cmdsrcdir)/vet/dead.go \
|
|
83 $(cmdsrcdir)/vet/doc.go \
|
|
84 $(cmdsrcdir)/vet/httpresponse.go \
|
|
85 $(cmdsrcdir)/vet/lostcancel.go \
|
|
86 $(cmdsrcdir)/vet/main.go \
|
|
87 $(cmdsrcdir)/vet/method.go \
|
|
88 $(cmdsrcdir)/vet/nilfunc.go \
|
|
89 $(cmdsrcdir)/vet/print.go \
|
|
90 $(cmdsrcdir)/vet/rangeloop.go \
|
|
91 $(cmdsrcdir)/vet/shadow.go \
|
|
92 $(cmdsrcdir)/vet/shift.go \
|
|
93 $(cmdsrcdir)/vet/structtag.go \
|
|
94 $(cmdsrcdir)/vet/tests.go \
|
|
95 $(cmdsrcdir)/vet/types.go \
|
|
96 $(cmdsrcdir)/vet/unsafeptr.go \
|
|
97 $(cmdsrcdir)/vet/unused.go
|
|
98
|
|
99 go_cmd_buildid_files = \
|
|
100 $(cmdsrcdir)/buildid/buildid.go \
|
|
101 $(cmdsrcdir)/buildid/doc.go
|
|
102
|
|
103 go_cmd_test2json_files = \
|
|
104 $(cmdsrcdir)/test2json/main.go
|
|
105
|
111
|
106 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
|
|
107 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
|
|
108 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
|
|
109
|
|
110 zdefaultcc.go: s-zdefaultcc; @true
|
|
111 s-zdefaultcc: Makefile
|
|
112 echo 'package main' > zdefaultcc.go.tmp
|
131
|
113 echo 'func defaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
|
|
114 echo 'func defaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
|
|
115 echo 'func defaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
|
111
|
116 echo 'const defaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
|
|
117 $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
|
|
118 $(STAMP) $@
|
|
119
|
|
120 MOSTLYCLEANFILES = \
|
|
121 zdefaultcc.go s-zdefaultcc \
|
|
122 check-gccgo check-gcc gotools.head *-testlog gotools.sum gotools.log \
|
|
123 *.sent
|
|
124
|
|
125 mostlyclean-local:
|
131
|
126 -chmod -R u+w check-go-dir
|
111
|
127 rm -rf check-go-dir check-runtime-dir cgo-test-dir carchive-test-dir
|
|
128
|
|
129 if NATIVE
|
|
130
|
|
131 # For a native build we build the programs using the newly built libgo
|
|
132 # and install them as regular programs.
|
|
133
|
|
134 bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT)
|
131
|
135 noinst_PROGRAMS = cgo$(EXEEXT) vet$(EXEEXT) buildid$(EXEEXT) test2json$(EXEEXT)
|
111
|
136 man_MANS = go.1 gofmt.1
|
|
137
|
|
138 go$(EXEEXT): $(go_cmd_go_files) $(LIBGOTOOL) $(LIBGODEP)
|
|
139 $(GOLINK) $(go_cmd_go_files) $(LIBGOTOOL) $(LIBS) $(NET_LIBS)
|
|
140 gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP)
|
|
141 $(GOLINK) $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS)
|
131
|
142 cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGOTOOL) $(LIBGODEP)
|
|
143 $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBGOTOOL) $(LIBS) $(NET_LIBS)
|
|
144 vet$(EXEEXT): $(go_cmd_vet_files) $(LIBGOTOOL) $(LIBGODEP)
|
|
145 $(GOLINK) $(go_cmd_vet_files) $(LIBGOTOOL) $(LIBS) $(NET_LIBS)
|
|
146 buildid$(EXEEXT): $(go_cmd_buildid_files) $(LIBGOTOOL) $(LIBGODEP)
|
|
147 $(GOLINK) $(go_cmd_buildid_files) $(LIBGOTOOL) $(LIBS) $(NET_LIBS)
|
|
148 test2json$(EXEEXT): $(go_cmd_test2json_files) $(LIBGOTOOL) $(LIBGODEP)
|
|
149 $(GOLINK) $(go_cmd_test2json_files) $(LIBGOTOOL) $(LIBS) $(NET_LIBS)
|
111
|
150
|
131
|
151 install-exec-local: $(noinst_PROGRAMS)
|
111
|
152 $(MKDIR_P) $(DESTDIR)$(libexecsubdir)
|
131
|
153 for f in $(noinst_PROGRAMS); do \
|
|
154 rm -f $(DESTDIR)$(libexecsubdir)/$$f; \
|
|
155 $(INSTALL_PROGRAM) $$f $(DESTDIR)$(libexecsubdir)/$$f; \
|
|
156 done
|
111
|
157
|
|
158 uninstall-local:
|
131
|
159 for f in $(noinst_PROGRAMS); do \
|
|
160 rm -f $(DESTDIR)$(libexecsubdir)/$$f; \
|
|
161 done
|
111
|
162
|
|
163 GOTESTFLAGS =
|
|
164
|
131
|
165 # Number of seconds before tests time out.
|
|
166 GOTOOLS_TEST_TIMEOUT = 480
|
|
167
|
111
|
168 # Run tests using the go tool, and frob the output to look like that
|
|
169 # generated by DejaGNU. The main output of this is two files:
|
|
170 # gotools.sum and gotools.log.
|
|
171
|
|
172 # check-head starts generating the log files in DejaGNU format. This
|
|
173 # is a separate target so that the date is approximately when we start
|
|
174 # running the tests.
|
|
175 check-head:
|
|
176 @echo "Test Run By $${USER} on `date`" > gotools.head
|
|
177 @echo "Native configuration is $(host_triplet)" >> gotools.head
|
|
178 @echo >> gotools.head
|
|
179 @echo " === gotools tests ===" >> gotools.head
|
|
180 @echo >> gotools.head
|
|
181
|
|
182 # check-gccgo is a little shell script that executes gccgo with the
|
131
|
183 # options to pick up the newly built libgo and libstdc++.
|
111
|
184 check-gccgo: Makefile
|
|
185 rm -f $@ $@.tmp
|
|
186 echo "#!/bin/sh" > $@.tmp
|
|
187 abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
131
|
188 echo "$(GOCOMPILE)" '"$$@"' "-I $${abs_libgodir} -L $${abs_libgodir} -L $${abs_libgodir}/.libs -B$${abs_libgodir}/../libstdc++-v3/src/.libs -B$${abs_libgodir}/../libstdc++-v3/libsupc++/.libs" >> $@.tmp
|
111
|
189 chmod +x $@.tmp
|
|
190 mv -f $@.tmp $@
|
|
191
|
|
192 # check-gcc is a little shell script that executes the newly built gcc
|
131
|
193 # with the options to pick up the newly built libgo and libstdc++.
|
111
|
194 check-gcc: Makefile
|
|
195 rm -f $@ $@.tmp
|
|
196 echo "#!/bin/sh" > $@.tmp
|
|
197 abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
131
|
198 echo "$(GCC_FOR_TARGET)" '"$$@"' "-L $${abs_libgodir} -L $${abs_libgodir}/.libs -B$${abs_libgodir}/../libstdc++-v3/src/.libs -B$${abs_libgodir}/../libstdc++-v3/libsupc++/.libs" >> $@.tmp
|
111
|
199 chmod +x $@.tmp
|
|
200 mv -f $@.tmp $@
|
|
201
|
|
202 # CHECK_ENV sets up the environment to run the newly built go tool.
|
|
203 # If you change this, change ECHO_ENV, below.
|
|
204 # The fl shell variable is used to avoid having FAIL appear
|
|
205 # in the log unnecessarily.
|
|
206 CHECK_ENV = \
|
|
207 PATH=`echo $(abs_builddir):$${PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
|
|
208 export PATH; \
|
|
209 GCCGO="$(abs_builddir)/check-gccgo"; \
|
|
210 export GCCGO; \
|
|
211 CC="$(abs_builddir)/check-gcc"; \
|
|
212 export CC; \
|
|
213 GCCGOTOOLDIR="$(abs_builddir)"; \
|
|
214 export GCCGOTOOLDIR; \
|
|
215 GO_TESTING_GOTOOLS=yes; \
|
|
216 export GO_TESTING_GOTOOLS; \
|
|
217 abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
|
218 LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
|
|
219 export LD_LIBRARY_PATH; \
|
|
220 GOROOT=$${abs_libgodir}; \
|
|
221 export GOROOT; \
|
131
|
222 GOCACHE=$(abs_builddir)/gocache-test; \
|
|
223 export GOCACHE; \
|
111
|
224 fl1="FA"; fl2="IL"; fl="$${fl1}$${fl2}";
|
|
225
|
|
226 # ECHO_ENV is a variant of CHECK_ENV to put into a testlog file.
|
|
227 # It assumes that abs_libgodir is set.
|
131
|
228 ECHO_ENV = PATH=`echo $(abs_builddir):$${PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` GCCGO='$(abs_builddir)/check-gccgo' CC='$(abs_builddir)/check-gcc' GCCGOTOOLDIR='$(abs_builddir)' GO_TESTING_GOTOOLS=yes LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` GOROOT=`echo $${abs_libgodir} GOCACHE='$(abs_builddir)/gocache-test'`
|
111
|
229
|
131
|
230 # check-go-tool runs `go test cmd/go` in our environment.
|
|
231 check-go-tool: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc
|
|
232 -chmod -R u+w check-go-dir
|
111
|
233 rm -rf check-go-dir cmd_go-testlog
|
|
234 $(MKDIR_P) check-go-dir/src/cmd/go
|
|
235 cp $(cmdsrcdir)/go/*.go check-go-dir/src/cmd/go/
|
|
236 cp -r $(cmdsrcdir)/go/internal check-go-dir/src/cmd/go/
|
|
237 cp $(libgodir)/zdefaultcc.go check-go-dir/src/cmd/go/internal/cfg/
|
|
238 cp -r $(cmdsrcdir)/go/testdata check-go-dir/src/cmd/go/
|
|
239 cp -r $(cmdsrcdir)/internal check-go-dir/src/cmd/
|
131
|
240 cp $(libgodir)/objabi.go check-go-dir/src/cmd/internal/objabi/
|
111
|
241 @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
|
242 abs_checkdir=`cd check-go-dir && $(PWD_COMMAND)`; \
|
131
|
243 echo "cd check-go-dir/src/cmd/go && $(ECHO_ENV) GOPATH=$${abs_checkdir} $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > cmd_go-testlog
|
111
|
244 $(CHECK_ENV) \
|
|
245 GOPATH=`cd check-go-dir && $(PWD_COMMAND)`; \
|
|
246 export GOPATH; \
|
131
|
247 (cd check-go-dir/src/cmd/go && $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v) >> cmd_go-testlog 2>&1 || echo "--- $${fl}: go test cmd/go (0.00s)" >> cmd_go-testlog
|
111
|
248 grep '^--- ' cmd_go-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2
|
|
249
|
|
250 # check-runtime runs `go test runtime` in our environment.
|
|
251 # The runtime package is also tested as part of libgo,
|
|
252 # but the runtime tests use the go tool heavily, so testing
|
|
253 # here too will catch more problems.
|
131
|
254 check-runtime: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc
|
111
|
255 rm -rf check-runtime-dir runtime-testlog
|
|
256 $(MKDIR_P) check-runtime-dir
|
|
257 @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
|
258 LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
|
|
259 GOARCH=`$(abs_builddir)/go$(EXEEXT) env GOARCH`; \
|
|
260 GOOS=`$(abs_builddir)/go$(EXEEXT) env GOOS`; \
|
|
261 files=`$(SHELL) $(libgosrcdir)/../match.sh --goarch=$${GOARCH} --goos=$${GOOS} --srcdir=$(libgosrcdir)/runtime --extrafiles="$(libgodir)/runtime_sysinfo.go $(libgodir)/sigtab.go" --tag=libffi`; \
|
131
|
262 echo "$(ECHO_ENV) GC='$(abs_builddir)/check-gccgo -fgo-compiling-runtime' GOARCH=$${GOARCH} GOOS=$${GOOS} $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles='$${files}' $(GOTESTFLAGS) -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > runtime-testlog
|
111
|
263 $(CHECK_ENV) \
|
|
264 GC="$${GCCGO} -fgo-compiling-runtime"; \
|
|
265 export GC; \
|
|
266 GOARCH=`$(abs_builddir)/go$(EXEEXT) env GOARCH`; \
|
|
267 GOOS=`$(abs_builddir)/go$(EXEEXT) env GOOS`; \
|
|
268 files=`$(SHELL) $(libgosrcdir)/../match.sh --goarch=$${GOARCH} --goos=$${GOOS} --srcdir=$(libgosrcdir)/runtime --extrafiles="$(libgodir)/runtime_sysinfo.go $(libgodir)/sigtab.go" --tag=libffi`; \
|
131
|
269 $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles="$${files}" $(GOTESTFLAGS) -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v >> runtime-testlog 2>&1 || echo "--- $${fl}: go test runtime (0.00s)" >> runtime-testlog
|
111
|
270 grep '^--- ' runtime-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2
|
|
271
|
|
272 # check-cgo-test runs `go test misc/cgo/test` in our environment.
|
131
|
273 check-cgo-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc
|
111
|
274 rm -rf cgo-test-dir cgo-testlog
|
|
275 $(MKDIR_P) cgo-test-dir/misc/cgo
|
|
276 cp -r $(libgomiscdir)/cgo/test cgo-test-dir/misc/cgo/
|
|
277 @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
131
|
278 echo "cd cgo-test-dir/misc/cgo/test && $(ECHO_ENV) GOTRACEBACK=2 $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > cgo-testlog
|
111
|
279 $(CHECK_ENV) \
|
|
280 GOTRACEBACK=2; \
|
|
281 export GOTRACEBACK; \
|
131
|
282 (cd cgo-test-dir/misc/cgo/test && $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v) >> cgo-testlog 2>&1 || echo "--- $${fl}: go test misc/cgo/test (0.00s)" >> cgo-testlog
|
111
|
283 grep '^--- ' cgo-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2
|
|
284
|
|
285 # check-carchive-test runs `go test misc/cgo/testcarchive/carchive_test.go`
|
|
286 # in our environment.
|
131
|
287 check-carchive-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc
|
111
|
288 rm -rf carchive-test-dir carchive-testlog
|
|
289 $(MKDIR_P) carchive-test-dir/misc/cgo
|
|
290 cp -r $(libgomiscdir)/cgo/testcarchive carchive-test-dir/misc/cgo/
|
|
291 @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
131
|
292 echo "cd carchive-test-dir/misc/cgo/testcarchive && $(ECHO_ENV) LIBRARY_PATH=`echo $${abs_libgodir}/.libs` $(abs_builddir)/go$(EXEEXT) test -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v carchive_test.go" > carchive-testlog
|
111
|
293 $(CHECK_ENV) \
|
|
294 LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
|
|
295 export LIBRARY_PATH; \
|
131
|
296 (cd carchive-test-dir/misc/cgo/testcarchive && $(abs_builddir)/go$(EXEEXT) test -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v carchive_test.go) >> carchive-testlog 2>&1 || echo "--- $${fl}: go test misc/cgo/testcarchive (0.00s)" >> carchive-testlog
|
111
|
297 grep '^--- ' carchive-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2
|
|
298
|
131
|
299 # check-vet runs `go test cmd/vet` in our environment.
|
|
300 check-vet: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc
|
|
301 rm -rf check-vet-dir cmd_vet-testlog
|
|
302 $(MKDIR_P) check-vet-dir/src/cmd/internal
|
|
303 cp -r $(cmdsrcdir)/vet check-vet-dir/src/cmd/
|
|
304 cp -r $(cmdsrcdir)/internal/objabi check-vet-dir/src/cmd/internal
|
|
305 cp $(libgodir)/objabi.go check-vet-dir/src/cmd/internal/objabi/
|
|
306 @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
|
|
307 abs_checkdir=`cd check-vet-dir && $(PWD_COMMAND)`; \
|
|
308 echo "cd check-vet-dir/src/cmd/vet && $(ECHO_ENV) GOPATH=$${abs_checkdir} $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > cmd_vet-testlog
|
|
309 $(CHECK_ENV) \
|
|
310 GOPATH=`cd check-vet-dir && $(PWD_COMMAND)`; \
|
|
311 export GOPATH; \
|
|
312 (cd check-vet-dir/src/cmd/vet && $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v) >> cmd_vet-testlog 2>&1 || echo "--- $${fl}: go test cmd/vet (0.00s)" >> cmd_vet-testlog
|
|
313 grep '^--- ' cmd_vet-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2
|
|
314
|
111
|
315 # The check targets runs the tests and assembles the output files.
|
131
|
316 check: check-head check-go-tool check-runtime check-cgo-test check-carchive-test check-vet
|
111
|
317 @mv gotools.head gotools.sum
|
|
318 @cp gotools.sum gotools.log
|
131
|
319 @for file in cmd_go-testlog runtime-testlog cgo-testlog carchive-testlog cmd_vet-testlog; do \
|
111
|
320 testname=`echo $${file} | sed -e 's/-testlog//' -e 's|_|/|'`; \
|
|
321 echo "Running $${testname}" >> gotools.sum; \
|
|
322 echo "Running $${testname}" >> gotools.log; \
|
|
323 sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' < $${file} >> gotools.log; \
|
|
324 grep '^--- ' $${file} | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' -e 's/SKIP/UNTESTED/' | sort -k 2 >> gotools.sum; \
|
|
325 done
|
|
326 @echo >> gotools.sum
|
|
327 @echo " === gotools Summary ===" >> gotools.sum
|
|
328 @pass=`grep -c '^PASS' gotools.sum`; \
|
|
329 if test "$${pass}" -ne "0"; then \
|
|
330 echo "# of expected passes $${pass}" >> gotools.sum; \
|
|
331 fi
|
|
332 @fail=`grep -c '^FAIL' gotools.sum`; \
|
|
333 if test "$${fail}" -ne "0"; then \
|
|
334 echo "# of unexpected failures $${fail}" >> gotools.sum; \
|
|
335 fi
|
|
336 @untested=`grep -c '^UNTESTED' gotools.sum`; \
|
|
337 if test "$${untested}" -ne "0"; then \
|
|
338 echo "# of untested testcases $${untested}" >> gotools.sum; \
|
|
339 fi
|
|
340 @echo `echo $(GOC_FOR_TARGET) | sed -e 's/ .*//'` `$(GOC_FOR_TARGET) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> gotools.sum
|
|
341 @echo >> gotools.log
|
|
342 @echo "runtest completed at `date`" >> gotools.log
|
|
343 @if grep '^FAIL' gotools.sum >/dev/null 2>&1; then exit 1; fi
|
|
344
|
131
|
345 .PHONY: check check-head check-go-tool check-runtime check-cgo-test check-carchive-test check-vet
|
111
|
346
|
|
347 else
|
|
348
|
|
349 # For a non-native build we have to build the programs using a
|
|
350 # previously built host (or build -> host) Go compiler. We should
|
|
351 # only do this if such a compiler is available. We also need to get
|
|
352 # the right values for GOARCH and GOOS in the default build context in
|
|
353 # the go/build package. Figure this out later.
|
|
354
|
|
355 endif
|