1 # Makefile.am -- Go library Makefile.
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.
7 # Process this file with autoreconf to produce Makefile.in.
10 SUFFIXES = .c .go .gox .o .obj .lo .a
17 GO_EXPORT_SECTION_NAME = __GNU_GO.__go_export
19 GO_EXPORT_SECTION_NAME = .go_export
24 gcc_version := $(shell $(GOC) -dumpversion)
26 MAINT_CHARSET = latin1
28 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
29 PWD_COMMAND = $${PWDCMD-pwd}
30 STAMP = echo timestamp >
32 toolexecdir = $(glibgo_toolexecdir)
33 toolexeclibdir = $(glibgo_toolexeclibdir)
34 toolexeclibgodir = $(nover_glibgo_toolexeclibdir)/go/$(gcc_version)/$(target_alias)
35 libexecsubdir = $(libexecdir)/gcc/$(target_alias)/$(gcc_version)
38 LIBFFIINCS = @LIBFFIINCS@
40 LIBATOMIC = @LIBATOMIC@
42 WARN_CFLAGS = $(WARN_FLAGS) $(WERROR)
44 # -I/-D flags to pass when compiling.
45 AM_CPPFLAGS = -I $(srcdir)/runtime $(LIBFFIINCS) $(PTHREAD_CFLAGS)
47 ACLOCAL_AMFLAGS = -I ./config -I ../config
49 AM_CFLAGS = -fexceptions -fnon-call-exceptions \
50 $(SPLIT_STACK) $(WARN_CFLAGS) \
51 $(STRINGOPS_FLAG) $(HWCAP_CFLAGS) $(OSCFLAGS) \
52 -I $(srcdir)/../libgcc -I $(srcdir)/../libbacktrace \
53 -I $(MULTIBUILDTOP)../../gcc/include
58 AM_LDFLAGS += -XCClinker $(SPLIT_STACK)
62 # Using an import file for libgo avoid requiring to use the -brtl flag
63 # when builing a go program
64 AM_LDFLAGS += -Wl,-bbigtoc -Wl,-bI:$(srcdir)/libgo.imp
65 EXTRA_libgo_la_DEPENDENCIES = libgo.imp
71 # Work around what appears to be a GNU make handling MAKEFLAGS
72 # values defined in terms of make variables, as is the case for CC and
73 # friends when we are called from the top level Makefile.
75 "AR_FLAGS=$(AR_FLAGS)" \
76 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
77 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
79 "CXXFLAGS=$(CXXFLAGS)" \
80 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
81 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
82 "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
84 "GOCFLAGS=$(GOCFLAGS)" \
85 "INSTALL=$(INSTALL)" \
86 "INSTALL_DATA=$(INSTALL_DATA)" \
87 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
88 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
89 "LDFLAGS=$(LDFLAGS)" \
90 "LIBCFLAGS=$(LIBCFLAGS)" \
91 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
93 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
94 "PICFLAG=$(PICFLAG)" \
95 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
97 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
98 "exec_prefix=$(exec_prefix)" \
99 "infodir=$(infodir)" \
101 "includedir=$(includedir)" \
103 "tooldir=$(tooldir)" \
104 "gxx_include_dir=$(gxx_include_dir)" \
110 "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
111 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
112 "DESTDIR=$(DESTDIR)" \
115 # Subdir rules rely on $(FLAGS_TO_PASS)
116 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
119 toolexeclib_LTLIBRARIES = libgo-llgo.la
120 toolexeclib_LIBRARIES = libgobegin-llgo.a
122 toolexeclib_LTLIBRARIES = libgo.la
123 toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
126 noinst_LIBRARIES = libgotool.a
128 toolexeclibgo_DATA = \
160 toolexeclibgoarchivedir = $(toolexeclibgodir)/archive
162 toolexeclibgoarchive_DATA = \
166 toolexeclibgocompressdir = $(toolexeclibgodir)/compress
168 toolexeclibgocompress_DATA = \
175 toolexeclibgocontainerdir = $(toolexeclibgodir)/container
177 toolexeclibgocontainer_DATA = \
182 toolexeclibgocryptodir = $(toolexeclibgodir)/crypto
184 toolexeclibgocrypto_DATA = \
191 crypto/elliptic.gox \
204 toolexeclibgocryptox509dir = $(toolexeclibgocryptodir)/x509
206 toolexeclibgocryptox509_DATA = \
209 toolexeclibgodatabasedir = $(toolexeclibgodir)/database
211 toolexeclibgodatabase_DATA = \
214 toolexeclibgodatabasesqldir = $(toolexeclibgodatabasedir)/sql
216 toolexeclibgodatabasesql_DATA = \
217 database/sql/driver.gox
219 toolexeclibgodebugdir = $(toolexeclibgodir)/debug
221 toolexeclibgodebug_DATA = \
229 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
231 toolexeclibgoencoding_DATA = \
232 encoding/ascii85.gox \
234 encoding/base32.gox \
235 encoding/base64.gox \
236 encoding/binary.gox \
244 toolexeclibgogodir = $(toolexeclibgodir)/go
246 toolexeclibgogo_DATA = \
259 toolexeclibgohashdir = $(toolexeclibgodir)/hash
261 toolexeclibgohash_DATA = \
268 toolexeclibgohtmldir = $(toolexeclibgodir)/html
270 toolexeclibgohtml_DATA = \
273 toolexeclibgoimagedir = $(toolexeclibgodir)/image
275 toolexeclibgoimage_DATA = \
282 toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
284 toolexeclibgoimagecolor_DATA = \
285 image/color/palette.gox
287 toolexeclibgoindexdir = $(toolexeclibgodir)/index
289 toolexeclibgoindex_DATA = \
290 index/suffixarray.gox
292 toolexeclibgoiodir = $(toolexeclibgodir)/io
294 toolexeclibgoio_DATA = \
297 toolexeclibgologdir = $(toolexeclibgodir)/log
299 toolexeclibgolog_DATA = \
302 toolexeclibgomathdir = $(toolexeclibgodir)/math
304 toolexeclibgomath_DATA = \
310 toolexeclibgomimedir = $(toolexeclibgodir)/mime
312 toolexeclibgomime_DATA = \
314 mime/quotedprintable.gox
316 toolexeclibgonetdir = $(toolexeclibgodir)/net
318 toolexeclibgonet_DATA = \
326 toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
328 toolexeclibgonethttp_DATA = \
330 net/http/cookiejar.gox \
332 net/http/httptest.gox \
333 net/http/httptrace.gox \
334 net/http/httputil.gox \
337 toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
339 toolexeclibgonetrpc_DATA = \
342 toolexeclibgoosdir = $(toolexeclibgodir)/os
344 toolexeclibgoos_DATA = \
349 toolexeclibgopathdir = $(toolexeclibgodir)/path
351 toolexeclibgopath_DATA = \
354 toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
356 toolexeclibgoregexp_DATA = \
359 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
361 toolexeclibgoruntime_DATA = \
366 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
368 toolexeclibgosync_DATA = \
371 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
373 toolexeclibgotesting_DATA = \
377 toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
379 toolexeclibgotestinginternal_DATA = \
380 testing/internal/testdeps.gox
382 toolexeclibgotextdir = $(toolexeclibgodir)/text
384 toolexeclibgotext_DATA = \
389 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
391 toolexeclibgotexttemplate_DATA = \
392 text/template/parse.gox
394 toolexeclibgotimedir = $(toolexeclibgodir)/time
396 toolexeclibgotime_DATA = \
399 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
401 toolexeclibgounicode_DATA = \
405 # Some internal packages are needed to bootstrap the gc toolchain.
406 toolexeclibgointernaldir = $(toolexeclibgodir)/internal
407 toolexeclibgointernal_DATA = \
408 internal/reflectlite.gox \
409 internal/unsafeheader.gox
411 # Some packages are only needed for tests, so unlike the other
412 # internal packages nothing will explicitly depend on them.
413 # Force them to be built.
415 golang.org/x/net/nettest.gox \
417 internal/obscuretestdata.gox \
418 internal/profile.gox \
419 internal/testenv.gox \
421 net/internal/socktest.gox \
422 os/signal/internal/pty.gox
425 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
427 rtems_task_variable_add_file =
430 runtime_context_asm_file =
433 runtime_context_asm_file += runtime/go-context.S
439 runtime/go-assert.c \
440 runtime/go-caller.c \
441 runtime/go-callers.c \
444 runtime/go-construct-map.c \
446 runtime/go-fieldtrack.c \
447 runtime/go-matherr.c \
448 runtime/go-memclr.c \
449 runtime/go-memequal.c \
450 runtime/go-nanotime.c \
453 runtime/go-reflect-call.c \
454 runtime/go-setenv.c \
455 runtime/go-signal.c \
456 runtime/go-unsafe-pointer.c \
457 runtime/go-unsetenv.c \
458 runtime/go-unwind.c \
459 runtime/go-varargs.c \
460 runtime/env_posix.c \
464 runtime/runtime_c.c \
467 $(runtime_context_asm_file) \
468 $(rtems_task_variable_add_file)
470 version.go: s-version; @true
473 echo "package sys" > version.go.tmp
474 echo 'func init() { 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; \
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; \
496 echo "const Goarch$${n} = 0" >> version.go.tmp; \
499 echo >> version.go.tmp
500 echo "const (" >> version.go.tmp
501 echo " ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> version.go.tmp
502 echo " BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> version.go.tmp
503 echo " CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> version.go.tmp
504 echo " DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> version.go.tmp
505 echo " Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> version.go.tmp
506 echo " MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> version.go.tmp
507 echo " PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> version.go.tmp
508 echo ")" >> version.go.tmp
509 echo >> version.go.tmp
510 for a in $(ALLGOOS); do \
511 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
512 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
513 if test "$${a}" = "$(GOOS)"; then \
514 echo "const Goos$${n} = 1" >> version.go.tmp; \
516 echo "const Goos$${n} = 0" >> version.go.tmp; \
519 echo >> version.go.tmp
520 echo "type Uintreg uintptr" >> version.go.tmp
521 $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
524 cpugen.go: s-cpu; @true
527 echo "package cpu" > cpugen.go.tmp
528 echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
529 echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
530 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
533 gcpugen.go: s-gcpu; @true
536 echo "package cpu" > gcpugen.go.tmp
537 echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
538 $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
541 objabi.go: s-objabi; @true
544 echo "package objabi" > objabi.go.tmp
545 echo "import \"runtime\"" >> objabi.go.tmp
546 echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> objabi.go.tmp
547 echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp
548 echo 'const defaultGOARM = `5`' >> objabi.go.tmp
549 echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp
550 echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp
551 echo 'const defaultGOPPC64 = `power8`' >> objabi.go.tmp
552 echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp
553 echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp
554 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp
555 echo 'const defaultGO_LDSO = ``' >> objabi.go.tmp
556 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> objabi.go.tmp
557 echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
558 echo 'const goexperiment = ``' >> objabi.go.tmp
559 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
562 gccgosizes.go: s-gccgosizes; @true
563 s-gccgosizes: Makefile goarch.sh
564 rm -f gccgosizes.go.tmp
565 echo "package types" > gccgosizes.go.tmp
566 echo >> gccgosizes.go.tmp
567 echo "var gccgoArchSizes = map[string]*StdSizes{" >> gccgosizes.go.tmp
568 for a in $(ALLGOARCH); do \
569 ptrsize=`$(SHELL) $(srcdir)/goarch.sh $$a ptrsize`; \
570 maxalign=`$(SHELL) $(srcdir)/goarch.sh $$a maxalign`; \
571 echo " \"$$a\": {$${ptrsize}, $${maxalign}}," >> gccgosizes.go.tmp; \
573 echo "}" >> gccgosizes.go.tmp
574 $(SHELL) $(srcdir)/mvifdiff.sh gccgosizes.go.tmp gccgosizes.go
577 os_linknames.go: s-os_linknames; @true
578 s-os_linknames: os-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/*.go
579 rm -f os_linknames.go.tmp
580 $(AWK) -f $(srcdir)/mklinknames.awk -v package=os `cat os-list` > os_linknames.go.tmp
581 $(SHELL) $(srcdir)/mvifdiff.sh os_linknames.go.tmp os_linknames.go
584 os-list: s-os-list; @true
585 s-os-list: Makefile $(srcdir)/go/os/*.go
587 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os > os-list.tmp
588 $(SHELL) $(srcdir)/mvifdiff.sh os-list.tmp os-list
591 os_user_linknames.go: s-os_user_linknames; @true
592 s-os_user_linknames: os-user-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/user/*.go
593 rm -f os_user_linknames.go.tmp
594 $(AWK) -f $(srcdir)/mklinknames.awk -v package=user `cat os-user-list` > os_user_linknames.go.tmp
595 $(SHELL) $(srcdir)/mvifdiff.sh os_user_linknames.go.tmp os_user_linknames.go
598 os-user-list: s-os-user-list; @true
599 s-os-user-list: Makefile $(srcdir)/go/os/user/*.go
600 rm -f os-user-list.tmp
601 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os/user > os-user-list.tmp
602 $(SHELL) $(srcdir)/mvifdiff.sh os-user-list.tmp os-user-list
605 runtime_linknames.go: s-runtime_linknames; @true
606 s-runtime_linknames: runtime-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/runtime/*.go
607 rm -f runtime_linknames.go.tmp
608 $(AWK) -f $(srcdir)/mklinknames.awk -v package=runtime `cat runtime-list` > runtime_linknames.go.tmp
609 $(SHELL) $(srcdir)/mvifdiff.sh runtime_linknames.go.tmp runtime_linknames.go
612 runtime-list: s-runtime-list; @true
613 s-runtime-list: Makefile $(srcdir)/go/runtime/*.go
614 rm -f runtime-list.tmp
615 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/runtime > runtime-list.tmp
616 $(SHELL) $(srcdir)/mvifdiff.sh runtime-list.tmp runtime-list
619 runtime_sysinfo.go: s-runtime_sysinfo; @true
620 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
621 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
622 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
625 sigtab.go: s-sigtab; @true
626 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
627 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
628 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
631 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
632 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
633 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
635 zdefaultcc.go: s-zdefaultcc; @true
636 s-zdefaultcc: Makefile
637 echo 'package cfg' > zdefaultcc.go.tmp
638 echo >> zdefaultcc.go.tmp
639 echo 'func DefaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
640 echo 'func DefaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
641 echo 'func DefaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
642 echo 'const DefaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
643 echo 'var OSArchSupportsCgo = map[string]bool{}' >> zdefaultcc.go.tmp
644 $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
647 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
648 # compiling runtime) to prune out certain types that should not be
649 # exported back to C. See comments in mkruntimeinc.sh for more details.
650 runtime.inc: s-runtime-inc; @true
651 s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
652 $(SHELL) $(srcdir)/mkruntimeinc.sh
653 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
656 noinst_DATA += zdefaultcc.go
658 # Generate the list of go std packages that were included in libgo
659 zstdpkglist.go: s-zstdpkglist; @true
660 s-zstdpkglist: Makefile
661 rm -f zstdpkglist.go.tmp
662 echo 'package goroot' > zstdpkglist.go.tmp
663 echo "" >> zstdpkglist.go.tmp
664 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
665 echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|golang\.org/[a-z0-9_./]*\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp
666 echo '}' >> zstdpkglist.go.tmp
667 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
671 syscall_epoll_file = epoll.go
676 libcalls.go: s-libcalls; @true
677 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
678 rm -f libcalls.go.tmp
679 $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
680 $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
683 libcalls-list: s-libcalls-list; @true
684 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
685 rm -f libcalls-list.tmp
686 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
687 $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
690 syscall_arch.go: s-syscall_arch; @true
691 s-syscall_arch: Makefile
692 rm -f syscall_arch.go.tmp
693 echo "package syscall" > syscall_arch.go.tmp
694 echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
695 echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
696 $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
699 syscall_linknames.go: s-syscall_linknames; @true
700 s-syscall_linknames: libcalls.go gen-sysinfo.go $(srcdir)/mklinknames.awk
701 rm -f syscall_linknames.go.tmp
702 $(AWK) -v package=syscall -f $(srcdir)/mklinknames.awk libcalls.go > syscall_linknames.go.tmp
703 $(SHELL) $(srcdir)/mvifdiff.sh syscall_linknames.go.tmp syscall_linknames.go
707 $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
708 $(CPPFLAGS) $(OSCFLAGS) -O
710 gen-sysinfo.go: s-gen-sysinfo; @true
711 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
712 $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
714 $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
717 errno.i: s-errno; @true
719 echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
720 $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
723 sysinfo.go: s-sysinfo; @true
724 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
725 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
726 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
729 # The epoll struct has an embedded union and is packed on x86_64,
730 # which is too complicated for mksysinfo.sh. We find the offset of
731 # the only field we care about in configure.ac, and generate the
733 epoll.go: s-epoll; @true
736 echo 'package syscall' > epoll.go.tmp
737 echo 'type EpollEvent struct {' >> epoll.go.tmp
738 echo ' Events uint32' >> epoll.go.tmp
739 case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
740 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
742 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
743 12,4) echo ' Fd int32' >> epoll.go.tmp; \
744 echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
745 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
746 echo ' Fd int32' >> epoll.go.tmp; ;; \
747 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
748 echo ' Fd int32' >> epoll.go.tmp; \
749 echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
750 *) echo 1>&2 "*** struct epoll_event unsupported"; \
753 echo '}' >> epoll.go.tmp
754 $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
758 syscall_lib_clone_lo = syscall/clone_linux.lo
760 syscall_lib_clone_lo =
764 golangorg_x_sys_cpu_gccgo_x86_lo = golang.org/x/sys/cpu_gccgo_x86.lo
766 golangorg_x_sys_cpu_gccgo_x86_lo =
769 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
772 $(addsuffix .lo,$(PACKAGES)) \
773 internal/bytealg/bytealg.lo \
774 reflect/makefunc_ffi_c.lo \
775 $(syscall_lib_clone_lo) \
779 $(golangorg_x_net_lif_lo) \
780 $(golangorg_x_net_route_lo) \
781 log/syslog/syslog_c.lo \
782 $(os_lib_inotify_lo) \
783 runtime/internal/atomic_c.lo \
785 internal/cpu/cpu_gccgo.lo \
786 $(golangorg_x_sys_cpu_gccgo_x86_lo)
789 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
792 $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
793 $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
795 libgo_la_SOURCES = $(runtime_files)
796 libgo_la_LDFLAGS = $(libgo_ldflags)
797 libgo_la_LIBADD = $(libgo_libadd)
799 libgo_llgo_la_SOURCES = $(runtime_files)
800 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
801 libgo_llgo_la_LIBADD = $(libgo_libadd)
803 libgobegin_a_SOURCES = \
806 libgobegin_llgo_a_SOURCES = \
809 # Use -fPIC for libgobegin so that it can be put in a PIE.
810 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
811 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
813 libgolibbegin_a_SOURCES = \
816 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
818 GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
820 libgotool_a_SOURCES =
821 libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
822 libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
824 define STATIC_template
825 $(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
828 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
830 # Make sure runtime.inc is built before compiling any .c file.
831 $(libgo_la_OBJECTS): runtime.inc
832 $(libgo_llgo_la_OBJECTS): runtime.inc
833 $(libgobegin_a_OBJECTS): runtime.inc
834 $(libgobegin_llgo_a_OBJECTS): runtime.inc
835 $(libgolibbegin_a_OBJECTS): runtime.inc
837 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
840 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
841 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
843 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
844 $(AM_GOCFLAGS) $(GOCFLAGS)
846 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
847 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
849 # Build the dependencies for a Go package.
852 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
853 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(subst .lo.dep,,$@))))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \
854 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
855 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
856 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
860 # Build the .go files for a package, generating a .lo file.
863 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
864 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
866 # How to build a .gox file from a .lo file.
867 # Matching .o file can either be in the same directory as the .lo (non-PIC
868 # object) or in the .libs directory (PIC object).
870 f="$(basename $<).o"; \
871 if test ! -f $$f; then \
872 f="$(basename $(<D)/.libs/$(<F)).o"; \
874 $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
875 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
882 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
884 GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
886 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
887 export RUNTESTFLAGS; \
892 libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
893 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
894 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
895 export LD_LIBRARY_PATH; \
897 rm -f $@-testsum $@-testlog; \
898 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
899 if test "$(USE_DEJAGNU)" = "yes"; then \
900 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
901 elif test "$(GOBENCH)" != ""; then \
902 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
904 if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
905 echo "PASS: $(@D)" >> $@-testlog; \
906 echo "PASS: $(@D)"; \
907 echo "PASS: $(@D)" > $@-testsum; \
909 echo "FAIL: $(@D)" >> $@-testlog; \
911 echo "FAIL: $(@D)" > $@-testsum; \
916 # Build all packages before checking any.
918 $(toolexeclibgo_DATA) \
919 $(toolexeclibgoarchive_DATA) \
920 $(toolexeclibgocompress_DATA) \
921 $(toolexeclibgocontainer_DATA) \
922 $(toolexeclibgocrypto_DATA) \
923 $(toolexeclibgodebug_DATA) \
924 $(toolexeclibgoencoding_DATA) \
925 $(toolexeclibgogo_DATA) \
926 $(toolexeclibgohash_DATA) \
927 $(toolexeclibgoimage_DATA) \
928 $(toolexeclibgoindex_DATA) \
929 $(toolexeclibgoio_DATA) \
930 $(toolexeclibgolog_DATA) \
931 $(toolexeclibgomath_DATA) \
932 $(toolexeclibgomime_DATA) \
933 $(toolexeclibgonet_DATA) \
934 $(toolexeclibgonethttp_DATA) \
935 $(toolexeclibgoos_DATA) \
936 $(toolexeclibgopath_DATA) \
937 $(toolexeclibgorpc_DATA) \
938 $(toolexeclibgoruntime_DATA) \
939 $(toolexeclibgosync_DATA) \
940 $(toolexeclibgotesting_DATA) \
941 $(toolexeclibgotext_DATA) \
942 $(toolexeclibgotexttemplate_DATA) \
943 $(toolexeclibgounicode_DATA) \
948 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
950 CHECK_DEPS += libgo.la libgobegin.a
953 # PACKAGE_template defines the rules for each package.
954 # For example, for the package bufio, it produces:
956 # @go_include@ bufio.lo.dep
957 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
961 # bufio/check: $(CHECK_DEPS)
963 # .PHONY: bufio/check
965 # This is invoked with $(1) set to a package, which is a directory name,
966 # such as "bufio" or "archive/tar".
967 define PACKAGE_template
968 @go_include@ $(1).lo.dep
969 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
973 $(1)/check: $$(CHECK_DEPS)
976 $(1).gox: $(1).s-gox; @true
982 # This line expands PACKAGE_template once for each package name listed
984 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
985 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call PACKAGE_template,$(package))))
987 # Pass -ffp-contract=off, or 386-specific options, when building the
988 # math package. MATH_FLAG is defined in configure.ac.
989 math_lo_GOCFLAGS = $(MATH_FLAG)
990 math_check_GOCFLAGS = $(MATH_FLAG)
992 # Add generated files to the runtime package.
993 extra_go_files_runtime = runtime_linknames.go runtime_sysinfo.go sigtab.go
994 runtime.lo.dep: $(extra_go_files_runtime)
996 # Add generated files to the syscall package.
997 extra_go_files_syscall = \
1001 syscall_linknames.go \
1002 $(syscall_epoll_file)
1003 syscall.lo.dep: $(extra_go_files_syscall)
1005 # Pass -fgo-compiling-runtime when compiling the runtime package.
1006 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -fgo-compiling-runtime
1007 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1008 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1009 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1010 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1011 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1013 # If libffi is supported (the normal case) use the ffi build tag for
1014 # the runtime package.
1016 matchargs_runtime = --tag=libffi
1021 # At least for now, we need -static-libgo for this test, because
1022 # otherwise we can't get the line numbers.
1023 # Also use -fno-inline to get better results from the memory profiler.
1024 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1027 # reflect tests must be done with -static-libgo. Otherwize,
1028 # there will be a duplication of the canonicalization map.
1029 reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
1033 # Use -static for the syscall tests if possible, because otherwise when
1034 # running as root the re-execs ignore LD_LIBRARY_PATH.
1035 syscall_check_GOCFLAGS = -static
1038 extra_go_files_runtime_internal_sys = version.go
1039 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1041 extra_go_files_internal_cpu = cpugen.go
1042 internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
1044 extra_go_files_golang_org_x_sys_cpu = gcpugen.go
1045 golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
1047 extra_go_files_internal_goroot = zstdpkglist.go
1048 internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
1050 extra_go_files_go_types = gccgosizes.go
1051 go/types.lo.dep: $(extra_go_files_go_types)
1053 extra_go_files_cmd_internal_objabi = objabi.go
1054 cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
1056 extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
1057 cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
1059 extra_go_files_os = os_linknames.go
1060 os.lo.dep: $(extra_go_files_os)
1062 extra_go_files_os_user = os_user_linknames.go
1063 os/user.lo.dep: $(extra_go_files_os_user)
1065 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
1066 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
1067 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
1068 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
1069 extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
1070 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
1071 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
1072 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
1073 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
1074 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
1075 extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
1076 extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
1077 extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
1078 extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
1079 extra_check_libs_cmd_go_internal_test = $(abs_builddir)/libgotool.a
1080 extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
1081 extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
1083 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
1085 # FIXME: The following C files may as well move to the runtime
1086 # directory and be treated like other C files.
1088 # Use C code to speed up internal/bytealg.IndexByte and friends.
1089 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
1090 @$(MKDIR_P) internal/bytealg
1091 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
1093 # Use a C function with a fixed number of arguments to call a C
1095 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1096 @$(MKDIR_P) log/syslog
1097 $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1099 # The interface to libffi from the reflect package is written in C.
1100 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1102 $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1104 # The atomic functions are written in C.
1105 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1106 @$(MKDIR_P) runtime/internal
1107 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1108 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1110 $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1112 # A few syscall functions are written in C.
1113 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1115 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1116 syscall/errno.lo: go/syscall/errno.c runtime.inc
1118 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1119 syscall/signame.lo: go/syscall/signame.c runtime.inc
1121 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1122 syscall/wait.lo: go/syscall/wait.c runtime.inc
1124 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1126 # internal/cpu needs some C code.
1127 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
1128 @$(MKDIR_P) internal/cpu
1129 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
1131 # Similarly, golang.org/x/sys/cpu needs some C code.
1132 golang.org/x/sys/cpu_gccgo_x86.lo: go/golang.org/x/sys/cpu/cpu_gccgo_x86.c runtime.inc
1133 @$(MKDIR_P) golang.org/x/sys
1134 $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo_x86.c
1136 # Solaris 11.4 changed the type of fields in struct stat.
1137 # Use a build tag, based on a configure check, to cope.
1139 if HAVE_STAT_TIMESPEC
1140 matchargs_os = --tag=solaristag
1150 # Build golang.org/x/net/route only on BSD systems.
1152 $(eval $(call PACKAGE_template,golang.org/x/net/route))
1154 golangorg_x_net_route_lo = \
1155 golang.org/x/net/route.lo
1161 # Build golang.org/x/net/lif only on Solaris systems.
1163 $(eval $(call PACKAGE_template,golang.org/x/net/lif))
1165 golangorg_x_net_lif_lo = \
1166 golang.org/x/net/lif.lo
1170 TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
1173 check-recursive: check-head
1176 @echo "Test Run By $${USER} on `date`" > libgo.head
1177 @echo "Native configuration is $(host_triplet)" >> libgo.head
1179 @echo " === libgo tests ===" >> libgo.head
1182 check-tail: check-recursive check-multi
1183 @if test "$(USE_DEJAGNU)" = "yes"; then \
1186 lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1187 for dir in . $(MULTIDIRS); do \
1188 mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1189 mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1191 mv libgo.head libgo.sum; \
1192 cp libgo.sum libgo.log; \
1193 echo "Schedule of variations:" >> libgo.sum; \
1194 for dir in . $(MULTIDIRS); do \
1195 multidir=../$${dir}/$${lib}; \
1196 multivar=`cat $${multidir}/libgo.var`; \
1197 echo " $${multivar}" >> libgo.sum; \
1199 echo >> libgo.sum; \
1200 pass=0; fail=0; untested=0; \
1201 for dir in . $(MULTIDIRS); do \
1202 multidir=../$${dir}/$${lib}; \
1203 multivar=`cat $${multidir}/libgo.var`; \
1204 echo "Running target $${multivar}" >> libgo.sum; \
1205 echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1206 cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1207 cat $${multidir}/libgo.log.sep >> libgo.log; \
1208 if test -n "${MULTIDIRS}"; then \
1209 echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
1210 echo >> libgo.sum; \
1212 p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1213 pass=`expr $$pass + $$p`; \
1214 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1215 echo "# of expected passes $$p" >> libgo.sum; \
1217 p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1218 fail=`expr $$fail + $$p`; \
1219 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1220 echo "# of unexpected failures $$p" >> libgo.sum; \
1222 p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1223 untested=`expr $$untested + $$p`; \
1224 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1225 echo "# of untested testcases $$p" >> libgo.sum; \
1228 echo >> libgo.sum; \
1229 echo " === libgo Summary ===" >> libgo.sum; \
1230 echo >> libgo.sum; \
1231 if test "$$pass" -ne "0"; then \
1232 echo "# of expected passes $$pass" >> libgo.sum; \
1234 if test "$$fail" -ne "0"; then \
1235 echo "# of unexpected failures $$fail" >> libgo.sum; \
1237 if test "$$untested" -ne "0"; then \
1238 echo "# of untested testcases $$untested" >> libgo.sum; \
1240 echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
1241 echo >> libgo.log; \
1242 echo "runtest completed at `date`" >> libgo.log; \
1243 if test "$$fail" -ne "0"; then \
1251 @rm -f libgo.sum libgo.log libgo.tail
1253 [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1254 echo "$${multivar}" > libgo.var
1255 @for f in $(TEST_PACKAGES); do \
1256 rm -f $$f-testsum $$f-testlog; \
1258 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES)
1259 @for f in $(TEST_PACKAGES); do \
1260 if test -f $$f-testsum; then \
1261 cat $$f-testsum >> libgo.sum; \
1263 if test -f $$f-testlog; then \
1264 cat $$f-testlog >> libgo.log; \
1269 $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1272 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=.
1274 MOSTLYCLEANFILES = \
1275 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1276 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1278 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1280 runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
1283 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1284 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1285 find . -name '*-testsum' -print | xargs rm -f
1286 find . -name '*-testlog' -print | xargs rm -f
1288 CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
1291 find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1292 find . -name '*.a' -print | xargs rm -f
1293 find . -name '*.gox' -print | xargs rm -f
1294 find . -name '*.s-gox' -print | xargs rm -f
1297 find . -name '*.lo.dep' -print | xargs rm -f
1299 include $(top_srcdir)/../multilib.am
1302 ALL_LOCAL_DEPS = add-aix-fat-library
1306 all-local: $(ALL_LOCAL_DEPS)
1308 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
1310 # If we want to use "AR -r" when creating AIX FAT archives,
1311 # AR must be stripped of all its -X flags.
1312 # Otherwize, if AR was defined with -X32_64, the replace option would
1313 # erase the default .so when adding the extra one. There is no
1314 # order priority within -X flags.
1315 add-aix-fat-library: all-multi
1316 @if test "$(MULTIBUILDTOP)" = ""; then \
1317 arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
1318 $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1319 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1320 $${arx} -X$(AIX_EXTRA_ARCH) rc libgobegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1321 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgobegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1322 $${arx} -X$(AIX_EXTRA_ARCH) rc libgolibbegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
1323 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgolibbegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \