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 = \
370 runtime/metrics.gox \
374 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
376 toolexeclibgosync_DATA = \
379 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
381 toolexeclibgotesting_DATA = \
386 toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
388 toolexeclibgotestinginternal_DATA = \
389 testing/internal/testdeps.gox
391 toolexeclibgotextdir = $(toolexeclibgodir)/text
393 toolexeclibgotext_DATA = \
398 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
400 toolexeclibgotexttemplate_DATA = \
401 text/template/parse.gox
403 toolexeclibgotimedir = $(toolexeclibgodir)/time
405 toolexeclibgotime_DATA = \
408 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
410 toolexeclibgounicode_DATA = \
414 # Some internal packages are needed to bootstrap the gc toolchain.
415 toolexeclibgointernaldir = $(toolexeclibgodir)/internal
416 toolexeclibgointernal_DATA = \
417 internal/reflectlite.gox \
418 internal/unsafeheader.gox
420 # Some packages are only needed for tests, so unlike the other
421 # internal packages nothing will explicitly depend on them.
422 # Force them to be built.
424 golang.org/x/net/nettest.gox \
426 internal/obscuretestdata.gox \
427 internal/profile.gox \
428 internal/testenv.gox \
430 net/internal/socktest.gox \
431 os/signal/internal/pty.gox
434 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
436 rtems_task_variable_add_file =
439 runtime_context_asm_file =
442 runtime_context_asm_file += runtime/go-context.S
448 runtime/go-assert.c \
449 runtime/go-caller.c \
450 runtime/go-callers.c \
452 runtime/go-construct-map.c \
454 runtime/go-fieldtrack.c \
455 runtime/go-matherr.c \
456 runtime/go-memclr.c \
457 runtime/go-memmove.c \
458 runtime/go-memequal.c \
459 runtime/go-nanotime.c \
462 runtime/go-reflect-call.c \
463 runtime/go-setenv.c \
464 runtime/go-signal.c \
465 runtime/go-unsafe-pointer.c \
466 runtime/go-unsetenv.c \
467 runtime/go-unwind.c \
468 runtime/go-varargs.c \
469 runtime/env_posix.c \
473 runtime/runtime_c.c \
476 $(runtime_context_asm_file) \
477 $(rtems_task_variable_add_file)
479 version.go: s-version; @true
482 echo "package sys" > version.go.tmp
483 echo 'func init() { DefaultGoroot = "$(prefix)" }' >> version.go.tmp
484 echo 'const TheVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'"' >> version.go.tmp
485 echo 'const Goexperiment = ``' >> 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 >> version.go.tmp
490 echo "type ArchFamilyType int" >> version.go.tmp
491 echo >> version.go.tmp
492 echo "const (" >> version.go.tmp
493 echo " UNKNOWN ArchFamilyType = iota" >> version.go.tmp
494 for a in $(ALLGOARCHFAMILY); do \
495 echo " $${a}" >> version.go.tmp; \
497 echo ")" >> version.go.tmp
498 echo >> version.go.tmp
499 for a in $(ALLGOARCH); do \
500 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
501 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
502 if test "$${a}" = "$(GOARCH)"; then \
503 echo "const Goarch$${n} = 1" >> version.go.tmp; \
505 echo "const Goarch$${n} = 0" >> version.go.tmp; \
508 echo >> version.go.tmp
509 echo "const (" >> version.go.tmp
510 echo " ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> version.go.tmp
511 echo " BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> version.go.tmp
512 echo " CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> version.go.tmp
513 echo " DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> version.go.tmp
514 echo " Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> version.go.tmp
515 echo " MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> version.go.tmp
516 echo " PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> version.go.tmp
517 echo ")" >> version.go.tmp
518 echo >> version.go.tmp
519 for a in $(ALLGOOS); do \
520 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
521 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
522 if test "$${a}" = "$(GOOS)"; then \
523 echo "const Goos$${n} = 1" >> version.go.tmp; \
525 echo "const Goos$${n} = 0" >> version.go.tmp; \
528 echo >> version.go.tmp
529 echo "type Uintreg uintptr" >> version.go.tmp
530 $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
533 cpugen.go: s-cpu; @true
536 echo "package cpu" > cpugen.go.tmp
537 echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
538 echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
539 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
542 gcpugen.go: s-gcpu; @true
545 echo "package cpu" > gcpugen.go.tmp
546 echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
547 $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
550 objabi.go: s-objabi; @true
553 echo "package objabi" > objabi.go.tmp
554 echo "import \"runtime\"" >> objabi.go.tmp
555 echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> objabi.go.tmp
556 echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp
557 echo 'const defaultGOARM = `5`' >> objabi.go.tmp
558 echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp
559 echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp
560 echo 'const defaultGOPPC64 = `power8`' >> objabi.go.tmp
561 echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp
562 echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp
563 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp
564 echo 'const defaultGO_LDSO = ``' >> objabi.go.tmp
565 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> objabi.go.tmp
566 echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
567 echo 'const goexperiment = ``' >> objabi.go.tmp
568 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
571 gccgosizes.go: s-gccgosizes; @true
572 s-gccgosizes: Makefile goarch.sh
573 rm -f gccgosizes.go.tmp
574 echo "package types" > gccgosizes.go.tmp
575 echo >> gccgosizes.go.tmp
576 echo "var gccgoArchSizes = map[string]*StdSizes{" >> gccgosizes.go.tmp
577 for a in $(ALLGOARCH); do \
578 ptrsize=`$(SHELL) $(srcdir)/goarch.sh $$a ptrsize`; \
579 maxalign=`$(SHELL) $(srcdir)/goarch.sh $$a maxalign`; \
580 echo " \"$$a\": {$${ptrsize}, $${maxalign}}," >> gccgosizes.go.tmp; \
582 echo "}" >> gccgosizes.go.tmp
583 $(SHELL) $(srcdir)/mvifdiff.sh gccgosizes.go.tmp gccgosizes.go
586 os_linknames.go: s-os_linknames; @true
587 s-os_linknames: os-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/*.go
588 rm -f os_linknames.go.tmp
589 $(AWK) -f $(srcdir)/mklinknames.awk -v package=os `cat os-list` > os_linknames.go.tmp
590 $(SHELL) $(srcdir)/mvifdiff.sh os_linknames.go.tmp os_linknames.go
593 os-list: s-os-list; @true
594 s-os-list: Makefile $(srcdir)/go/os/*.go
596 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os > os-list.tmp
597 $(SHELL) $(srcdir)/mvifdiff.sh os-list.tmp os-list
600 os_user_linknames.go: s-os_user_linknames; @true
601 s-os_user_linknames: os-user-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/user/*.go
602 rm -f os_user_linknames.go.tmp
603 $(AWK) -f $(srcdir)/mklinknames.awk -v package=user `cat os-user-list` > os_user_linknames.go.tmp
604 $(SHELL) $(srcdir)/mvifdiff.sh os_user_linknames.go.tmp os_user_linknames.go
607 os-user-list: s-os-user-list; @true
608 s-os-user-list: Makefile $(srcdir)/go/os/user/*.go
609 rm -f os-user-list.tmp
610 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os/user > os-user-list.tmp
611 $(SHELL) $(srcdir)/mvifdiff.sh os-user-list.tmp os-user-list
614 runtime_linknames.go: s-runtime_linknames; @true
615 s-runtime_linknames: runtime-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/runtime/*.go
616 rm -f runtime_linknames.go.tmp
617 $(AWK) -f $(srcdir)/mklinknames.awk -v package=runtime `cat runtime-list` > runtime_linknames.go.tmp
618 $(SHELL) $(srcdir)/mvifdiff.sh runtime_linknames.go.tmp runtime_linknames.go
621 runtime-list: s-runtime-list; @true
622 s-runtime-list: Makefile $(srcdir)/go/runtime/*.go
623 rm -f runtime-list.tmp
624 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/runtime > runtime-list.tmp
625 $(SHELL) $(srcdir)/mvifdiff.sh runtime-list.tmp runtime-list
628 runtime_sysinfo.go: s-runtime_sysinfo; @true
629 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
630 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
631 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
634 sigtab.go: s-sigtab; @true
635 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
636 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
637 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
640 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
641 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
642 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
644 zdefaultcc.go: s-zdefaultcc; @true
645 s-zdefaultcc: Makefile
646 echo 'package cfg' > zdefaultcc.go.tmp
647 echo >> zdefaultcc.go.tmp
648 echo 'func DefaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
649 echo 'func DefaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
650 echo 'func DefaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
651 echo 'const DefaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
652 echo 'var OSArchSupportsCgo = map[string]bool{}' >> zdefaultcc.go.tmp
653 $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
656 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
657 # compiling runtime) to prune out certain types that should not be
658 # exported back to C. See comments in mkruntimeinc.sh for more details.
659 runtime.inc: s-runtime-inc; @true
660 s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
661 $(SHELL) $(srcdir)/mkruntimeinc.sh
662 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
665 noinst_DATA += zdefaultcc.go
667 # Generate the list of go std packages that were included in libgo
668 zstdpkglist.go: s-zstdpkglist; @true
669 s-zstdpkglist: Makefile libgo-packages.txt
670 rm -f zstdpkglist.go.tmp
671 echo 'package goroot' > zstdpkglist.go.tmp
672 echo "" >> zstdpkglist.go.tmp
673 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
674 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
675 echo '}' >> zstdpkglist.go.tmp
676 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
680 syscall_epoll_file = epoll.go
685 libcalls.go: s-libcalls; @true
686 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
687 rm -f libcalls.go.tmp
688 $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
689 $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
692 libcalls-list: s-libcalls-list; @true
693 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
694 rm -f libcalls-list.tmp
695 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
696 $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
699 syscall_arch.go: s-syscall_arch; @true
700 s-syscall_arch: Makefile
701 rm -f syscall_arch.go.tmp
702 echo "package syscall" > syscall_arch.go.tmp
703 echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
704 echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
705 $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
708 syscall_linknames.go: s-syscall_linknames; @true
709 s-syscall_linknames: libcalls.go gen-sysinfo.go $(srcdir)/mklinknames.awk
710 rm -f syscall_linknames.go.tmp
711 $(AWK) -v package=syscall -f $(srcdir)/mklinknames.awk libcalls.go > syscall_linknames.go.tmp
712 $(SHELL) $(srcdir)/mvifdiff.sh syscall_linknames.go.tmp syscall_linknames.go
716 $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
717 $(CPPFLAGS) $(OSCFLAGS) -O
719 gen-sysinfo.go: s-gen-sysinfo; @true
720 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
721 $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
723 $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
726 errno.i: s-errno; @true
728 echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
729 $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
732 sysinfo.go: s-sysinfo; @true
733 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
734 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
735 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
738 # The epoll struct has an embedded union and is packed on x86_64,
739 # which is too complicated for mksysinfo.sh. We find the offset of
740 # the only field we care about in configure.ac, and generate the
742 epoll.go: s-epoll; @true
745 echo 'package syscall' > epoll.go.tmp
746 echo 'type EpollEvent struct {' >> epoll.go.tmp
747 echo ' Events uint32' >> epoll.go.tmp
748 case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
749 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
751 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
752 12,4) echo ' Fd int32' >> epoll.go.tmp; \
753 echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
754 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
755 echo ' Fd int32' >> epoll.go.tmp; ;; \
756 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
757 echo ' Fd int32' >> epoll.go.tmp; \
758 echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
759 *) echo 1>&2 "*** struct epoll_event unsupported"; \
762 echo '}' >> epoll.go.tmp
763 $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
767 syscall_lib_clone_lo = syscall/clone_linux.lo
769 syscall_lib_clone_lo =
773 golangorg_x_sys_cpu_gccgo_x86_lo = golang.org/x/sys/cpu_gccgo_x86.lo
775 golangorg_x_sys_cpu_gccgo_x86_lo =
778 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
781 $(addsuffix .lo,$(PACKAGES)) \
782 internal/bytealg/bytealg.lo \
783 reflect/makefunc_ffi_c.lo \
784 $(syscall_lib_clone_lo) \
789 $(golangorg_x_net_lif_lo) \
790 $(golangorg_x_net_route_lo) \
791 log/syslog/syslog_c.lo \
792 $(os_lib_inotify_lo) \
793 runtime/internal/atomic_c.lo \
795 internal/cpu/cpu_gccgo.lo \
796 $(golangorg_x_sys_cpu_gccgo_x86_lo)
799 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
802 $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
803 $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
805 libgo_la_SOURCES = $(runtime_files)
806 libgo_la_LDFLAGS = $(libgo_ldflags)
807 libgo_la_LIBADD = $(libgo_libadd)
809 libgo_llgo_la_SOURCES = $(runtime_files)
810 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
811 libgo_llgo_la_LIBADD = $(libgo_libadd)
813 libgobegin_a_SOURCES = \
816 libgobegin_llgo_a_SOURCES = \
819 # Use -fPIC for libgobegin so that it can be put in a PIE.
820 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
821 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
823 libgolibbegin_a_SOURCES = \
826 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
828 GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
830 libgotool_a_SOURCES =
831 libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
832 libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
834 define STATIC_template
835 $(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
838 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
840 # Make sure runtime.inc is built before compiling any .c file.
841 $(libgo_la_OBJECTS): runtime.inc
842 $(libgo_llgo_la_OBJECTS): runtime.inc
843 $(libgobegin_a_OBJECTS): runtime.inc
844 $(libgobegin_llgo_a_OBJECTS): runtime.inc
845 $(libgolibbegin_a_OBJECTS): runtime.inc
847 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
850 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
851 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
853 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
854 $(AM_GOCFLAGS) $(GOCFLAGS)
856 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
857 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
859 # Build the dependencies for a Go package.
862 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
863 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,,$@)))`; \
864 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
865 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
866 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
870 # Build the .go files for a package, generating a .lo file.
873 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
874 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
876 # How to build a .gox file from a .lo file.
877 # Matching .o file can either be in the same directory as the .lo (non-PIC
878 # object) or in the .libs directory (PIC object).
880 f="$(basename $<).o"; \
881 if test ! -f $$f; then \
882 f="$(basename $(<D)/.libs/$(<F)).o"; \
884 $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
885 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
892 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
894 GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
896 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
897 export RUNTESTFLAGS; \
902 libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
903 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
904 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
905 export LD_LIBRARY_PATH; \
907 rm -f $@-testsum $@-testlog; \
908 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
909 if test "$(USE_DEJAGNU)" = "yes"; then \
910 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
911 elif test "$(GOBENCH)" != ""; then \
912 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
914 if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
915 echo "PASS: $(@D)" >> $@-testlog; \
916 echo "PASS: $(@D)"; \
917 echo "PASS: $(@D)" > $@-testsum; \
919 echo "FAIL: $(@D)" >> $@-testlog; \
921 echo "FAIL: $(@D)" > $@-testsum; \
926 # Build all packages before checking any.
928 $(toolexeclibgo_DATA) \
929 $(toolexeclibgoarchive_DATA) \
930 $(toolexeclibgocompress_DATA) \
931 $(toolexeclibgocontainer_DATA) \
932 $(toolexeclibgocrypto_DATA) \
933 $(toolexeclibgodebug_DATA) \
934 $(toolexeclibgoencoding_DATA) \
935 $(toolexeclibgogo_DATA) \
936 $(toolexeclibgohash_DATA) \
937 $(toolexeclibgoimage_DATA) \
938 $(toolexeclibgoindex_DATA) \
939 $(toolexeclibgoio_DATA) \
940 $(toolexeclibgolog_DATA) \
941 $(toolexeclibgomath_DATA) \
942 $(toolexeclibgomime_DATA) \
943 $(toolexeclibgonet_DATA) \
944 $(toolexeclibgonethttp_DATA) \
945 $(toolexeclibgoos_DATA) \
946 $(toolexeclibgopath_DATA) \
947 $(toolexeclibgorpc_DATA) \
948 $(toolexeclibgoruntime_DATA) \
949 $(toolexeclibgosync_DATA) \
950 $(toolexeclibgotesting_DATA) \
951 $(toolexeclibgotext_DATA) \
952 $(toolexeclibgotexttemplate_DATA) \
953 $(toolexeclibgounicode_DATA) \
958 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
960 CHECK_DEPS += libgo.la libgobegin.a
963 # PACKAGE_template defines the rules for each package.
964 # For example, for the package bufio, it produces:
966 # @go_include@ bufio.lo.dep
967 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
971 # bufio/check: $(CHECK_DEPS)
973 # .PHONY: bufio/check
975 # This is invoked with $(1) set to a package, which is a directory name,
976 # such as "bufio" or "archive/tar".
977 define PACKAGE_template
978 @go_include@ $(1).lo.dep
979 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
983 $(1)/check: $$(CHECK_DEPS)
986 $(1).gox: $(1).s-gox; @true
992 # This line expands PACKAGE_template once for each package name listed
994 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
995 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call PACKAGE_template,$(package))))
997 # Pass -ffp-contract=off, or 386-specific options, when building the
998 # math package. MATH_FLAG is defined in configure.ac.
999 math_lo_GOCFLAGS = $(MATH_FLAG)
1000 math_check_GOCFLAGS = $(MATH_FLAG)
1002 # Add generated files to the runtime package.
1003 extra_go_files_runtime = runtime_linknames.go runtime_sysinfo.go sigtab.go
1004 runtime.lo.dep: $(extra_go_files_runtime)
1006 # Add generated files to the syscall package.
1007 extra_go_files_syscall = \
1011 syscall_linknames.go \
1012 $(syscall_epoll_file)
1013 syscall.lo.dep: $(extra_go_files_syscall)
1015 # Pass -fgo-compiling-runtime when compiling the runtime package.
1016 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -fgo-compiling-runtime
1017 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1018 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1019 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1020 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1021 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1023 # If libffi is supported (the normal case) use the ffi build tag for
1024 # the runtime package.
1026 matchargs_runtime = --tag=libffi
1031 # At least for now, we need -static-libgo for this test, because
1032 # otherwise we can't get the line numbers.
1033 # Also use -fno-inline to get better results from the memory profiler.
1034 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1037 # reflect tests must be done with -static-libgo. Otherwize,
1038 # there will be a duplication of the canonicalization map.
1039 reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
1043 # Use -static for the syscall tests if possible, because otherwise when
1044 # running as root the re-execs ignore LD_LIBRARY_PATH.
1045 syscall_check_GOCFLAGS = -static
1048 extra_go_files_runtime_internal_sys = version.go
1049 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1051 extra_go_files_internal_cpu = cpugen.go
1052 internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
1054 extra_go_files_golang_org_x_sys_cpu = gcpugen.go
1055 golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
1057 extra_go_files_internal_goroot = zstdpkglist.go
1058 internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
1060 extra_go_files_go_types = gccgosizes.go
1061 go/types.lo.dep: $(extra_go_files_go_types)
1063 extra_go_files_cmd_internal_objabi = objabi.go
1064 cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
1066 extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
1067 cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
1069 extra_go_files_os = os_linknames.go
1070 os.lo.dep: $(extra_go_files_os)
1072 extra_go_files_os_user = os_user_linknames.go
1073 os/user.lo.dep: $(extra_go_files_os_user)
1075 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
1076 extra_check_libs_cmd_go_internal_fsys = $(abs_builddir)/libgotool.a
1077 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
1078 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
1079 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
1080 extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
1081 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
1082 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
1083 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
1084 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
1085 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
1086 extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
1087 extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
1088 extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
1089 extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
1090 extra_check_libs_cmd_go_internal_str = $(abs_builddir)/libgotool.a
1091 extra_check_libs_cmd_go_internal_test = $(abs_builddir)/libgotool.a
1092 extra_check_libs_cmd_go_internal_vcs = $(abs_builddir)/libgotool.a
1093 extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
1094 extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
1096 extra_check_libs_cmd_internal_buildid = $(abs_builddir)/libgotool.a
1098 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
1100 # FIXME: The following C files may as well move to the runtime
1101 # directory and be treated like other C files.
1103 # Use C code to speed up internal/bytealg.IndexByte and friends.
1104 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
1105 @$(MKDIR_P) internal/bytealg
1106 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
1108 # Use a C function with a fixed number of arguments to call a C
1110 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1111 @$(MKDIR_P) log/syslog
1112 $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1114 # The interface to libffi from the reflect package is written in C.
1115 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1117 $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1119 # The atomic functions are written in C.
1120 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1121 @$(MKDIR_P) runtime/internal
1122 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1123 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1125 $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1127 # A few syscall functions are written in C.
1128 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1130 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1131 syscall/errno.lo: go/syscall/errno.c runtime.inc
1133 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1134 syscall/signame.lo: go/syscall/signame.c runtime.inc
1136 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1137 syscall/wait.lo: go/syscall/wait.c runtime.inc
1139 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1141 # An os function is written in C.
1142 os/dir_gccgo_c.lo: go/os/dir_gccgo_c.c runtime.inc
1144 $(LTCOMPILE) -c -o $@ $(srcdir)/go/os/dir_gccgo_c.c
1146 # internal/cpu needs some C code.
1147 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
1148 @$(MKDIR_P) internal/cpu
1149 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
1151 # Similarly, golang.org/x/sys/cpu needs some C code.
1152 golang.org/x/sys/cpu_gccgo_x86.lo: go/golang.org/x/sys/cpu/cpu_gccgo_x86.c runtime.inc
1153 @$(MKDIR_P) golang.org/x/sys
1154 $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo_x86.c
1156 # Solaris 11.4 changed the type of fields in struct stat.
1157 # Use a build tag, based on a configure check, to cope.
1159 if HAVE_STAT_TIMESPEC
1160 matchargs_os = --tag=solaristag
1170 # Build golang.org/x/net/route only on BSD systems.
1172 $(eval $(call PACKAGE_template,golang.org/x/net/route))
1174 golangorg_x_net_route_lo = \
1175 golang.org/x/net/route.lo
1181 # Build golang.org/x/net/lif only on Solaris systems.
1183 $(eval $(call PACKAGE_template,golang.org/x/net/lif))
1185 golangorg_x_net_lif_lo = \
1186 golang.org/x/net/lif.lo
1190 TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
1193 check-recursive: check-head
1196 @echo "Test Run By $${USER} on `date`" > libgo.head
1197 @echo "Native configuration is $(host_triplet)" >> libgo.head
1199 @echo " === libgo tests ===" >> libgo.head
1202 check-tail: check-recursive check-multi
1203 @if test "$(USE_DEJAGNU)" = "yes"; then \
1206 lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1207 for dir in . $(MULTIDIRS); do \
1208 mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1209 mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1211 mv libgo.head libgo.sum; \
1212 cp libgo.sum libgo.log; \
1213 echo "Schedule of variations:" >> libgo.sum; \
1214 for dir in . $(MULTIDIRS); do \
1215 multidir=../$${dir}/$${lib}; \
1216 multivar=`cat $${multidir}/libgo.var`; \
1217 echo " $${multivar}" >> libgo.sum; \
1219 echo >> libgo.sum; \
1220 pass=0; fail=0; untested=0; \
1221 for dir in . $(MULTIDIRS); do \
1222 multidir=../$${dir}/$${lib}; \
1223 multivar=`cat $${multidir}/libgo.var`; \
1224 echo "Running target $${multivar}" >> libgo.sum; \
1225 echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1226 cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1227 cat $${multidir}/libgo.log.sep >> libgo.log; \
1228 if test -n "${MULTIDIRS}"; then \
1229 echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
1230 echo >> libgo.sum; \
1232 p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1233 pass=`expr $$pass + $$p`; \
1234 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1235 echo "# of expected passes $$p" >> libgo.sum; \
1237 p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1238 fail=`expr $$fail + $$p`; \
1239 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1240 echo "# of unexpected failures $$p" >> libgo.sum; \
1242 p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1243 untested=`expr $$untested + $$p`; \
1244 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1245 echo "# of untested testcases $$p" >> libgo.sum; \
1248 echo >> libgo.sum; \
1249 echo " === libgo Summary ===" >> libgo.sum; \
1250 echo >> libgo.sum; \
1251 if test "$$pass" -ne "0"; then \
1252 echo "# of expected passes $$pass" >> libgo.sum; \
1254 if test "$$fail" -ne "0"; then \
1255 echo "# of unexpected failures $$fail" >> libgo.sum; \
1257 if test "$$untested" -ne "0"; then \
1258 echo "# of untested testcases $$untested" >> libgo.sum; \
1260 echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
1261 echo >> libgo.log; \
1262 echo "runtest completed at `date`" >> libgo.log; \
1263 if test "$$fail" -ne "0"; then \
1271 @rm -f libgo.sum libgo.log libgo.tail
1273 [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1274 echo "$${multivar}" > libgo.var
1275 @for f in $(TEST_PACKAGES); do \
1276 rm -f $$f-testsum $$f-testlog; \
1278 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES)
1279 @for f in $(TEST_PACKAGES); do \
1280 if test -f $$f-testsum; then \
1281 cat $$f-testsum >> libgo.sum; \
1283 if test -f $$f-testlog; then \
1284 cat $$f-testlog >> libgo.log; \
1289 $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1292 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=.
1294 MOSTLYCLEANFILES = \
1295 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1296 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1298 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1300 runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
1303 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1304 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1305 find . -name '*-testsum' -print | xargs rm -f
1306 find . -name '*-testlog' -print | xargs rm -f
1308 CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
1311 find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1312 find . -name '*.a' -print | xargs rm -f
1313 find . -name '*.gox' -print | xargs rm -f
1314 find . -name '*.s-gox' -print | xargs rm -f
1317 find . -name '*.lo.dep' -print | xargs rm -f
1319 include $(top_srcdir)/../multilib.am
1322 ALL_LOCAL_DEPS = add-aix-fat-library
1326 all-local: $(ALL_LOCAL_DEPS)
1328 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
1330 # If we want to use "AR -r" when creating AIX FAT archives,
1331 # AR must be stripped of all its -X flags.
1332 # Otherwize, if AR was defined with -X32_64, the replace option would
1333 # erase the default .so when adding the extra one. There is no
1334 # order priority within -X flags.
1335 add-aix-fat-library: all-multi
1336 @if test "$(MULTIBUILDTOP)" = ""; then \
1337 arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
1338 $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1339 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1340 $${arx} -X$(AIX_EXTRA_ARCH) rc libgobegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1341 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgobegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1342 $${arx} -X$(AIX_EXTRA_ARCH) rc libgolibbegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
1343 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgolibbegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \