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 = \
161 toolexeclibgoarchivedir = $(toolexeclibgodir)/archive
163 toolexeclibgoarchive_DATA = \
167 toolexeclibgocompressdir = $(toolexeclibgodir)/compress
169 toolexeclibgocompress_DATA = \
176 toolexeclibgocontainerdir = $(toolexeclibgodir)/container
178 toolexeclibgocontainer_DATA = \
183 toolexeclibgocryptodir = $(toolexeclibgodir)/crypto
185 toolexeclibgocrypto_DATA = \
192 crypto/elliptic.gox \
205 toolexeclibgocryptox509dir = $(toolexeclibgocryptodir)/x509
207 toolexeclibgocryptox509_DATA = \
210 toolexeclibgodatabasedir = $(toolexeclibgodir)/database
212 toolexeclibgodatabase_DATA = \
215 toolexeclibgodatabasesqldir = $(toolexeclibgodatabasedir)/sql
217 toolexeclibgodatabasesql_DATA = \
218 database/sql/driver.gox
220 toolexeclibgodebugdir = $(toolexeclibgodir)/debug
222 toolexeclibgodebug_DATA = \
230 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
232 toolexeclibgoencoding_DATA = \
233 encoding/ascii85.gox \
235 encoding/base32.gox \
236 encoding/base64.gox \
237 encoding/binary.gox \
245 toolexeclibgogodir = $(toolexeclibgodir)/go
247 toolexeclibgogo_DATA = \
260 toolexeclibgogobuilddir = $(toolexeclibgogodir)/build
262 toolexeclibgogobuild_DATA = \
263 go/build/constraint.gox
265 toolexeclibgohashdir = $(toolexeclibgodir)/hash
267 toolexeclibgohash_DATA = \
274 toolexeclibgohtmldir = $(toolexeclibgodir)/html
276 toolexeclibgohtml_DATA = \
279 toolexeclibgoimagedir = $(toolexeclibgodir)/image
281 toolexeclibgoimage_DATA = \
288 toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
290 toolexeclibgoimagecolor_DATA = \
291 image/color/palette.gox
293 toolexeclibgoindexdir = $(toolexeclibgodir)/index
295 toolexeclibgoindex_DATA = \
296 index/suffixarray.gox
298 toolexeclibgoiodir = $(toolexeclibgodir)/io
300 toolexeclibgoio_DATA = \
304 toolexeclibgologdir = $(toolexeclibgodir)/log
306 toolexeclibgolog_DATA = \
309 toolexeclibgomathdir = $(toolexeclibgodir)/math
311 toolexeclibgomath_DATA = \
317 toolexeclibgomimedir = $(toolexeclibgodir)/mime
319 toolexeclibgomime_DATA = \
321 mime/quotedprintable.gox
323 toolexeclibgonetdir = $(toolexeclibgodir)/net
325 toolexeclibgonet_DATA = \
333 toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
335 toolexeclibgonethttp_DATA = \
337 net/http/cookiejar.gox \
339 net/http/httptest.gox \
340 net/http/httptrace.gox \
341 net/http/httputil.gox \
344 toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
346 toolexeclibgonetrpc_DATA = \
349 toolexeclibgoosdir = $(toolexeclibgodir)/os
351 toolexeclibgoos_DATA = \
356 toolexeclibgopathdir = $(toolexeclibgodir)/path
358 toolexeclibgopath_DATA = \
361 toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
363 toolexeclibgoregexp_DATA = \
366 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
368 toolexeclibgoruntime_DATA = \
371 runtime/metrics.gox \
375 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
377 toolexeclibgosync_DATA = \
380 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
382 toolexeclibgotesting_DATA = \
387 toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
389 toolexeclibgotestinginternal_DATA = \
390 testing/internal/testdeps.gox
392 toolexeclibgotextdir = $(toolexeclibgodir)/text
394 toolexeclibgotext_DATA = \
399 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
401 toolexeclibgotexttemplate_DATA = \
402 text/template/parse.gox
404 toolexeclibgotimedir = $(toolexeclibgodir)/time
406 toolexeclibgotime_DATA = \
409 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
411 toolexeclibgounicode_DATA = \
415 # Some internal packages are needed to bootstrap the gc toolchain.
416 toolexeclibgointernaldir = $(toolexeclibgodir)/internal
417 toolexeclibgointernal_DATA = \
418 internal/reflectlite.gox \
419 internal/unsafeheader.gox
421 # Some packages are only needed for tests, so unlike the other
422 # internal packages nothing will explicitly depend on them.
423 # Force them to be built.
425 golang.org/x/net/nettest.gox \
427 internal/obscuretestdata.gox \
428 internal/profile.gox \
429 internal/testenv.gox \
431 net/internal/socktest.gox \
432 os/signal/internal/pty.gox \
433 reflect/internal/example1.gox \
434 reflect/internal/example2.gox
437 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
439 rtems_task_variable_add_file =
442 runtime_context_asm_file =
445 runtime_context_asm_file += runtime/go-context.S
451 runtime/go-assert.c \
452 runtime/go-caller.c \
453 runtime/go-callers.c \
455 runtime/go-construct-map.c \
457 runtime/go-fieldtrack.c \
458 runtime/go-matherr.c \
459 runtime/go-memclr.c \
460 runtime/go-memmove.c \
461 runtime/go-memequal.c \
462 runtime/go-nanotime.c \
465 runtime/go-reflect-call.c \
466 runtime/go-setenv.c \
467 runtime/go-signal.c \
468 runtime/go-unsafe-pointer.c \
469 runtime/go-unsetenv.c \
470 runtime/go-unwind.c \
471 runtime/go-varargs.c \
472 runtime/env_posix.c \
476 runtime/runtime_c.c \
479 $(runtime_context_asm_file) \
480 $(rtems_task_variable_add_file)
482 version.go: s-version; @true
485 echo "package sys" > version.go.tmp
486 echo 'const GOARCH = "'$(GOARCH)'"' >> version.go.tmp
487 echo 'const GOOS = "'$(GOOS)'"' >> version.go.tmp
488 echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
489 echo 'const StackGuardMultiplierDefault = 1' >> version.go.tmp
490 echo >> version.go.tmp
491 echo "const (" >> version.go.tmp
492 echo " UNKNOWN ArchFamilyType = iota" >> version.go.tmp
493 for a in $(ALLGOARCHFAMILY); do \
494 echo " $${a}" >> version.go.tmp; \
496 echo ")" >> version.go.tmp
497 echo >> version.go.tmp
498 for a in $(ALLGOARCH); do \
499 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
500 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
501 if test "$${a}" = "$(GOARCH)"; then \
502 echo "const Goarch$${n} = 1" >> version.go.tmp; \
504 echo "const Goarch$${n} = 0" >> version.go.tmp; \
507 echo >> version.go.tmp
508 echo "const (" >> version.go.tmp
509 echo " _ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> version.go.tmp
510 echo " _BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> version.go.tmp
511 echo " _DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> version.go.tmp
512 echo " _Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> version.go.tmp
513 echo " _MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> version.go.tmp
514 echo " _PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> version.go.tmp
515 echo " _StackAlign = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) stackalign`" >> version.go.tmp
516 echo ")" >> version.go.tmp
517 echo >> version.go.tmp
518 for a in $(ALLGOOS); do \
519 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
520 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
521 if test "$${a}" = "$(GOOS)"; then \
522 echo "const Goos$${n} = 1" >> version.go.tmp; \
524 echo "const Goos$${n} = 0" >> version.go.tmp; \
527 echo >> version.go.tmp
528 $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
531 cpugen.go: s-cpu; @true
534 echo "package cpu" > cpugen.go.tmp
535 echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
536 echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
537 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
540 gcpugen.go: s-gcpu; @true
543 echo "package cpu" > gcpugen.go.tmp
544 echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
545 $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
548 goroot.go: s-goroot; @true
551 echo "package runtime" > goroot.go.tmp
552 echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp
553 $(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go
556 buildcfg.go: s-buildcfg; @true
558 rm -f buildcfg.go.tmp
559 echo "package buildcfg" > buildcfg.go.tmp
560 echo "import \"runtime\"" >> buildcfg.go.tmp
561 echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> buildcfg.go.tmp
562 echo 'const defaultGO386 = `sse2`' >> buildcfg.go.tmp
563 echo 'const defaultGOARM = `5`' >> buildcfg.go.tmp
564 echo 'const defaultGOMIPS = `hardfloat`' >> buildcfg.go.tmp
565 echo 'const defaultGOMIPS64 = `hardfloat`' >> buildcfg.go.tmp
566 echo 'const defaultGOPPC64 = `power8`' >> buildcfg.go.tmp
567 echo 'const defaultGOEXPERIMENT = `fieldtrack`' >> buildcfg.go.tmp
568 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> buildcfg.go.tmp
569 echo 'const defaultGO_LDSO = ``' >> buildcfg.go.tmp
570 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> buildcfg.go.tmp
571 echo 'const defaultGOOS = runtime.GOOS' >> buildcfg.go.tmp
572 echo 'const defaultGOARCH = runtime.GOARCH' >> buildcfg.go.tmp
573 $(SHELL) $(srcdir)/mvifdiff.sh buildcfg.go.tmp buildcfg.go
576 objabi.go: s-objabi; @true
579 echo "package objabi" > objabi.go.tmp
580 echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
581 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
584 gccgosizes.go: s-gccgosizes; @true
585 s-gccgosizes: Makefile goarch.sh
586 rm -f gccgosizes.go.tmp
587 echo "package types" > gccgosizes.go.tmp
588 echo >> gccgosizes.go.tmp
589 echo "var gccgoArchSizes = map[string]*StdSizes{" >> gccgosizes.go.tmp
590 for a in $(ALLGOARCH); do \
591 ptrsize=`$(SHELL) $(srcdir)/goarch.sh $$a ptrsize`; \
592 maxalign=`$(SHELL) $(srcdir)/goarch.sh $$a maxalign`; \
593 echo " \"$$a\": {$${ptrsize}, $${maxalign}}," >> gccgosizes.go.tmp; \
595 echo "}" >> gccgosizes.go.tmp
596 $(SHELL) $(srcdir)/mvifdiff.sh gccgosizes.go.tmp gccgosizes.go
599 os_linknames.go: s-os_linknames; @true
600 s-os_linknames: os-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/*.go
601 rm -f os_linknames.go.tmp
602 $(AWK) -f $(srcdir)/mklinknames.awk -v package=os `cat os-list` > os_linknames.go.tmp
603 $(SHELL) $(srcdir)/mvifdiff.sh os_linknames.go.tmp os_linknames.go
606 os-list: s-os-list; @true
607 s-os-list: Makefile $(srcdir)/go/os/*.go
609 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os > os-list.tmp
610 $(SHELL) $(srcdir)/mvifdiff.sh os-list.tmp os-list
613 os_user_linknames.go: s-os_user_linknames; @true
614 s-os_user_linknames: os-user-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/user/*.go
615 rm -f os_user_linknames.go.tmp
616 $(AWK) -f $(srcdir)/mklinknames.awk -v package=user `cat os-user-list` > os_user_linknames.go.tmp
617 $(SHELL) $(srcdir)/mvifdiff.sh os_user_linknames.go.tmp os_user_linknames.go
620 os-user-list: s-os-user-list; @true
621 s-os-user-list: Makefile $(srcdir)/go/os/user/*.go
622 rm -f os-user-list.tmp
623 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os/user > os-user-list.tmp
624 $(SHELL) $(srcdir)/mvifdiff.sh os-user-list.tmp os-user-list
627 runtime_linknames.go: s-runtime_linknames; @true
628 s-runtime_linknames: runtime-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/runtime/*.go
629 rm -f runtime_linknames.go.tmp
630 $(AWK) -f $(srcdir)/mklinknames.awk -v package=runtime `cat runtime-list` > runtime_linknames.go.tmp
631 $(SHELL) $(srcdir)/mvifdiff.sh runtime_linknames.go.tmp runtime_linknames.go
634 runtime-list: s-runtime-list; @true
635 s-runtime-list: Makefile $(srcdir)/go/runtime/*.go
636 rm -f runtime-list.tmp
637 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/runtime > runtime-list.tmp
638 $(SHELL) $(srcdir)/mvifdiff.sh runtime-list.tmp runtime-list
641 runtime_sysinfo.go: s-runtime_sysinfo; @true
642 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
643 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
644 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
647 sigtab.go: s-sigtab; @true
648 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
649 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
650 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
653 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
654 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
655 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
657 zdefaultcc.go: s-zdefaultcc; @true
658 s-zdefaultcc: Makefile
659 echo 'package cfg' > zdefaultcc.go.tmp
660 echo >> zdefaultcc.go.tmp
661 echo 'func DefaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
662 echo 'func DefaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
663 echo 'func DefaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
664 echo 'const DefaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
665 echo 'var OSArchSupportsCgo = map[string]bool{}' >> zdefaultcc.go.tmp
666 $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
669 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
670 # compiling runtime) to prune out certain types that should not be
671 # exported back to C. See comments in mkruntimeinc.sh for more details.
672 runtime.inc: s-runtime-inc; @true
673 s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
674 $(SHELL) $(srcdir)/mkruntimeinc.sh
675 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
678 noinst_DATA += zdefaultcc.go
680 # Generate the list of go std packages that were included in libgo
681 zstdpkglist.go: s-zstdpkglist; @true
682 s-zstdpkglist: Makefile libgo-packages.txt
683 rm -f zstdpkglist.go.tmp
684 echo 'package goroot' > zstdpkglist.go.tmp
685 echo "" >> zstdpkglist.go.tmp
686 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
687 echo $(libgo_go_objs) 'unsafe.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
688 echo '}' >> zstdpkglist.go.tmp
689 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
693 syscall_epoll_file = epoll.go
698 libcalls.go: s-libcalls; @true
699 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
700 rm -f libcalls.go.tmp
701 $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
702 $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
705 libcalls-list: s-libcalls-list; @true
706 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
707 rm -f libcalls-list.tmp
708 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
709 $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
712 syscall_arch.go: s-syscall_arch; @true
713 s-syscall_arch: Makefile
714 rm -f syscall_arch.go.tmp
715 echo "package syscall" > syscall_arch.go.tmp
716 echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
717 echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
718 $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
721 syscall_linknames.go: s-syscall_linknames; @true
722 s-syscall_linknames: libcalls.go gen-sysinfo.go $(srcdir)/mklinknames.awk
723 rm -f syscall_linknames.go.tmp
724 $(AWK) -v package=syscall -f $(srcdir)/mklinknames.awk libcalls.go > syscall_linknames.go.tmp
725 $(SHELL) $(srcdir)/mvifdiff.sh syscall_linknames.go.tmp syscall_linknames.go
729 $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
730 $(CPPFLAGS) $(OSCFLAGS) -O
732 gen-sysinfo.go: s-gen-sysinfo; @true
733 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
734 $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
736 $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
739 errno.i: s-errno; @true
741 echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
742 $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
745 sysinfo.go: s-sysinfo; @true
746 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
747 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
748 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
751 # The epoll struct has an embedded union and is packed on x86_64,
752 # which is too complicated for mksysinfo.sh. We find the offset of
753 # the only field we care about in configure.ac, and generate the
755 epoll.go: s-epoll; @true
758 echo 'package syscall' > epoll.go.tmp
759 echo 'type EpollEvent struct {' >> epoll.go.tmp
760 echo ' Events uint32' >> epoll.go.tmp
761 case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
762 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
764 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
765 12,4) echo ' Fd int32' >> epoll.go.tmp; \
766 echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
767 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
768 echo ' Fd int32' >> epoll.go.tmp; ;; \
769 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
770 echo ' Fd int32' >> epoll.go.tmp; \
771 echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
772 *) echo 1>&2 "*** struct epoll_event unsupported"; \
775 echo '}' >> epoll.go.tmp
776 $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
780 syscall_lib_clone_lo = syscall/clone_linux.lo
782 syscall_lib_clone_lo =
786 golangorg_x_sys_cpu_gccgo_x86_lo = golang.org/x/sys/cpu_gccgo_x86.lo
788 golangorg_x_sys_cpu_gccgo_x86_lo =
791 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
794 $(addsuffix .lo,$(PACKAGES)) \
795 internal/bytealg/bytealg.lo \
796 reflect/makefunc_ffi_c.lo \
797 $(syscall_lib_clone_lo) \
802 $(golangorg_x_net_lif_lo) \
803 $(golangorg_x_net_route_lo) \
804 log/syslog/syslog_c.lo \
805 $(os_lib_inotify_lo) \
806 runtime/internal/atomic_c.lo \
808 internal/cpu/cpu_gccgo.lo \
809 $(golangorg_x_sys_cpu_gccgo_x86_lo)
812 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
815 $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
816 $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
818 libgo_la_SOURCES = $(runtime_files)
819 libgo_la_LDFLAGS = $(libgo_ldflags)
820 libgo_la_LIBADD = $(libgo_libadd)
822 libgo_llgo_la_SOURCES = $(runtime_files)
823 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
824 libgo_llgo_la_LIBADD = $(libgo_libadd)
826 libgobegin_a_SOURCES = \
829 libgobegin_llgo_a_SOURCES = \
832 # Use -fPIC for libgobegin so that it can be put in a PIE.
833 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
834 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
836 libgolibbegin_a_SOURCES = \
839 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
841 GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
843 libgotool_a_SOURCES =
844 libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
845 libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
847 define STATIC_template
848 $(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
851 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
853 # Make sure runtime.inc is built before compiling any .c file.
854 $(libgo_la_OBJECTS): runtime.inc
855 $(libgo_llgo_la_OBJECTS): runtime.inc
856 $(libgobegin_a_OBJECTS): runtime.inc
857 $(libgobegin_llgo_a_OBJECTS): runtime.inc
858 $(libgolibbegin_a_OBJECTS): runtime.inc
860 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
863 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
864 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
866 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
867 $(AM_GOCFLAGS) $(GOCFLAGS)
869 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
870 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
872 # Build the dependencies for a Go package.
875 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
876 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,,$@)))`; \
877 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
878 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
879 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
883 # Build the .go files for a package, generating a .lo file.
886 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
887 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
889 # How to build a .gox file from a .lo file.
890 # Matching .o file can either be in the same directory as the .lo (non-PIC
891 # object) or in the .libs directory (PIC object).
893 f="$(basename $<).o"; \
894 if test ! -f $$f; then \
895 f="$(basename $(<D)/.libs/$(<F)).o"; \
897 $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
898 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
905 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
907 GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
909 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
910 export RUNTESTFLAGS; \
915 libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
916 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
917 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
918 export LD_LIBRARY_PATH; \
920 rm -f $@-testsum $@-testlog; \
921 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
922 if test "$(USE_DEJAGNU)" = "yes"; then \
923 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
924 elif test "$(GOBENCH)" != ""; then \
925 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
927 if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
928 echo "PASS: $(@D)" >> $@-testlog; \
929 echo "PASS: $(@D)"; \
930 echo "PASS: $(@D)" > $@-testsum; \
932 echo "FAIL: $(@D)" >> $@-testlog; \
934 echo "FAIL: $(@D)" > $@-testsum; \
939 # Build all packages before checking any.
941 $(toolexeclibgo_DATA) \
942 $(toolexeclibgoarchive_DATA) \
943 $(toolexeclibgocompress_DATA) \
944 $(toolexeclibgocontainer_DATA) \
945 $(toolexeclibgocrypto_DATA) \
946 $(toolexeclibgodebug_DATA) \
947 $(toolexeclibgoencoding_DATA) \
948 $(toolexeclibgogo_DATA) \
949 $(toolexeclibgohash_DATA) \
950 $(toolexeclibgoimage_DATA) \
951 $(toolexeclibgoindex_DATA) \
952 $(toolexeclibgoio_DATA) \
953 $(toolexeclibgolog_DATA) \
954 $(toolexeclibgomath_DATA) \
955 $(toolexeclibgomime_DATA) \
956 $(toolexeclibgonet_DATA) \
957 $(toolexeclibgonethttp_DATA) \
958 $(toolexeclibgoos_DATA) \
959 $(toolexeclibgopath_DATA) \
960 $(toolexeclibgorpc_DATA) \
961 $(toolexeclibgoruntime_DATA) \
962 $(toolexeclibgosync_DATA) \
963 $(toolexeclibgotesting_DATA) \
964 $(toolexeclibgotext_DATA) \
965 $(toolexeclibgotexttemplate_DATA) \
966 $(toolexeclibgounicode_DATA) \
971 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
973 CHECK_DEPS += libgo.la libgobegin.a
976 # PACKAGE_template defines the rules for each package.
977 # For example, for the package bufio, it produces:
979 # @go_include@ bufio.lo.dep
980 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
984 # bufio/check: $(CHECK_DEPS)
986 # .PHONY: bufio/check
988 # This is invoked with $(1) set to a package, which is a directory name,
989 # such as "bufio" or "archive/tar".
990 define PACKAGE_template
991 @go_include@ $(1).lo.dep
992 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
996 $(1)/check: $$(CHECK_DEPS)
999 $(1).gox: $(1).s-gox; @true
1005 # This line expands PACKAGE_template once for each package name listed
1007 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1008 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1010 # Pass -ffp-contract=off, or 386-specific options, when building the
1011 # math package. MATH_FLAG is defined in configure.ac.
1012 math_lo_GOCFLAGS = $(MATH_FLAG)
1013 math_check_GOCFLAGS = $(MATH_FLAG)
1015 # Add generated files to the runtime package.
1016 extra_go_files_runtime = \
1017 runtime_linknames.go runtime_sysinfo.go sigtab.go goroot.go
1018 runtime.lo.dep: $(extra_go_files_runtime)
1020 # Add generated files to the syscall package.
1021 extra_go_files_syscall = \
1025 syscall_linknames.go \
1026 $(syscall_epoll_file)
1027 syscall.lo.dep: $(extra_go_files_syscall)
1029 # Pass -fgo-compiling-runtime when compiling the runtime package.
1030 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -fgo-compiling-runtime
1031 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1032 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1033 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1034 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1035 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1037 # If libffi is supported (the normal case) use the ffi build tag for
1038 # the runtime package.
1040 matchargs_runtime = --tag=libffi
1045 # At least for now, we need -static-libgo for this test, because
1046 # otherwise we can't get the line numbers.
1047 # Also use -fno-inline to get better results from the memory profiler.
1048 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1051 # reflect tests must be done with -static-libgo. Otherwize,
1052 # there will be a duplication of the canonicalization map.
1053 reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
1057 # Use -static for the syscall tests if possible, because otherwise when
1058 # running as root the re-execs ignore LD_LIBRARY_PATH.
1059 syscall_check_GOCFLAGS = -static
1062 extra_go_files_runtime_internal_sys = version.go
1063 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1065 extra_go_files_internal_cpu = cpugen.go
1066 internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
1068 extra_go_files_golang_org_x_sys_cpu = gcpugen.go
1069 golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
1071 extra_go_files_internal_buildcfg = buildcfg.go
1072 cmd/internal/buildcfg.lo.dep: $(extra_go_files_internal_buildcfg)
1074 extra_go_files_internal_goroot = zstdpkglist.go
1075 internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
1077 extra_go_files_go_types = gccgosizes.go
1078 go/types.lo.dep: $(extra_go_files_go_types)
1080 extra_go_files_cmd_internal_objabi = objabi.go
1081 cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
1083 extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
1084 cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
1086 extra_go_files_os = os_linknames.go
1087 os.lo.dep: $(extra_go_files_os)
1089 extra_go_files_os_user = os_user_linknames.go
1090 os/user.lo.dep: $(extra_go_files_os_user)
1092 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
1093 extra_check_libs_cmd_go_internal_fsys = $(abs_builddir)/libgotool.a
1094 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
1095 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
1096 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
1097 extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
1098 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
1099 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
1100 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
1101 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
1102 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
1103 extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
1104 extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
1105 extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
1106 extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
1107 extra_check_libs_cmd_go_internal_str = $(abs_builddir)/libgotool.a
1108 extra_check_libs_cmd_go_internal_test = $(abs_builddir)/libgotool.a
1109 extra_check_libs_cmd_go_internal_vcs = $(abs_builddir)/libgotool.a
1110 extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
1111 extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
1113 extra_check_libs_cmd_internal_buildid = $(abs_builddir)/libgotool.a
1115 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
1117 # FIXME: The following C files may as well move to the runtime
1118 # directory and be treated like other C files.
1120 # Use C code to speed up internal/bytealg.IndexByte and friends.
1121 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
1122 @$(MKDIR_P) internal/bytealg
1123 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
1125 # Use a C function with a fixed number of arguments to call a C
1127 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1128 @$(MKDIR_P) log/syslog
1129 $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1131 # The interface to libffi from the reflect package is written in C.
1132 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1134 $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1136 # The atomic functions are written in C.
1137 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1138 @$(MKDIR_P) runtime/internal
1139 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1140 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1142 $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1144 # A few syscall functions are written in C.
1145 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1147 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1148 syscall/errno.lo: go/syscall/errno.c runtime.inc
1150 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1151 syscall/signame.lo: go/syscall/signame.c runtime.inc
1153 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1154 syscall/wait.lo: go/syscall/wait.c runtime.inc
1156 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1158 # An os function is written in C.
1159 os/dir_gccgo_c.lo: go/os/dir_gccgo_c.c runtime.inc
1161 $(LTCOMPILE) -c -o $@ $(srcdir)/go/os/dir_gccgo_c.c
1163 # internal/cpu needs some C code.
1164 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
1165 @$(MKDIR_P) internal/cpu
1166 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
1168 # Similarly, golang.org/x/sys/cpu needs some C code.
1169 golang.org/x/sys/cpu_gccgo_x86.lo: go/golang.org/x/sys/cpu/cpu_gccgo_x86.c runtime.inc
1170 @$(MKDIR_P) golang.org/x/sys
1171 $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo_x86.c
1173 # Solaris 11.4 changed the type of fields in struct stat.
1174 # Use a build tag, based on a configure check, to cope.
1176 if HAVE_STAT_TIMESPEC
1177 matchargs_os = --tag=solaristag
1187 # Build golang.org/x/net/route only on BSD systems.
1189 $(eval $(call PACKAGE_template,golang.org/x/net/route))
1191 golangorg_x_net_route_lo = \
1192 golang.org/x/net/route.lo
1198 # Build golang.org/x/net/lif only on Solaris systems.
1200 $(eval $(call PACKAGE_template,golang.org/x/net/lif))
1202 golangorg_x_net_lif_lo = \
1203 golang.org/x/net/lif.lo
1207 TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
1210 check-recursive: check-head
1213 @echo "Test Run By $${USER} on `date`" > libgo.head
1214 @echo "Native configuration is $(host_triplet)" >> libgo.head
1216 @echo " === libgo tests ===" >> libgo.head
1219 check-tail: check-recursive check-multi
1220 @if test "$(USE_DEJAGNU)" = "yes"; then \
1223 lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1224 for dir in . $(MULTIDIRS); do \
1225 mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1226 mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1228 mv libgo.head libgo.sum; \
1229 cp libgo.sum libgo.log; \
1230 echo "Schedule of variations:" >> libgo.sum; \
1231 for dir in . $(MULTIDIRS); do \
1232 multidir=../$${dir}/$${lib}; \
1233 multivar=`cat $${multidir}/libgo.var`; \
1234 echo " $${multivar}" >> libgo.sum; \
1236 echo >> libgo.sum; \
1237 pass=0; fail=0; untested=0; \
1238 for dir in . $(MULTIDIRS); do \
1239 multidir=../$${dir}/$${lib}; \
1240 multivar=`cat $${multidir}/libgo.var`; \
1241 echo "Running target $${multivar}" >> libgo.sum; \
1242 echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1243 cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1244 cat $${multidir}/libgo.log.sep >> libgo.log; \
1245 if test -n "${MULTIDIRS}"; then \
1246 echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
1247 echo >> libgo.sum; \
1249 p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1250 pass=`expr $$pass + $$p`; \
1251 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1252 echo "# of expected passes $$p" >> libgo.sum; \
1254 p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1255 fail=`expr $$fail + $$p`; \
1256 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1257 echo "# of unexpected failures $$p" >> libgo.sum; \
1259 p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1260 untested=`expr $$untested + $$p`; \
1261 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1262 echo "# of untested testcases $$p" >> libgo.sum; \
1265 echo >> libgo.sum; \
1266 echo " === libgo Summary ===" >> libgo.sum; \
1267 echo >> libgo.sum; \
1268 if test "$$pass" -ne "0"; then \
1269 echo "# of expected passes $$pass" >> libgo.sum; \
1271 if test "$$fail" -ne "0"; then \
1272 echo "# of unexpected failures $$fail" >> libgo.sum; \
1274 if test "$$untested" -ne "0"; then \
1275 echo "# of untested testcases $$untested" >> libgo.sum; \
1277 echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
1278 echo >> libgo.log; \
1279 echo "runtest completed at `date`" >> libgo.log; \
1280 if test "$$fail" -ne "0"; then \
1288 @rm -f libgo.sum libgo.log libgo.tail
1290 [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1291 echo "$${multivar}" > libgo.var
1292 @for f in $(TEST_PACKAGES); do \
1293 rm -f $$f-testsum $$f-testlog; \
1295 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES)
1296 @for f in $(TEST_PACKAGES); do \
1297 if test -f $$f-testsum; then \
1298 cat $$f-testsum >> libgo.sum; \
1300 if test -f $$f-testlog; then \
1301 cat $$f-testlog >> libgo.log; \
1306 $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1309 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=.
1311 MOSTLYCLEANFILES = \
1312 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1313 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1315 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1317 runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
1320 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1321 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1322 find . -name '*-testsum' -print | xargs rm -f
1323 find . -name '*-testlog' -print | xargs rm -f
1325 CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
1328 find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1329 find . -name '*.a' -print | xargs rm -f
1330 find . -name '*.gox' -print | xargs rm -f
1331 find . -name '*.s-gox' -print | xargs rm -f
1334 find . -name '*.lo.dep' -print | xargs rm -f
1336 include $(top_srcdir)/../multilib.am
1339 ALL_LOCAL_DEPS = add-aix-fat-library
1343 all-local: $(ALL_LOCAL_DEPS)
1345 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
1347 # If we want to use "AR -r" when creating AIX FAT archives,
1348 # AR must be stripped of all its -X flags.
1349 # Otherwize, if AR was defined with -X32_64, the replace option would
1350 # erase the default .so when adding the extra one. There is no
1351 # order priority within -X flags.
1352 add-aix-fat-library: all-multi
1353 @if test "$(MULTIBUILDTOP)" = ""; then \
1354 arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
1355 $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1356 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1357 $${arx} -X$(AIX_EXTRA_ARCH) rc libgobegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1358 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgobegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1359 $${arx} -X$(AIX_EXTRA_ARCH) rc libgolibbegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
1360 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgolibbegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \