re PR go/81617 (mksigtab.sh fails to resolve NSIG with glibc 2.26)
[gcc.git] / libgo / Makefile.am
1 # Makefile.am -- Go library Makefile.
2
3 # Copyright 2009 The Go Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style
5 # license that can be found in the LICENSE file.
6
7 # Process this file with autoreconf to produce Makefile.in.
8
9 # Go support.
10 SUFFIXES = .c .go .gox .o .obj .lo .a
11
12 if LIBGO_IS_RTEMS
13 subdirs = testsuite
14 endif
15
16 SUBDIRS = ${subdirs}
17
18 gcc_version := $(shell $(GOC) -dumpversion)
19
20 MAINT_CHARSET = latin1
21
22 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
23 PWD_COMMAND = $${PWDCMD-pwd}
24 STAMP = echo timestamp >
25
26 toolexecdir = $(glibgo_toolexecdir)
27 toolexeclibdir = $(glibgo_toolexeclibdir)
28 toolexeclibgodir = $(nover_glibgo_toolexeclibdir)/go/$(gcc_version)/$(target_alias)
29 libexecsubdir = $(libexecdir)/gcc/$(target_alias)/$(gcc_version)
30
31 LIBFFI = @LIBFFI@
32 LIBFFIINCS = @LIBFFIINCS@
33
34 LIBATOMIC = @LIBATOMIC@
35
36 WARN_CFLAGS = $(WARN_FLAGS) $(WERROR)
37
38 # -I/-D flags to pass when compiling.
39 AM_CPPFLAGS = -I $(srcdir)/runtime $(LIBFFIINCS) $(PTHREAD_CFLAGS)
40
41 ACLOCAL_AMFLAGS = -I ./config -I ../config
42
43 AM_CFLAGS = -fexceptions -fnon-call-exceptions -fplan9-extensions \
44 $(SPLIT_STACK) $(WARN_CFLAGS) \
45 $(STRINGOPS_FLAG) $(HWCAP_CFLAGS) $(OSCFLAGS) \
46 -I $(srcdir)/../libgcc -I $(srcdir)/../libbacktrace \
47 -I $(MULTIBUILDTOP)../../gcc/include
48
49 AM_LDFLAGS =
50
51 if USING_SPLIT_STACK
52 AM_LDFLAGS += -XCClinker $(SPLIT_STACK)
53 endif
54
55 if LIBGO_IS_AIX
56 # Using an import file for libgo avoid requiring to use the -brtl flag
57 # when builing a go program
58 AM_LDFLAGS += -Wl,-bbigtoc -Wl,-bI:$(srcdir)/libgo.imp
59 EXTRA_libgo_la_DEPENDENCIES = libgo.imp
60 endif
61
62 # Multilib support.
63 MAKEOVERRIDES=
64
65 # Work around what appears to be a GNU make handling MAKEFLAGS
66 # values defined in terms of make variables, as is the case for CC and
67 # friends when we are called from the top level Makefile.
68 AM_MAKEFLAGS = \
69 "AR_FLAGS=$(AR_FLAGS)" \
70 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
71 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
72 "CFLAGS=$(CFLAGS)" \
73 "CXXFLAGS=$(CXXFLAGS)" \
74 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
75 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
76 "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
77 "GOC=$(GOC)" \
78 "GOCFLAGS=$(GOCFLAGS)" \
79 "INSTALL=$(INSTALL)" \
80 "INSTALL_DATA=$(INSTALL_DATA)" \
81 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
82 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
83 "LDFLAGS=$(LDFLAGS)" \
84 "LIBCFLAGS=$(LIBCFLAGS)" \
85 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
86 "MAKE=$(MAKE)" \
87 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
88 "PICFLAG=$(PICFLAG)" \
89 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
90 "SHELL=$(SHELL)" \
91 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
92 "exec_prefix=$(exec_prefix)" \
93 "infodir=$(infodir)" \
94 "libdir=$(libdir)" \
95 "includedir=$(includedir)" \
96 "prefix=$(prefix)" \
97 "tooldir=$(tooldir)" \
98 "gxx_include_dir=$(gxx_include_dir)" \
99 "AR=$(AR)" \
100 "AS=$(AS)" \
101 "LD=$(LD)" \
102 "RANLIB=$(RANLIB)" \
103 "NM=$(NM)" \
104 "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
105 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
106 "DESTDIR=$(DESTDIR)" \
107 "WERROR=$(WERROR)"
108
109 # Subdir rules rely on $(FLAGS_TO_PASS)
110 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
111
112 if GOC_IS_LLGO
113 toolexeclib_LTLIBRARIES = libgo-llgo.la
114 toolexeclib_LIBRARIES = libgobegin-llgo.a
115 else
116 toolexeclib_LTLIBRARIES = libgo.la
117 toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
118 endif
119
120 toolexeclibgo_DATA = \
121 bufio.gox \
122 bytes.gox \
123 context.gox \
124 crypto.gox \
125 encoding.gox \
126 errors.gox \
127 expvar.gox \
128 flag.gox \
129 fmt.gox \
130 hash.gox \
131 html.gox \
132 image.gox \
133 io.gox \
134 log.gox \
135 math.gox \
136 mime.gox \
137 net.gox \
138 os.gox \
139 path.gox \
140 reflect.gox \
141 regexp.gox \
142 runtime.gox \
143 sort.gox \
144 strconv.gox \
145 strings.gox \
146 sync.gox \
147 syscall.gox \
148 testing.gox \
149 time.gox \
150 unicode.gox
151
152 toolexeclibgoarchivedir = $(toolexeclibgodir)/archive
153
154 toolexeclibgoarchive_DATA = \
155 archive/tar.gox \
156 archive/zip.gox
157
158 toolexeclibgocompressdir = $(toolexeclibgodir)/compress
159
160 toolexeclibgocompress_DATA = \
161 compress/bzip2.gox \
162 compress/flate.gox \
163 compress/gzip.gox \
164 compress/lzw.gox \
165 compress/zlib.gox
166
167 toolexeclibgocontainerdir = $(toolexeclibgodir)/container
168
169 toolexeclibgocontainer_DATA = \
170 container/heap.gox \
171 container/list.gox \
172 container/ring.gox
173
174 toolexeclibgocryptodir = $(toolexeclibgodir)/crypto
175
176 toolexeclibgocrypto_DATA = \
177 crypto/aes.gox \
178 crypto/cipher.gox \
179 crypto/des.gox \
180 crypto/dsa.gox \
181 crypto/ecdsa.gox \
182 crypto/elliptic.gox \
183 crypto/hmac.gox \
184 crypto/md5.gox \
185 crypto/rand.gox \
186 crypto/rc4.gox \
187 crypto/rsa.gox \
188 crypto/sha1.gox \
189 crypto/sha256.gox \
190 crypto/sha512.gox \
191 crypto/subtle.gox \
192 crypto/tls.gox \
193 crypto/x509.gox
194
195 toolexeclibgocryptox509dir = $(toolexeclibgocryptodir)/x509
196
197 toolexeclibgocryptox509_DATA = \
198 crypto/x509/pkix.gox
199
200 toolexeclibgodatabasedir = $(toolexeclibgodir)/database
201
202 toolexeclibgodatabase_DATA = \
203 database/sql.gox
204
205 toolexeclibgodatabasesqldir = $(toolexeclibgodatabasedir)/sql
206
207 toolexeclibgodatabasesql_DATA = \
208 database/sql/driver.gox
209
210 toolexeclibgodebugdir = $(toolexeclibgodir)/debug
211
212 toolexeclibgodebug_DATA = \
213 debug/dwarf.gox \
214 debug/elf.gox \
215 debug/gosym.gox \
216 debug/macho.gox \
217 debug/pe.gox \
218 debug/plan9obj.gox
219
220 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
221
222 toolexeclibgoencoding_DATA = \
223 encoding/ascii85.gox \
224 encoding/asn1.gox \
225 encoding/base32.gox \
226 encoding/base64.gox \
227 encoding/binary.gox \
228 encoding/csv.gox \
229 encoding/gob.gox \
230 encoding/hex.gox \
231 encoding/json.gox \
232 encoding/pem.gox \
233 encoding/xml.gox
234
235 toolexeclibgoexpdir = $(toolexeclibgodir)/exp
236
237 toolexeclibgoexp_DATA = \
238 exp/proxy.gox \
239 exp/terminal.gox
240
241 toolexeclibgogodir = $(toolexeclibgodir)/go
242
243 toolexeclibgogo_DATA = \
244 go/ast.gox \
245 go/build.gox \
246 go/constant.gox \
247 go/doc.gox \
248 go/format.gox \
249 go/importer.gox \
250 go/parser.gox \
251 go/printer.gox \
252 go/scanner.gox \
253 go/token.gox \
254 go/types.gox
255
256 toolexeclibgohashdir = $(toolexeclibgodir)/hash
257
258 toolexeclibgohash_DATA = \
259 hash/adler32.gox \
260 hash/crc32.gox \
261 hash/crc64.gox \
262 hash/fnv.gox
263
264 toolexeclibgohtmldir = $(toolexeclibgodir)/html
265
266 toolexeclibgohtml_DATA = \
267 html/template.gox
268
269 toolexeclibgoimagedir = $(toolexeclibgodir)/image
270
271 toolexeclibgoimage_DATA = \
272 image/color.gox \
273 image/draw.gox \
274 image/gif.gox \
275 image/jpeg.gox \
276 image/png.gox
277
278 toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
279
280 toolexeclibgoimagecolor_DATA = \
281 image/color/palette.gox
282
283 toolexeclibgoindexdir = $(toolexeclibgodir)/index
284
285 toolexeclibgoindex_DATA = \
286 index/suffixarray.gox
287
288 toolexeclibgoiodir = $(toolexeclibgodir)/io
289
290 toolexeclibgoio_DATA = \
291 io/ioutil.gox
292
293 toolexeclibgologdir = $(toolexeclibgodir)/log
294
295 toolexeclibgolog_DATA = \
296 log/syslog.gox
297
298 toolexeclibgomathdir = $(toolexeclibgodir)/math
299
300 toolexeclibgomath_DATA = \
301 math/big.gox \
302 math/cmplx.gox \
303 math/rand.gox
304
305 toolexeclibgomimedir = $(toolexeclibgodir)/mime
306
307 toolexeclibgomime_DATA = \
308 mime/multipart.gox \
309 mime/quotedprintable.gox
310
311 toolexeclibgonetdir = $(toolexeclibgodir)/net
312
313 toolexeclibgonet_DATA = \
314 net/http.gox \
315 net/mail.gox \
316 net/rpc.gox \
317 net/smtp.gox \
318 net/textproto.gox \
319 net/url.gox
320
321 toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
322
323 toolexeclibgonethttp_DATA = \
324 net/http/cgi.gox \
325 net/http/cookiejar.gox \
326 net/http/fcgi.gox \
327 net/http/httptest.gox \
328 net/http/httptrace.gox \
329 net/http/httputil.gox \
330 net/http/pprof.gox
331
332 toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
333
334 toolexeclibgonetrpc_DATA = \
335 net/rpc/jsonrpc.gox
336
337 toolexeclibgoosdir = $(toolexeclibgodir)/os
338
339 toolexeclibgoos_DATA = \
340 os/exec.gox \
341 os/signal.gox \
342 os/user.gox
343
344 toolexeclibgopathdir = $(toolexeclibgodir)/path
345
346 toolexeclibgopath_DATA = \
347 path/filepath.gox
348
349 toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
350
351 toolexeclibgoregexp_DATA = \
352 regexp/syntax.gox
353
354 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
355
356 toolexeclibgoruntime_DATA = \
357 runtime/debug.gox \
358 runtime/pprof.gox \
359 runtime/trace.gox
360
361 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
362
363 toolexeclibgosync_DATA = \
364 sync/atomic.gox
365
366 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
367
368 toolexeclibgotesting_DATA = \
369 testing/iotest.gox \
370 testing/quick.gox
371
372 toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
373
374 toolexeclibgotestinginternal_DATA = \
375 testing/internal/testdeps.gox
376
377 toolexeclibgotextdir = $(toolexeclibgodir)/text
378
379 toolexeclibgotext_DATA = \
380 text/scanner.gox \
381 text/tabwriter.gox \
382 text/template.gox
383
384 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
385
386 toolexeclibgotexttemplate_DATA = \
387 text/template/parse.gox
388
389 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
390
391 toolexeclibgounicode_DATA = \
392 unicode/utf16.gox \
393 unicode/utf8.gox
394
395 if LIBGO_IS_RTEMS
396 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
397 else
398 rtems_task_variable_add_file =
399 endif
400
401 if LIBGO_IS_LINUX
402 runtime_getncpu_file = runtime/getncpu-linux.c
403 else
404 if LIBGO_IS_DARWIN
405 runtime_getncpu_file = runtime/getncpu-bsd.c
406 else
407 if LIBGO_IS_IRIX
408 runtime_getncpu_file = runtime/getncpu-irix.c
409 else
410 if LIBGO_IS_SOLARIS
411 runtime_getncpu_file = runtime/getncpu-solaris.c
412 else
413 if LIBGO_IS_FREEBSD
414 runtime_getncpu_file = runtime/getncpu-bsd.c
415 else
416 if LIBGO_IS_NETBSD
417 runtime_getncpu_file = runtime/getncpu-bsd.c
418 else
419 if LIBGO_IS_AIX
420 runtime_getncpu_file = runtime/getncpu-aix.c
421 else
422 runtime_getncpu_file = runtime/getncpu-none.c
423 endif
424 endif
425 endif
426 endif
427 endif
428 endif
429 endif
430
431 runtime_files = \
432 runtime/aeshash.c \
433 runtime/go-assert.c \
434 runtime/go-caller.c \
435 runtime/go-callers.c \
436 runtime/go-cdiv.c \
437 runtime/go-cgo.c \
438 runtime/go-construct-map.c \
439 runtime/go-ffi.c \
440 runtime/go-fieldtrack.c \
441 runtime/go-matherr.c \
442 runtime/go-memclr.c \
443 runtime/go-memcmp.c \
444 runtime/go-memequal.c \
445 runtime/go-memmove.c \
446 runtime/go-nanotime.c \
447 runtime/go-now.c \
448 runtime/go-nosys.c \
449 runtime/go-reflect-call.c \
450 runtime/go-runtime-error.c \
451 runtime/go-setenv.c \
452 runtime/go-signal.c \
453 runtime/go-strslice.c \
454 runtime/go-typedesc-equal.c \
455 runtime/go-unsafe-pointer.c \
456 runtime/go-unsetenv.c \
457 runtime/go-unwind.c \
458 runtime/go-varargs.c \
459 runtime/env_posix.c \
460 runtime/panic.c \
461 runtime/print.c \
462 runtime/proc.c \
463 runtime/runtime_c.c \
464 runtime/stack.c \
465 runtime/thread.c \
466 runtime/yield.c \
467 $(rtems_task_variable_add_file) \
468 $(runtime_getncpu_file)
469
470 version.go: s-version; @true
471 s-version: Makefile
472 rm -f version.go.tmp
473 echo "package sys" > version.go.tmp
474 echo 'const DefaultGoroot = "$(prefix)"' >> version.go.tmp
475 echo 'const TheVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'"' >> version.go.tmp
476 echo 'const Goexperiment = ``' >> version.go.tmp
477 echo 'const GOARCH = "'$(GOARCH)'"' >> version.go.tmp
478 echo 'const GOOS = "'$(GOOS)'"' >> version.go.tmp
479 echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
480 echo >> version.go.tmp
481 echo "type ArchFamilyType int" >> version.go.tmp
482 echo >> version.go.tmp
483 echo "const (" >> version.go.tmp
484 echo " UNKNOWN ArchFamilyType = iota" >> version.go.tmp
485 for a in $(ALLGOARCHFAMILY); do \
486 echo " $${a}" >> version.go.tmp; \
487 done
488 echo ")" >> version.go.tmp
489 echo >> version.go.tmp
490 for a in $(ALLGOARCH); do \
491 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
492 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
493 if test "$${a}" = "$(GOARCH)"; then \
494 echo "const Goarch$${n} = 1" >> version.go.tmp; \
495 else \
496 echo "const Goarch$${n} = 0" >> version.go.tmp; \
497 fi; \
498 done
499 echo >> version.go.tmp
500 echo "const (" >> version.go.tmp
501 echo " ArchFamily = $(GOARCH_FAMILY)" >> version.go.tmp
502 echo " BigEndian = $(GOARCH_BIGENDIAN)" >> version.go.tmp
503 echo " CacheLineSize = $(GOARCH_CACHELINESIZE)" >> version.go.tmp
504 echo " PhysPageSize = $(GOARCH_PHYSPAGESIZE)" >> version.go.tmp
505 echo " PCQuantum = $(GOARCH_PCQUANTUM)" >> version.go.tmp
506 echo " Int64Align = $(GOARCH_INT64ALIGN)" >> version.go.tmp
507 echo " HugePageSize = $(GOARCH_HUGEPAGESIZE)" >> version.go.tmp
508 echo " MinFrameSize = $(GOARCH_MINFRAMESIZE)" >> version.go.tmp
509 echo ")" >> version.go.tmp
510 echo >> version.go.tmp
511 for a in $(ALLGOOS); do \
512 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
513 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
514 if test "$${a}" = "$(GOOS)"; then \
515 echo "const Goos$${n} = 1" >> version.go.tmp; \
516 else \
517 echo "const Goos$${n} = 0" >> version.go.tmp; \
518 fi; \
519 done
520 echo >> version.go.tmp
521 echo "type Uintreg uintptr" >> version.go.tmp
522 $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
523 $(STAMP) $@
524
525 runtime_sysinfo.go: s-runtime_sysinfo; @true
526 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
527 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
528 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
529 $(STAMP) $@
530
531 sigtab.go: s-sigtab; @true
532 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
533 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
534 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
535 $(STAMP) $@
536
537 # _Complex_lock and _Reader_lock are Go translations of some AIX system
538 # types and should not be exported back to C
539 # semt is a Go translation of the C type sem_t; it fails to convert on
540 # some systems and need not be exported back to C.
541 # sigset conflicts with system type sigset on AIX, so we need to rename it
542 runtime.inc: s-runtime-inc; @true
543 s-runtime-inc: runtime.lo Makefile
544 rm -f runtime.inc.tmp2 runtime.inc.tmp3
545 grep -v "#define _" runtime.inc.tmp | grep -v "#define [cm][01234] " | grep -v "#define empty " > runtime.inc.tmp2
546 for pattern in '_[GP][a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
547 grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
548 done
549 for TYPE in _Complex_lock _Reader_lock semt; do \
550 sed -e '/struct '$${TYPE}' {/,/^}/s/^.*$$//' runtime.inc.tmp2 > runtime.inc.tmp3; \
551 mv runtime.inc.tmp3 runtime.inc.tmp2; \
552 done
553 sed -e 's/sigset/sigset_go/' runtime.inc.tmp2 > runtime.inc.tmp3
554 $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp3 runtime.inc
555 rm -f runtime.inc.tmp2 runtime.inc.tmp3
556 $(STAMP) $@
557
558 noinst_DATA = zstdpkglist.go
559
560 # Generate the list of go std packages that were included in libgo
561 zstdpkglist.go: s-zstdpkglist; @true
562 s-zstdpkglist: Makefile
563 rm -f zstdpkglist.go.tmp
564 echo 'package main' > zstdpkglist.go.tmp
565 echo "" >> zstdpkglist.go.tmp
566 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
567 echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_/]*_c\.lo||g' | sed 's|\([a-z0-9_/]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp
568 echo '}' >> zstdpkglist.go.tmp
569 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
570 $(STAMP) $@
571
572 if LIBGO_IS_LINUX
573 syscall_epoll_file = epoll.go
574 else
575 syscall_epoll_file =
576 endif
577
578 libcalls.go: s-libcalls; @true
579 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
580 rm -f libcalls.go.tmp
581 $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
582 $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
583 $(STAMP) $@
584
585 libcalls-list: s-libcalls-list; @true
586 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
587 rm -f libcalls-list.tmp
588 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
589 $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
590 $(STAMP) $@
591
592 syscall_arch.go: s-syscall_arch; @true
593 s-syscall_arch: Makefile
594 rm -f syscall_arch.go.tmp
595 echo "package syscall" > syscall_arch.go.tmp
596 echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
597 echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
598 $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
599 $(STAMP) $@
600
601 SYSINFO_FLAGS = \
602 $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
603 $(CPPFLAGS) $(OSCFLAGS) -O
604
605 gen-sysinfo.go: s-gen-sysinfo; @true
606 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
607 $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
608 rm -f sysinfo.s
609 $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
610 $(STAMP) $@
611
612 errno.i: s-errno; @true
613 s-errno:
614 echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
615 $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
616 $(STAMP) $@
617
618 sysinfo.go: s-sysinfo; @true
619 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
620 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
621 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
622 $(STAMP) $@
623
624 # The epoll struct has an embedded union and is packed on x86_64,
625 # which is too complicated for mksysinfo.sh. We find the offset of
626 # the only field we care about in configure.ac, and generate the
627 # struct here.
628 epoll.go: s-epoll; @true
629 s-epoll: Makefile
630 rm -f epoll.go.tmp
631 echo 'package syscall' > epoll.go.tmp
632 echo 'type EpollEvent struct {' >> epoll.go.tmp
633 echo ' Events uint32' >> epoll.go.tmp
634 case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
635 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
636 exit 1; ;; \
637 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
638 12,4) echo ' Fd int32' >> epoll.go.tmp; \
639 echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
640 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
641 echo ' Fd int32' >> epoll.go.tmp; ;; \
642 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
643 echo ' Fd int32' >> epoll.go.tmp; \
644 echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
645 *) echo 1>&2 "*** struct epoll_event unsupported"; \
646 exit 1; ;; \
647 esac
648 echo '}' >> epoll.go.tmp
649 $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
650 $(STAMP) $@
651
652 if LIBGO_IS_LINUX
653 syscall_lib_clone_lo = syscall/clone_linux.lo
654 else
655 syscall_lib_clone_lo =
656 endif
657
658 PACKAGES = \
659 archive/tar \
660 archive/zip \
661 bufio \
662 bytes \
663 cmd/internal/browser \
664 compress/bzip2 \
665 compress/flate \
666 compress/gzip \
667 compress/lzw \
668 compress/zlib \
669 container/heap \
670 container/list \
671 container/ring \
672 context \
673 crypto \
674 crypto/aes \
675 crypto/cipher \
676 crypto/des \
677 crypto/dsa \
678 crypto/ecdsa \
679 crypto/elliptic \
680 crypto/hmac \
681 crypto/internal/cipherhw \
682 crypto/md5 \
683 crypto/rand \
684 crypto/rc4 \
685 crypto/rsa \
686 crypto/sha1 \
687 crypto/sha256 \
688 crypto/sha512 \
689 crypto/subtle \
690 crypto/tls \
691 crypto/x509 \
692 crypto/x509/pkix \
693 database/sql \
694 database/sql/driver \
695 debug/dwarf \
696 debug/elf \
697 debug/gosym \
698 debug/macho \
699 debug/pe \
700 debug/plan9obj \
701 encoding \
702 encoding/ascii85 \
703 encoding/asn1 \
704 encoding/base32 \
705 encoding/base64 \
706 encoding/binary \
707 encoding/csv \
708 encoding/gob \
709 encoding/hex \
710 encoding/json \
711 encoding/pem \
712 encoding/xml \
713 errors \
714 exp/proxy \
715 exp/terminal \
716 expvar \
717 flag \
718 fmt \
719 go/ast \
720 go/build \
721 go/constant \
722 go/doc \
723 go/format \
724 go/importer \
725 go/internal/gccgoimporter \
726 go/internal/gcimporter \
727 go/parser \
728 go/printer \
729 go/scanner \
730 go/token \
731 go/types \
732 golang_org/x/crypto/chacha20poly1305 \
733 golang_org/x/crypto/chacha20poly1305/internal/chacha20 \
734 golang_org/x/crypto/curve25519 \
735 golang_org/x/crypto/poly1305 \
736 golang_org/x/net/http2/hpack \
737 golang_org/x/net/idna \
738 golang_org/x/net/lex/httplex \
739 golang_org/x/text/transform \
740 golang_org/x/text/unicode/norm \
741 golang_org/x/text/width \
742 hash \
743 hash/adler32 \
744 hash/crc32 \
745 hash/crc64 \
746 hash/fnv \
747 html \
748 html/template \
749 image \
750 image/color \
751 image/color/palette \
752 image/draw \
753 image/gif \
754 image/internal/imageutil \
755 image/jpeg \
756 image/png \
757 index/suffixarray \
758 internal/nettrace \
759 internal/pprof/profile \
760 internal/race \
761 internal/singleflight \
762 internal/syscall/unix \
763 internal/testenv \
764 internal/trace \
765 io \
766 io/ioutil \
767 log \
768 log/syslog \
769 math \
770 math/big \
771 math/cmplx \
772 math/rand \
773 mime \
774 mime/multipart \
775 mime/quotedprintable \
776 net \
777 net/http \
778 net/http/cgi \
779 net/http/cookiejar \
780 net/http/fcgi \
781 net/http/httptest \
782 net/http/httptrace \
783 net/http/httputil \
784 net/http/internal \
785 net/http/pprof \
786 net/internal/socktest \
787 net/mail \
788 net/rpc \
789 net/rpc/jsonrpc \
790 net/smtp \
791 net/textproto \
792 net/url \
793 os \
794 os/exec \
795 os/signal \
796 os/user \
797 path \
798 path/filepath \
799 reflect \
800 regexp \
801 regexp/syntax \
802 runtime \
803 runtime/debug \
804 runtime/internal/atomic \
805 runtime/internal/sys \
806 runtime/pprof \
807 runtime/pprof/internal/protopprof \
808 runtime/trace \
809 sort \
810 strconv \
811 strings \
812 sync \
813 sync/atomic \
814 syscall \
815 testing \
816 testing/internal/testdeps \
817 testing/iotest \
818 testing/quick \
819 text/scanner \
820 text/tabwriter \
821 text/template \
822 text/template/parse \
823 time \
824 unicode \
825 unicode/utf16 \
826 unicode/utf8
827
828 libgo_go_objs = \
829 $(addsuffix .lo,$(PACKAGES)) \
830 bytes/index.lo \
831 reflect/makefunc_ffi_c.lo \
832 strings/index.lo \
833 $(syscall_lib_clone_lo) \
834 syscall/errno.lo \
835 syscall/signame.lo \
836 syscall/wait.lo \
837 $(golang_org_x_net_lif_lo) \
838 $(golang_org_x_net_route_lo) \
839 log/syslog/syslog_c.lo \
840 $(os_lib_inotify_lo) \
841 runtime/internal/atomic_c.lo \
842 sync/atomic_c.lo
843
844 libgo_ldflags = \
845 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
846
847 libgo_libadd = \
848 $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
849 $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
850
851 libgo_la_SOURCES = $(runtime_files)
852 libgo_la_LDFLAGS = $(libgo_ldflags)
853 libgo_la_LIBADD = $(libgo_libadd)
854
855 libgo_llgo_la_SOURCES = $(runtime_files)
856 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
857 libgo_llgo_la_LIBADD = $(libgo_libadd)
858
859 libgobegin_a_SOURCES = \
860 runtime/go-main.c
861
862 libgobegin_llgo_a_SOURCES = \
863 runtime/go-main.c
864
865 # Use -fPIC for libgobegin so that it can be put in a PIE.
866 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
867 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
868
869 libgolibbegin_a_SOURCES = \
870 runtime/go-libmain.c
871
872 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
873
874 # Make sure runtime.inc is built before compiling any .c file.
875 $(libgo_la_OBJECTS): runtime.inc
876 $(libgo_llgo_la_OBJECTS): runtime.inc
877 $(libgobegin_a_OBJECTS): runtime.inc
878 $(libgobegin_llgo_a_OBJECTS): runtime.inc
879 $(libgolibbegin_a_OBJECTS): runtime.inc
880
881 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
882
883 GOCFLAGS = $(CFLAGS)
884 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
885 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
886
887 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
888 $(AM_GOCFLAGS) $(GOCFLAGS)
889
890 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
891 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
892
893 # Build the dependencies for a Go package.
894 BUILDDEPS = \
895 $(MKDIR_P) $(@D); \
896 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
897 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst .lo.dep,,$@)))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \
898 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
899 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
900 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
901 fi; \
902 mv -f $@.tmp $@
903
904 # Build the .go files for a package, generating a .lo file.
905 BUILDPACKAGE = \
906 $(MKDIR_P) $(@D); \
907 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
908 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's|golang_org|vendor/golang_org|'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
909
910 # How to build a .gox file from a .lo file.
911 # Matching .o file can either be in the same directory as the .lo (non-PIC
912 # object) or in the .libs directory (PIC object).
913 BUILDGOX = \
914 f="$(basename $<).o"; \
915 if test ! -f $$f; then \
916 f="$(basename $(<D)/.libs/$(<F)).o"; \
917 fi; \
918 $(OBJCOPY) -j .go_export $$f $@.tmp; \
919 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
920
921 GOTESTFLAGS =
922 GOBENCH =
923
924 # Check a package.
925 CHECK = \
926 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
927 export GC; \
928 GOLIBS="$(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
929 export GOLIBS; \
930 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
931 export RUNTESTFLAGS; \
932 MAKE="$(MAKE)"; \
933 export MAKE; \
934 NM="$(NM)"; \
935 export NM; \
936 libgccdir=`${GOC} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
937 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
938 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
939 export LD_LIBRARY_PATH; \
940 $(MKDIR_P) $(@D); \
941 rm -f $@-testsum $@-testlog; \
942 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst /,_,$(@D)))" $(matchargs_$(subst /,_,$(@D)))`; \
943 if test "$(USE_DEJAGNU)" = "yes"; then \
944 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
945 elif test "$(GOBENCH)" != ""; then \
946 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
947 else \
948 if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
949 echo "PASS: $(@D)" >> $@-testlog; \
950 echo "PASS: $(@D)"; \
951 echo "PASS: $(@D)" > $@-testsum; \
952 else \
953 echo "FAIL: $(@D)" >> $@-testlog; \
954 cat $@-testlog; \
955 echo "FAIL: $(@D)" > $@-testsum; \
956 exit 1; \
957 fi; \
958 fi
959
960 # Build all packages before checking any.
961 CHECK_DEPS = \
962 $(toolexeclibgo_DATA) \
963 $(toolexeclibgoarchive_DATA) \
964 $(toolexeclibgocompress_DATA) \
965 $(toolexeclibgocontainer_DATA) \
966 $(toolexeclibgocrypto_DATA) \
967 $(toolexeclibgodebug_DATA) \
968 $(toolexeclibgoencoding_DATA) \
969 $(toolexeclibgoexp_DATA) \
970 $(toolexeclibgogo_DATA) \
971 $(toolexeclibgohash_DATA) \
972 $(toolexeclibgoimage_DATA) \
973 $(toolexeclibgoindex_DATA) \
974 $(toolexeclibgoio_DATA) \
975 $(toolexeclibgolog_DATA) \
976 $(toolexeclibgomath_DATA) \
977 $(toolexeclibgomime_DATA) \
978 $(toolexeclibgonet_DATA) \
979 $(toolexeclibgonethttp_DATA) \
980 $(toolexeclibgoos_DATA) \
981 $(toolexeclibgopath_DATA) \
982 $(toolexeclibgorpc_DATA) \
983 $(toolexeclibgoruntime_DATA) \
984 $(toolexeclibgosync_DATA) \
985 $(toolexeclibgotesting_DATA) \
986 $(toolexeclibgotext_DATA) \
987 $(toolexeclibgotexttemplate_DATA) \
988 $(toolexeclibgounicode_DATA)
989
990 if GOC_IS_LLGO
991 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
992 else
993 CHECK_DEPS += libgo.la libgobegin.a
994 endif
995
996 # PACKAGE_template defines the rules for each package.
997 # For example, for the package bufio, it produces:
998 #
999 # @go_include@ bufio.lo.dep
1000 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
1001 # $(BUILDDEPS)
1002 # bufio.lo:
1003 # $(BUILDPACKAGE)
1004 # bufio/check: $(CHECK_DEPS)
1005 # @$(CHECK)
1006 # .PHONY: bufio/check
1007 #
1008 # This is invoked with $(1) set to a package, which is a directory name,
1009 # such as "bufio" or "archive/tar".
1010 define PACKAGE_template
1011 @go_include@ $(1).lo.dep
1012 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
1013 $$(BUILDDEPS)
1014 $(1).lo:
1015 $$(BUILDPACKAGE)
1016 $(1)/check: $$(CHECK_DEPS)
1017 @$$(CHECK)
1018 .PHONY: $(1)/check
1019 $(1).gox: $(1).s-gox; @true
1020 $(1).s-gox: $(1).lo
1021 $$(BUILDGOX)
1022 $$(STAMP) $$@
1023 endef
1024
1025 # This line expands PACKAGE_template once for each package name listed
1026 # in $(PACKAGES).
1027 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1028
1029 # Pass -ffp-contract=off, or 386-specific options, when building the
1030 # math package. MATH_FLAG is defined in configure.ac.
1031 math_lo_GOCFLAGS = $(MATH_FLAG)
1032
1033 # Add the generated file runtime_sysinfo.go to the runtime package.
1034 extra_go_files_runtime = runtime_sysinfo.go sigtab.go
1035 runtime.lo.dep: $(extra_go_files_runtime)
1036
1037 # Add generated files to the syscall package.
1038 extra_go_files_syscall = \
1039 libcalls.go \
1040 sysinfo.go \
1041 syscall_arch.go \
1042 $(syscall_epoll_file)
1043 syscall.lo.dep: $(extra_go_files_syscall)
1044
1045 # Pass -fgo-compiling-runtime when compiling the runtime package.
1046 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
1047 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1048 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1049 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1050 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1051 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1052
1053 # If libffi is supported (the normal case) use the ffi build tag for
1054 # the runtime package.
1055 if USE_LIBFFI
1056 matchargs_runtime = --tag=libffi
1057 else
1058 matchargs_runtime =
1059 endif
1060
1061 # At least for now, we need -static-libgo for this test, because
1062 # otherwise we can't get the line numbers.
1063 # Also use -fno-inline to get better results from the memory profiler.
1064 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1065
1066 extra_go_files_runtime_internal_sys = version.go
1067 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1068
1069 # FIXME: The following C files may as well move to the runtime
1070 # directory and be treated like other C files.
1071
1072 # Use C code to speed up {bytes,strings}.IndexByte and friends.
1073 bytes/index.lo: go/bytes/indexbyte.c runtime.inc
1074 @$(MKDIR_P) bytes
1075 $(LTCOMPILE) -c -o $@ $(srcdir)/go/bytes/indexbyte.c
1076 strings/index.lo: go/strings/indexbyte.c runtime.inc
1077 @$(MKDIR_P) strings
1078 $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c
1079
1080 # Use a C function with a fixed number of arguments to call a C
1081 # varargs function.
1082 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1083 @$(MKDIR_P) log/syslog
1084 $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1085
1086 # The interface to libffi from the reflect package is written in C.
1087 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1088 @$(MKDIR_P) reflect
1089 $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1090
1091 # The atomic functions are written in C.
1092 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1093 @$(MKDIR_P) runtime/internal
1094 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1095 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1096 @$(MKDIR_P) sync
1097 $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1098
1099 # A few syscall functions are written in C.
1100 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1101 @$(MKDIR_P) syscall
1102 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1103 syscall/errno.lo: go/syscall/errno.c runtime.inc
1104 @$(MKDIR_P) syscall
1105 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1106 syscall/signame.lo: go/syscall/signame.c runtime.inc
1107 @$(MKDIR_P) syscall
1108 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1109 syscall/wait.lo: go/syscall/wait.c runtime.inc
1110 @$(MKDIR_P) syscall
1111 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1112
1113 # Solaris 12 changed the type of fields in struct stat.
1114 # Use a build tag, based on a configure check, to cope.
1115 if LIBGO_IS_SOLARIS
1116 if HAVE_STAT_TIMESPEC
1117 matchargs_os = --tag=solaristag
1118 else
1119 matchargs_os =
1120 endif
1121 else
1122 matchargs_os =
1123 endif
1124
1125 if LIBGO_IS_BSD
1126
1127 # Build golang_org/x/net/route only on BSD systems.
1128
1129 $(eval $(call PACKAGE_template,golang_org/x/net/route))
1130
1131 golang_org_x_net_route_lo = \
1132 golang_org/x/net/route.lo
1133 golang_org_x_net_route_check = \
1134 golang_org/x/net/route/check
1135
1136 endif
1137
1138 if LIBGO_IS_SOLARIS
1139
1140 # Build golang_org/x/net/lif only on Solaris systems.
1141
1142 $(eval $(call PACKAGE_template,golang_org/x/net/lif))
1143
1144 golang_org_x_net_lif_lo = \
1145 golang_org/x/net/lif.lo
1146 golang_org_x_net_lif_check = \
1147 golang_org/x/net/lif/check
1148
1149 endif
1150
1151 TEST_PACKAGES = \
1152 bufio/check \
1153 bytes/check \
1154 context/check \
1155 errors/check \
1156 expvar/check \
1157 flag/check \
1158 fmt/check \
1159 html/check \
1160 image/check \
1161 io/check \
1162 log/check \
1163 math/check \
1164 mime/check \
1165 net/check \
1166 os/check \
1167 path/check \
1168 reflect/check \
1169 regexp/check \
1170 runtime/check \
1171 sort/check \
1172 strconv/check \
1173 strings/check \
1174 sync/check \
1175 syscall/check \
1176 time/check \
1177 unicode/check \
1178 archive/tar/check \
1179 archive/zip/check \
1180 compress/bzip2/check \
1181 compress/flate/check \
1182 compress/gzip/check \
1183 compress/lzw/check \
1184 compress/zlib/check \
1185 container/heap/check \
1186 container/list/check \
1187 container/ring/check \
1188 crypto/aes/check \
1189 crypto/cipher/check \
1190 crypto/des/check \
1191 crypto/dsa/check \
1192 crypto/ecdsa/check \
1193 crypto/elliptic/check \
1194 crypto/hmac/check \
1195 crypto/md5/check \
1196 crypto/rand/check \
1197 crypto/rc4/check \
1198 crypto/rsa/check \
1199 crypto/sha1/check \
1200 crypto/sha256/check \
1201 crypto/sha512/check \
1202 crypto/subtle/check \
1203 crypto/tls/check \
1204 crypto/x509/check \
1205 database/sql/check \
1206 database/sql/driver/check \
1207 debug/dwarf/check \
1208 debug/elf/check \
1209 debug/macho/check \
1210 debug/pe/check \
1211 debug/plan9obj/check \
1212 encoding/ascii85/check \
1213 encoding/asn1/check \
1214 encoding/base32/check \
1215 encoding/base64/check \
1216 encoding/binary/check \
1217 encoding/csv/check \
1218 encoding/gob/check \
1219 encoding/hex/check \
1220 encoding/json/check \
1221 encoding/pem/check \
1222 encoding/xml/check \
1223 exp/proxy/check \
1224 exp/terminal/check \
1225 html/template/check \
1226 go/ast/check \
1227 go/build/check \
1228 go/constant/check \
1229 go/doc/check \
1230 go/format/check \
1231 go/internal/gcimporter/check \
1232 go/internal/gccgoimporter/check \
1233 go/parser/check \
1234 go/printer/check \
1235 go/scanner/check \
1236 go/token/check \
1237 go/types/check \
1238 golang_org/x/crypto/chacha20poly1305/check \
1239 golang_org/x/crypto/chacha20poly1305/internal/chacha20/check \
1240 golang_org/x/crypto/curve25519/check \
1241 golang_org/x/crypto/poly1305/check \
1242 golang_org/x/net/http2/hpack/check \
1243 golang_org/x/net/idna/check \
1244 golang_org/x/net/lex/httplex/check \
1245 $(golang_org_x_net_lif_check) \
1246 $(golang_org_x_net_route_check) \
1247 hash/adler32/check \
1248 hash/crc32/check \
1249 hash/crc64/check \
1250 hash/fnv/check \
1251 image/color/check \
1252 image/draw/check \
1253 image/jpeg/check \
1254 image/png/check \
1255 index/suffixarray/check \
1256 internal/pprof/profile/check \
1257 internal/singleflight/check \
1258 internal/trace/check \
1259 io/ioutil/check \
1260 log/syslog/check \
1261 math/big/check \
1262 math/cmplx/check \
1263 math/rand/check \
1264 mime/multipart/check \
1265 mime/quotedprintable/check \
1266 net/http/check \
1267 net/http/cgi/check \
1268 net/http/cookiejar/check \
1269 net/http/fcgi/check \
1270 net/http/httptest/check \
1271 net/http/httptrace/check \
1272 net/http/httputil/check \
1273 net/http/internal/check \
1274 net/internal/socktest/check \
1275 net/mail/check \
1276 net/rpc/check \
1277 net/smtp/check \
1278 net/textproto/check \
1279 net/url/check \
1280 net/rpc/jsonrpc/check \
1281 os/exec/check \
1282 os/signal/check \
1283 os/user/check \
1284 path/filepath/check \
1285 regexp/syntax/check \
1286 runtime/debug/check \
1287 runtime/internal/atomic/check \
1288 runtime/internal/sys/check \
1289 runtime/pprof/check \
1290 runtime/pprof/internal/protopprof/check \
1291 runtime/trace/check \
1292 sync/atomic/check \
1293 text/scanner/check \
1294 text/tabwriter/check \
1295 text/template/check \
1296 text/template/parse/check \
1297 testing/quick/check \
1298 unicode/utf16/check \
1299 unicode/utf8/check
1300
1301 check: check-tail
1302 check-recursive: check-head
1303
1304 check-head:
1305 @echo "Test Run By $${USER} on `date`" > libgo.head
1306 @echo "Native configuration is $(host_triplet)" >> libgo.head
1307 @echo >> libgo.head
1308 @echo " === libgo tests ===" >> libgo.head
1309 @echo >> libgo.head
1310
1311 check-tail: check-recursive check-multi
1312 @if test "$(USE_DEJAGNU)" = "yes"; then \
1313 exit 0; \
1314 fi; \
1315 lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1316 for dir in . $(MULTIDIRS); do \
1317 mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1318 mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1319 done; \
1320 mv libgo.head libgo.sum; \
1321 cp libgo.sum libgo.log; \
1322 echo "Schedule of variations:" >> libgo.sum; \
1323 for dir in . $(MULTIDIRS); do \
1324 multidir=../$${dir}/$${lib}; \
1325 multivar=`cat $${multidir}/libgo.var`; \
1326 echo " $${multivar}" >> libgo.sum; \
1327 done; \
1328 echo >> libgo.sum; \
1329 pass=0; fail=0; untested=0; \
1330 for dir in . $(MULTIDIRS); do \
1331 multidir=../$${dir}/$${lib}; \
1332 multivar=`cat $${multidir}/libgo.var`; \
1333 echo "Running target $${multivar}" >> libgo.sum; \
1334 echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1335 cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1336 cat $${multidir}/libgo.log.sep >> libgo.log; \
1337 if test -n "${MULTIDIRS}"; then \
1338 echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
1339 echo >> libgo.sum; \
1340 fi; \
1341 p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1342 pass=`expr $$pass + $$p`; \
1343 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1344 echo "# of expected passes $$p" >> libgo.sum; \
1345 fi; \
1346 p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1347 fail=`expr $$fail + $$p`; \
1348 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1349 echo "# of unexpected failures $$p" >> libgo.sum; \
1350 fi; \
1351 p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1352 untested=`expr $$untested + $$p`; \
1353 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1354 echo "# of untested testcases $$p" >> libgo.sum; \
1355 fi; \
1356 done; \
1357 echo >> libgo.sum; \
1358 echo " === libgo Summary ===" >> libgo.sum; \
1359 echo >> libgo.sum; \
1360 if test "$$pass" -ne "0"; then \
1361 echo "# of expected passes $$pass" >> libgo.sum; \
1362 fi; \
1363 if test "$$fail" -ne "0"; then \
1364 echo "# of unexpected failures $$fail" >> libgo.sum; \
1365 fi; \
1366 if test "$$untested" -ne "0"; then \
1367 echo "# of untested testcases $$untested" >> libgo.sum; \
1368 fi; \
1369 echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
1370 echo >> libgo.log; \
1371 echo "runtest completed at `date`" >> libgo.log; \
1372 if test "$$fail" -ne "0"; then \
1373 status=1; \
1374 else \
1375 status=0; \
1376 fi; \
1377 exit $$status
1378
1379 check-am:
1380 @rm -f libgo.sum libgo.log libgo.tail
1381 @multivar="unix"; \
1382 [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1383 echo "$${multivar}" > libgo.var
1384 @for f in $(TEST_PACKAGES); do \
1385 rm -f $$f-testsum $$f-testlog; \
1386 done
1387 -@$(MAKE) -k $(TEST_PACKAGES)
1388 @for f in $(TEST_PACKAGES); do \
1389 if test -f $$f-testsum; then \
1390 cat $$f-testsum >> libgo.sum; \
1391 fi; \
1392 if test -f $$f-testlog; then \
1393 cat $$f-testlog >> libgo.log; \
1394 fi; \
1395 done
1396
1397 check-multi:
1398 $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1399
1400 bench:
1401 -@$(MAKE) -k $(TEST_PACKAGES) GOBENCH=.
1402
1403 MOSTLYCLEANFILES = \
1404 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1405 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1406 s-errno s-epoll \
1407 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1408 libcalls-list runtime.inc runtime.inc.tmp2 runtime.inc.tmp3
1409
1410 mostlyclean-local:
1411 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1412 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1413 find . -name '*-testsum' -print | xargs rm -f
1414 find . -name '*-testlog' -print | xargs rm -f
1415
1416 CLEANFILES = *.go *.c s-version libgo.sum libgo.log runtime.inc
1417
1418 clean-local:
1419 find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1420 find . -name '*.a' -print | xargs rm -f
1421 find . -name '*.gox' -print | xargs rm -f
1422 find . -name '*.s-gox' -print | xargs rm -f
1423
1424 distclean-local:
1425 find . -name '*.lo.dep' -print | xargs rm -f