annotate gotools/Makefile.am @ 144:8f4e72ab4e11

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