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 = \
223 debug/buildinfo.gox \
231 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
233 toolexeclibgoencoding_DATA = \
234 encoding/ascii85.gox \
236 encoding/base32.gox \
237 encoding/base64.gox \
238 encoding/binary.gox \
246 toolexeclibgogodir = $(toolexeclibgodir)/go
248 toolexeclibgogo_DATA = \
261 toolexeclibgogobuilddir = $(toolexeclibgogodir)/build
263 toolexeclibgogobuild_DATA = \
264 go/build/constraint.gox
266 toolexeclibgohashdir = $(toolexeclibgodir)/hash
268 toolexeclibgohash_DATA = \
275 toolexeclibgohtmldir = $(toolexeclibgodir)/html
277 toolexeclibgohtml_DATA = \
280 toolexeclibgoimagedir = $(toolexeclibgodir)/image
282 toolexeclibgoimage_DATA = \
289 toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
291 toolexeclibgoimagecolor_DATA = \
292 image/color/palette.gox
294 toolexeclibgoindexdir = $(toolexeclibgodir)/index
296 toolexeclibgoindex_DATA = \
297 index/suffixarray.gox
299 toolexeclibgoiodir = $(toolexeclibgodir)/io
301 toolexeclibgoio_DATA = \
305 toolexeclibgologdir = $(toolexeclibgodir)/log
307 toolexeclibgolog_DATA = \
310 toolexeclibgomathdir = $(toolexeclibgodir)/math
312 toolexeclibgomath_DATA = \
318 toolexeclibgomimedir = $(toolexeclibgodir)/mime
320 toolexeclibgomime_DATA = \
322 mime/quotedprintable.gox
324 toolexeclibgonetdir = $(toolexeclibgodir)/net
326 toolexeclibgonet_DATA = \
335 toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
337 toolexeclibgonethttp_DATA = \
339 net/http/cookiejar.gox \
341 net/http/httptest.gox \
342 net/http/httptrace.gox \
343 net/http/httputil.gox \
346 toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
348 toolexeclibgonetrpc_DATA = \
351 toolexeclibgoosdir = $(toolexeclibgodir)/os
353 toolexeclibgoos_DATA = \
358 toolexeclibgopathdir = $(toolexeclibgodir)/path
360 toolexeclibgopath_DATA = \
363 toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
365 toolexeclibgoregexp_DATA = \
368 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
370 toolexeclibgoruntime_DATA = \
373 runtime/metrics.gox \
377 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
379 toolexeclibgosync_DATA = \
382 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
384 toolexeclibgotesting_DATA = \
389 toolexeclibgotestinginternaldir = $(toolexeclibgotestingdir)/internal
391 toolexeclibgotestinginternal_DATA = \
392 testing/internal/testdeps.gox
394 toolexeclibgotextdir = $(toolexeclibgodir)/text
396 toolexeclibgotext_DATA = \
401 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
403 toolexeclibgotexttemplate_DATA = \
404 text/template/parse.gox
406 toolexeclibgotimedir = $(toolexeclibgodir)/time
408 toolexeclibgotime_DATA = \
411 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
413 toolexeclibgounicode_DATA = \
417 # Some internal packages are needed to bootstrap the gc toolchain.
418 toolexeclibgointernaldir = $(toolexeclibgodir)/internal
419 toolexeclibgointernal_DATA = \
420 internal/reflectlite.gox \
421 internal/unsafeheader.gox
423 # Some packages are only needed for tests, so unlike the other
424 # internal packages nothing will explicitly depend on them.
425 # Force them to be built.
427 golang.org/x/net/nettest.gox \
429 internal/obscuretestdata.gox \
430 internal/profile.gox \
431 internal/testenv.gox \
433 net/internal/socktest.gox \
434 os/exec/internal/fdtest.gox \
435 os/signal/internal/pty.gox \
436 reflect/internal/example1.gox \
437 reflect/internal/example2.gox
440 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
442 rtems_task_variable_add_file =
445 runtime_context_asm_file =
448 runtime_context_asm_file += runtime/go-context.S
454 runtime/go-assert.c \
455 runtime/go-caller.c \
456 runtime/go-callers.c \
458 runtime/go-construct-map.c \
460 runtime/go-fieldtrack.c \
461 runtime/go-matherr.c \
462 runtime/go-memclr.c \
463 runtime/go-memmove.c \
464 runtime/go-memequal.c \
465 runtime/go-nanotime.c \
468 runtime/go-strerror.c \
469 runtime/go-reflect-call.c \
470 runtime/go-setenv.c \
471 runtime/go-signal.c \
472 runtime/go-unsafe-pointer.c \
473 runtime/go-unsetenv.c \
474 runtime/go-unwind.c \
475 runtime/go-varargs.c \
476 runtime/env_posix.c \
480 runtime/runtime_c.c \
483 $(runtime_context_asm_file) \
484 $(rtems_task_variable_add_file)
486 version.go: s-version; @true
489 echo "package sys" > version.go.tmp
490 echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
491 echo 'const StackGuardMultiplierDefault = 1' >> version.go.tmp
492 $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
495 zgoarch.go: s-zgoarch; @true
496 s-zgoarch: Makefile goarch.sh
498 echo "package goarch" > zgoarch.go.tmp
499 echo >> zgoarch.go.tmp
500 echo 'const GOARCH = "'$(GOARCH)'"' >> zgoarch.go.tmp
501 echo >> zgoarch.go.tmp
502 echo 'const (' >> zgoarch.go.tmp
503 echo " _ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" >> zgoarch.go.tmp
504 echo " _BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" >> zgoarch.go.tmp
505 echo " _DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) defaultphyspagesize`" >> zgoarch.go.tmp
506 echo " _Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) int64align`" >> zgoarch.go.tmp
507 echo " _MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) minframesize`" >> zgoarch.go.tmp
508 echo " _PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" >> zgoarch.go.tmp
509 echo " _StackAlign = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) stackalign`" >> zgoarch.go.tmp
510 echo ")" >> zgoarch.go.tmp
511 echo >> zgoarch.go.tmp
512 echo "const (" >> zgoarch.go.tmp
513 echo " UNKNOWN ArchFamilyType = iota" >> zgoarch.go.tmp
514 for a in $(ALLGOARCHFAMILY); do \
515 echo " $${a}" >> zgoarch.go.tmp; \
517 echo ")" >> zgoarch.go.tmp
518 echo >> zgoarch.go.tmp
519 for a in $(ALLGOARCH); 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}" = "$(GOARCH)"; then \
523 echo "const Is$${n} = 1" >> zgoarch.go.tmp; \
525 echo "const Is$${n} = 0" >> zgoarch.go.tmp; \
528 $(SHELL) $(srcdir)/mvifdiff.sh zgoarch.go.tmp zgoarch.go
531 zgoos.go: s-zgoos; @true
534 echo "package goos" > zgoos.go.tmp
536 echo 'const GOOS = "'$(GOOS)'"' >> zgoos.go.tmp
538 for a in $(ALLGOOS); do \
539 f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
540 n="$${f}`echo $${a} | sed -e 's/.//'`"; \
541 if test "$${a}" = "$(GOOS)"; then \
542 echo "const Is$${n} = 1" >> zgoos.go.tmp; \
544 echo "const Is$${n} = 0" >> zgoos.go.tmp; \
547 $(SHELL) $(srcdir)/mvifdiff.sh zgoos.go.tmp zgoos.go
550 cpugen.go: s-cpu; @true
551 s-cpu: Makefile goarch.sh
553 echo "package cpu" > cpugen.go.tmp
554 echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
555 echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
556 $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
559 gcpugen.go: s-gcpu; @true
560 s-gcpu: Makefile goarch.sh
562 echo "package cpu" > gcpugen.go.tmp
563 echo "const cacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> gcpugen.go.tmp
564 $(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
567 goroot.go: s-goroot; @true
570 echo "package runtime" > goroot.go.tmp
571 echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp
572 echo 'var buildVersion = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> goroot.go.tmp
573 $(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go
576 buildcfg.go: s-buildcfg; @true
578 rm -f buildcfg.go.tmp
579 echo "package buildcfg" > buildcfg.go.tmp
580 echo "import \"runtime\"" >> buildcfg.go.tmp
581 echo 'func defaultGOROOTValue() string { return `$(prefix)` }' >> buildcfg.go.tmp
582 echo 'const defaultGO386 = `sse2`' >> buildcfg.go.tmp
583 echo 'const defaultGOAMD64 = `v1`' >> buildcfg.go.tmp
584 echo 'const defaultGOARM = `5`' >> buildcfg.go.tmp
585 echo 'const defaultGOMIPS = `hardfloat`' >> buildcfg.go.tmp
586 echo 'const defaultGOMIPS64 = `hardfloat`' >> buildcfg.go.tmp
587 echo 'const defaultGOPPC64 = `power8`' >> buildcfg.go.tmp
588 echo 'const defaultGOEXPERIMENT = `fieldtrack`' >> buildcfg.go.tmp
589 echo 'const defaultGO_EXTLINK_ENABLED = ``' >> buildcfg.go.tmp
590 echo 'const defaultGO_LDSO = ``' >> buildcfg.go.tmp
591 echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> buildcfg.go.tmp
592 echo 'const defaultGOOS = runtime.GOOS' >> buildcfg.go.tmp
593 echo 'const defaultGOARCH = runtime.GOARCH' >> buildcfg.go.tmp
594 $(SHELL) $(srcdir)/mvifdiff.sh buildcfg.go.tmp buildcfg.go
597 objabi.go: s-objabi; @true
600 echo "package objabi" > objabi.go.tmp
601 echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
602 $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
605 gccgosizes.go: s-gccgosizes; @true
606 s-gccgosizes: Makefile goarch.sh
607 rm -f gccgosizes.go.tmp
608 echo "package types" > gccgosizes.go.tmp
609 echo >> gccgosizes.go.tmp
610 echo "var gccgoArchSizes = map[string]*StdSizes{" >> gccgosizes.go.tmp
611 for a in $(ALLGOARCH); do \
612 ptrsize=`$(SHELL) $(srcdir)/goarch.sh $$a ptrsize`; \
613 maxalign=`$(SHELL) $(srcdir)/goarch.sh $$a maxalign`; \
614 echo " \"$$a\": {$${ptrsize}, $${maxalign}}," >> gccgosizes.go.tmp; \
616 echo "}" >> gccgosizes.go.tmp
617 $(SHELL) $(srcdir)/mvifdiff.sh gccgosizes.go.tmp gccgosizes.go
620 os_linknames.go: s-os_linknames; @true
621 s-os_linknames: os-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/*.go
622 rm -f os_linknames.go.tmp
623 $(AWK) -f $(srcdir)/mklinknames.awk -v package=os `cat os-list` > os_linknames.go.tmp
624 $(SHELL) $(srcdir)/mvifdiff.sh os_linknames.go.tmp os_linknames.go
627 os-list: s-os-list; @true
628 s-os-list: Makefile $(srcdir)/go/os/*.go
630 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os > os-list.tmp
631 $(SHELL) $(srcdir)/mvifdiff.sh os-list.tmp os-list
634 os_user_linknames.go: s-os_user_linknames; @true
635 s-os_user_linknames: os-user-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/os/user/*.go
636 rm -f os_user_linknames.go.tmp
637 $(AWK) -f $(srcdir)/mklinknames.awk -v package=user `cat os-user-list` > os_user_linknames.go.tmp
638 $(SHELL) $(srcdir)/mvifdiff.sh os_user_linknames.go.tmp os_user_linknames.go
641 os-user-list: s-os-user-list; @true
642 s-os-user-list: Makefile $(srcdir)/go/os/user/*.go
643 rm -f os-user-list.tmp
644 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/os/user > os-user-list.tmp
645 $(SHELL) $(srcdir)/mvifdiff.sh os-user-list.tmp os-user-list
648 runtime_linknames.go: s-runtime_linknames; @true
649 s-runtime_linknames: runtime-list gen-sysinfo.go $(srcdir)/mklinknames.awk $(srcdir)/go/runtime/*.go
650 rm -f runtime_linknames.go.tmp
651 $(AWK) -f $(srcdir)/mklinknames.awk -v package=runtime `cat runtime-list` > runtime_linknames.go.tmp
652 $(SHELL) $(srcdir)/mvifdiff.sh runtime_linknames.go.tmp runtime_linknames.go
655 runtime-list: s-runtime-list; @true
656 s-runtime-list: Makefile $(srcdir)/go/runtime/*.go
657 rm -f runtime-list.tmp
658 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/runtime > runtime-list.tmp
659 $(SHELL) $(srcdir)/mvifdiff.sh runtime-list.tmp runtime-list
662 runtime_sysinfo.go: s-runtime_sysinfo; @true
663 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
664 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
665 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
668 sigtab.go: s-sigtab; @true
669 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
670 GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
671 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
674 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
675 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
676 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
678 zdefaultcc.go: s-zdefaultcc; @true
679 s-zdefaultcc: Makefile
680 echo 'package cfg' > zdefaultcc.go.tmp
681 echo >> zdefaultcc.go.tmp
682 echo 'func DefaultGCCGO(goos, goarch string) string { return "$(bindir)/$(GCCGO_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
683 echo 'func DefaultCC(goos, goarch string) string { return "$(GCC_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
684 echo 'func DefaultCXX(goos, goarch string) string { return "$(GXX_INSTALL_NAME)" }' >> zdefaultcc.go.tmp
685 echo 'const DefaultPkgConfig = "pkg-config"' >> zdefaultcc.go.tmp
686 echo 'var OSArchSupportsCgo = map[string]bool{}' >> zdefaultcc.go.tmp
687 $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
690 # Post-process runtime.inc.raw (raw output of -fgo-c-header option when
691 # compiling runtime) to prune out certain types that should not be
692 # exported back to C. See comments in mkruntimeinc.sh for more details.
693 runtime.inc: s-runtime-inc; @true
694 s-runtime-inc: runtime.lo mkruntimeinc.sh Makefile
695 $(SHELL) $(srcdir)/mkruntimeinc.sh
696 $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
699 noinst_DATA += zdefaultcc.go
701 # Generate the list of go std packages that were included in libgo
702 zstdpkglist.go: s-zstdpkglist; @true
703 s-zstdpkglist: Makefile libgo-packages.txt
704 rm -f zstdpkglist.go.tmp
705 echo 'package goroot' > zstdpkglist.go.tmp
706 echo "" >> zstdpkglist.go.tmp
707 echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
708 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
709 echo '}' >> zstdpkglist.go.tmp
710 $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
714 syscall_epoll_file = epoll.go
719 libcalls.go: s-libcalls; @true
720 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
721 rm -f libcalls.go.tmp
722 $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
723 $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
726 libcalls-list: s-libcalls-list; @true
727 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
728 rm -f libcalls-list.tmp
729 $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
730 $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
733 syscall_arch.go: s-syscall_arch; @true
734 s-syscall_arch: Makefile
735 rm -f syscall_arch.go.tmp
736 echo "package syscall" > syscall_arch.go.tmp
737 echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
738 echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
739 $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
742 syscall_linknames.go: s-syscall_linknames; @true
743 s-syscall_linknames: libcalls.go gen-sysinfo.go $(srcdir)/mklinknames.awk
744 rm -f syscall_linknames.go.tmp
745 $(AWK) -v package=syscall -f $(srcdir)/mklinknames.awk libcalls.go > syscall_linknames.go.tmp
746 $(SHELL) $(srcdir)/mvifdiff.sh syscall_linknames.go.tmp syscall_linknames.go
750 $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
751 $(CPPFLAGS) $(OSCFLAGS) -O
753 gen-sysinfo.go: s-gen-sysinfo; @true
754 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
755 $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
757 $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
760 errno.i: s-errno; @true
762 echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
763 $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
766 sysinfo.go: s-sysinfo; @true
767 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
768 GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh
769 $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
772 # The epoll struct has an embedded union and is packed on x86_64,
773 # which is too complicated for mksysinfo.sh. We find the offset of
774 # the only field we care about in configure.ac, and generate the
776 epoll.go: s-epoll; @true
779 echo 'package syscall' > epoll.go.tmp
780 echo 'type EpollEvent struct {' >> epoll.go.tmp
781 echo ' Events uint32' >> epoll.go.tmp
782 case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
783 0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
785 8,4) echo ' Fd int32' >> epoll.go.tmp; ;; \
786 12,4) echo ' Fd int32' >> epoll.go.tmp; \
787 echo ' Pad [4]byte' >> epoll.go.tmp; ;; \
788 12,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
789 echo ' Fd int32' >> epoll.go.tmp; ;; \
790 16,8) echo ' Pad [4]byte' >> epoll.go.tmp; \
791 echo ' Fd int32' >> epoll.go.tmp; \
792 echo ' Pad2 [4]byte' >> epoll.go.tmp; ;; \
793 *) echo 1>&2 "*** struct epoll_event unsupported"; \
796 echo '}' >> epoll.go.tmp
797 $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
801 syscall_lib_clone_lo = syscall/clone_linux.lo
803 syscall_lib_clone_lo =
807 golangorg_x_sys_cpu_gccgo_x86_lo = golang.org/x/sys/cpu_gccgo_x86.lo
809 golangorg_x_sys_cpu_gccgo_x86_lo =
812 PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
815 $(addsuffix .lo,$(PACKAGES)) \
816 internal/bytealg/bytealg.lo \
817 reflect/makefunc_ffi_c.lo \
818 $(syscall_lib_clone_lo) \
822 runtime/internal/syscall/errno.lo \
824 $(golangorg_x_net_lif_lo) \
825 $(golangorg_x_net_route_lo) \
826 log/syslog/syslog_c.lo \
827 $(os_lib_inotify_lo) \
828 runtime/internal/atomic_c.lo \
830 internal/cpu/cpu_gccgo.lo \
831 $(golangorg_x_sys_cpu_gccgo_x86_lo)
834 -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
837 $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
838 $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
840 libgo_la_SOURCES = $(runtime_files)
841 libgo_la_LDFLAGS = $(libgo_ldflags)
842 libgo_la_LIBADD = $(libgo_libadd)
844 libgo_llgo_la_SOURCES = $(runtime_files)
845 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
846 libgo_llgo_la_LIBADD = $(libgo_libadd)
848 libgobegin_a_SOURCES = \
851 libgobegin_llgo_a_SOURCES = \
854 # Use -fPIC for libgobegin so that it can be put in a PIE.
855 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
856 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
858 libgolibbegin_a_SOURCES = \
861 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
863 GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
865 libgotool_a_SOURCES =
866 libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
867 libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
869 define STATIC_template
870 $(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
873 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
875 # Make sure runtime.inc is built before compiling any .c file.
876 $(libgo_la_OBJECTS): runtime.inc
877 $(libgo_llgo_la_OBJECTS): runtime.inc
878 $(libgobegin_a_OBJECTS): runtime.inc
879 $(libgobegin_llgo_a_OBJECTS): runtime.inc
880 $(libgolibbegin_a_OBJECTS): runtime.inc
882 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
885 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
886 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
888 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
889 $(AM_GOCFLAGS) $(GOCFLAGS)
891 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
892 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
894 # Build the dependencies for a Go package.
897 dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
898 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,,$@)))`; \
899 $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
900 if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
901 rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
905 # Build the .go files for a package, generating a .lo file.
908 files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
909 $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
911 # How to build a .gox file from a .lo file.
912 # Matching .o file can either be in the same directory as the .lo (non-PIC
913 # object) or in the .libs directory (PIC object).
915 f="$(basename $<).o"; \
916 if test ! -f $$f; then \
917 f="$(basename $(<D)/.libs/$(<F)).o"; \
919 $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
920 $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
927 GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
929 GOLIBS="$(extra_check_libs_$(subst .,_,$(subst /,_,$(@D)))) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
931 RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
932 export RUNTESTFLAGS; \
937 libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
938 LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
939 LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
940 export LD_LIBRARY_PATH; \
942 rm -f $@-testsum $@-testlog; \
943 files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
944 if test "$(USE_DEJAGNU)" = "yes"; then \
945 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
946 elif test "$(GOBENCH)" != ""; then \
947 $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
949 if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
950 echo "PASS: $(@D)" >> $@-testlog; \
951 echo "PASS: $(@D)"; \
952 echo "PASS: $(@D)" > $@-testsum; \
954 echo "FAIL: $(@D)" >> $@-testlog; \
956 echo "FAIL: $(@D)" > $@-testsum; \
961 # Build all packages before checking any.
963 $(toolexeclibgo_DATA) \
964 $(toolexeclibgoarchive_DATA) \
965 $(toolexeclibgocompress_DATA) \
966 $(toolexeclibgocontainer_DATA) \
967 $(toolexeclibgocrypto_DATA) \
968 $(toolexeclibgodebug_DATA) \
969 $(toolexeclibgoencoding_DATA) \
970 $(toolexeclibgogo_DATA) \
971 $(toolexeclibgohash_DATA) \
972 $(toolexeclibgoimage_DATA) \
973 $(toolexeclibgoindex_DATA) \
974 $(toolexeclibgoio_DATA) \
975 $(toolexeclibgolog_DATA) \
976 $(toolexeclibgomath_DATA) \
977 $(toolexeclibgomime_DATA) \
978 $(toolexeclibgonet_DATA) \
979 $(toolexeclibgonethttp_DATA) \
980 $(toolexeclibgoos_DATA) \
981 $(toolexeclibgopath_DATA) \
982 $(toolexeclibgorpc_DATA) \
983 $(toolexeclibgoruntime_DATA) \
984 $(toolexeclibgosync_DATA) \
985 $(toolexeclibgotesting_DATA) \
986 $(toolexeclibgotext_DATA) \
987 $(toolexeclibgotexttemplate_DATA) \
988 $(toolexeclibgounicode_DATA) \
993 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
995 CHECK_DEPS += libgo.la libgobegin.a
998 # PACKAGE_template defines the rules for each package.
999 # For example, for the package bufio, it produces:
1001 # @go_include@ bufio.lo.dep
1002 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
1006 # bufio/check: $(CHECK_DEPS)
1008 # .PHONY: bufio/check
1010 # This is invoked with $(1) set to a package, which is a directory name,
1011 # such as "bufio" or "archive/tar".
1012 define PACKAGE_template
1013 @go_include@ $(1).lo.dep
1014 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
1018 $(1)/check: $$(CHECK_DEPS)
1021 $(1).gox: $(1).s-gox; @true
1027 # This line expands PACKAGE_template once for each package name listed
1029 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1030 $(foreach package,$(GOTOOL_PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1032 # Pass -ffp-contract=off, or 386-specific options, when building the
1033 # math package. MATH_FLAG is defined in configure.ac.
1034 math_lo_GOCFLAGS = $(MATH_FLAG)
1035 math_check_GOCFLAGS = $(MATH_FLAG)
1037 # Add generated files to the runtime package.
1038 extra_go_files_runtime = \
1039 runtime_linknames.go runtime_sysinfo.go sigtab.go goroot.go
1040 runtime.lo.dep: $(extra_go_files_runtime)
1042 # Add generated files to the syscall package.
1043 extra_go_files_syscall = \
1047 syscall_linknames.go \
1048 $(syscall_epoll_file)
1049 syscall.lo.dep: $(extra_go_files_syscall)
1051 # Pass -fgo-compiling-runtime when compiling the runtime package.
1052 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -fgo-compiling-runtime
1053 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1054 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1055 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1056 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1057 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1059 # If libffi is supported (the normal case) use the ffi build tag for
1060 # the runtime package.
1062 matchargs_runtime = --tag=libffi
1067 # At least for now, we need -static-libgo for this test, because
1068 # otherwise we can't get the line numbers.
1069 # Also use -fno-inline to get better results from the memory profiler.
1070 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1073 # reflect tests must be done with -static-libgo. Otherwize,
1074 # there will be a duplication of the canonicalization map.
1075 reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
1079 # Use -static for the syscall tests if possible, because otherwise when
1080 # running as root the re-execs ignore LD_LIBRARY_PATH.
1081 syscall_check_GOCFLAGS = -static
1084 extra_go_files_runtime_internal_sys = version.go
1085 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1087 extra_go_files_internal_cpu = cpugen.go
1088 internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
1090 extra_go_files_internal_goarch = zgoarch.go
1091 internal/goarch.lo.dep: $(extra_go_files_internal_goarch)
1093 extra_go_files_internal_goos = zgoos.go
1094 internal/goos.lo.dep: $(extra_go_files_internal_goos)
1096 extra_go_files_golang_org_x_sys_cpu = gcpugen.go
1097 golang.org/x/sys/cpu.lo.dep: $(extra_go_files_golang_org_x_sys_cpu)
1099 extra_go_files_internal_buildcfg = buildcfg.go
1100 cmd/internal/buildcfg.lo.dep: $(extra_go_files_internal_buildcfg)
1102 extra_go_files_internal_goroot = zstdpkglist.go
1103 internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
1105 extra_go_files_go_types = gccgosizes.go
1106 go/types.lo.dep: $(extra_go_files_go_types)
1108 extra_go_files_cmd_internal_objabi = objabi.go
1109 cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
1111 extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
1112 cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
1114 extra_go_files_os = os_linknames.go
1115 os.lo.dep: $(extra_go_files_os)
1117 extra_go_files_os_user = os_user_linknames.go
1118 os/user.lo.dep: $(extra_go_files_os_user)
1120 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
1121 extra_check_libs_cmd_go_internal_fsys = $(abs_builddir)/libgotool.a
1122 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
1123 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
1124 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
1125 extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
1126 extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
1127 extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
1128 extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
1129 extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
1130 extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
1131 extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
1132 extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
1133 extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
1134 extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
1135 extra_check_libs_cmd_go_internal_str = $(abs_builddir)/libgotool.a
1136 extra_check_libs_cmd_go_internal_test = $(abs_builddir)/libgotool.a
1137 extra_check_libs_cmd_go_internal_vcs = $(abs_builddir)/libgotool.a
1138 extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
1139 extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
1141 extra_check_libs_cmd_internal_buildid = $(abs_builddir)/libgotool.a
1143 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
1145 # FIXME: The following C files may as well move to the runtime
1146 # directory and be treated like other C files.
1148 # Use C code to speed up internal/bytealg.IndexByte and friends.
1149 internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
1150 @$(MKDIR_P) internal/bytealg
1151 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
1153 # Use a C function with a fixed number of arguments to call a C
1155 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1156 @$(MKDIR_P) log/syslog
1157 $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1159 # The interface to libffi from the reflect package is written in C.
1160 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1162 $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1164 # The atomic functions are written in C.
1165 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1166 @$(MKDIR_P) runtime/internal
1167 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1168 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1170 $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1172 # A few syscall functions are written in C.
1173 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1175 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1176 syscall/errno.lo: go/syscall/errno.c runtime.inc
1178 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1179 syscall/signame.lo: go/syscall/signame.c runtime.inc
1181 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1182 syscall/wait.lo: go/syscall/wait.c runtime.inc
1184 $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1186 # Some runtime/internal/syscall functions are written in C.
1187 runtime/internal/syscall/errno.lo: go/runtime/internal/syscall/errno.c runtime.inc
1188 @$(MKDIR_P) runtime/internal/syscall
1189 $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/syscall/errno.c
1191 # An os function is written in C.
1192 os/dir_gccgo_c.lo: go/os/dir_gccgo_c.c runtime.inc
1194 $(LTCOMPILE) -c -o $@ $(srcdir)/go/os/dir_gccgo_c.c
1196 # internal/cpu needs some C code.
1197 internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
1198 @$(MKDIR_P) internal/cpu
1199 $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
1201 # Similarly, golang.org/x/sys/cpu needs some C code.
1202 golang.org/x/sys/cpu_gccgo_x86.lo: go/golang.org/x/sys/cpu/cpu_gccgo_x86.c runtime.inc
1203 @$(MKDIR_P) golang.org/x/sys
1204 $(LTCOMPILE) -c -o $@ $(srcdir)/go/golang.org/x/sys/cpu/cpu_gccgo_x86.c
1206 # Solaris 11.4 changed the type of fields in struct stat.
1207 # Use a build tag, based on a configure check, to cope.
1209 if HAVE_STAT_TIMESPEC
1210 matchargs_os = --tag=solaristag
1220 # Build golang.org/x/net/route only on BSD systems.
1222 $(eval $(call PACKAGE_template,golang.org/x/net/route))
1224 golangorg_x_net_route_lo = \
1225 golang.org/x/net/route.lo
1231 # Build golang.org/x/net/lif only on Solaris systems.
1233 $(eval $(call PACKAGE_template,golang.org/x/net/lif))
1235 golangorg_x_net_lif_lo = \
1236 golang.org/x/net/lif.lo
1240 TEST_PACKAGES = $(addsuffix /check,$(shell cat $(srcdir)/check-packages.txt))
1243 check-recursive: check-head
1246 @echo "Test Run By $${USER} on `date`" > libgo.head
1247 @echo "Native configuration is $(host_triplet)" >> libgo.head
1249 @echo " === libgo tests ===" >> libgo.head
1252 check-tail: check-recursive check-multi
1253 @if test "$(USE_DEJAGNU)" = "yes"; then \
1256 lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1257 for dir in . $(MULTIDIRS); do \
1258 mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1259 mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1261 mv libgo.head libgo.sum; \
1262 cp libgo.sum libgo.log; \
1263 echo "Schedule of variations:" >> libgo.sum; \
1264 for dir in . $(MULTIDIRS); do \
1265 multidir=../$${dir}/$${lib}; \
1266 multivar=`cat $${multidir}/libgo.var`; \
1267 echo " $${multivar}" >> libgo.sum; \
1269 echo >> libgo.sum; \
1270 pass=0; fail=0; untested=0; \
1271 for dir in . $(MULTIDIRS); do \
1272 multidir=../$${dir}/$${lib}; \
1273 multivar=`cat $${multidir}/libgo.var`; \
1274 echo "Running target $${multivar}" >> libgo.sum; \
1275 echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1276 cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1277 cat $${multidir}/libgo.log.sep >> libgo.log; \
1278 if test -n "${MULTIDIRS}"; then \
1279 echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \
1280 echo >> libgo.sum; \
1282 p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1283 pass=`expr $$pass + $$p`; \
1284 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1285 echo "# of expected passes $$p" >> libgo.sum; \
1287 p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1288 fail=`expr $$fail + $$p`; \
1289 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1290 echo "# of unexpected failures $$p" >> libgo.sum; \
1292 p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1293 untested=`expr $$untested + $$p`; \
1294 if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1295 echo "# of untested testcases $$p" >> libgo.sum; \
1298 echo >> libgo.sum; \
1299 echo " === libgo Summary ===" >> libgo.sum; \
1300 echo >> libgo.sum; \
1301 if test "$$pass" -ne "0"; then \
1302 echo "# of expected passes $$pass" >> libgo.sum; \
1304 if test "$$fail" -ne "0"; then \
1305 echo "# of unexpected failures $$fail" >> libgo.sum; \
1307 if test "$$untested" -ne "0"; then \
1308 echo "# of untested testcases $$untested" >> libgo.sum; \
1310 echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*\)$$/\1/p'` >> libgo.sum; \
1311 echo >> libgo.log; \
1312 echo "runtest completed at `date`" >> libgo.log; \
1313 if test "$$fail" -ne "0"; then \
1321 @rm -f libgo.sum libgo.log libgo.tail
1323 [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1324 echo "$${multivar}" > libgo.var
1325 @for f in $(TEST_PACKAGES); do \
1326 rm -f $$f-testsum $$f-testlog; \
1328 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES)
1329 @for f in $(TEST_PACKAGES); do \
1330 if test -f $$f-testsum; then \
1331 cat $$f-testsum >> libgo.sum; \
1333 if test -f $$f-testlog; then \
1334 cat $$f-testlog >> libgo.log; \
1339 $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1342 -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=.
1344 MOSTLYCLEANFILES = \
1345 s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \
1346 s-libcalls s-libcalls-list s-syscall_arch s-gen-sysinfo s-sysinfo \
1348 libgo.head libgo.sum.sep libgo.log.sep libgo.var \
1350 runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
1353 find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1354 find . -name '*.$(OBJEXT)' -print | xargs rm -f
1355 find . -name '*-testsum' -print | xargs rm -f
1356 find . -name '*-testlog' -print | xargs rm -f
1358 CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
1361 find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1362 find . -name '*.a' -print | xargs rm -f
1363 find . -name '*.gox' -print | xargs rm -f
1364 find . -name '*.s-gox' -print | xargs rm -f
1367 find . -name '*.lo.dep' -print | xargs rm -f
1369 include $(top_srcdir)/../multilib.am
1372 ALL_LOCAL_DEPS = add-aix-fat-library
1376 all-local: $(ALL_LOCAL_DEPS)
1378 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
1380 # If we want to use "AR -r" when creating AIX FAT archives,
1381 # AR must be stripped of all its -X flags.
1382 # Otherwize, if AR was defined with -X32_64, the replace option would
1383 # erase the default .so when adding the extra one. There is no
1384 # order priority within -X flags.
1385 add-aix-fat-library: all-multi
1386 @if test "$(MULTIBUILDTOP)" = ""; then \
1387 arx=`echo $(AR) | sed -e 's/-X[^ ]*//g'`; \
1388 $${arx} -X$(AIX_EXTRA_ARCH) rc .libs/$(PACKAGE).a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1389 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR); \
1390 $${arx} -X$(AIX_EXTRA_ARCH) rc libgobegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1391 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgobegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgobegin_a_OBJECTS); \
1392 $${arx} -X$(AIX_EXTRA_ARCH) rc libgolibbegin.a ../ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \
1393 $${arx} -X$(AIX_EXTRA_ARCH) rc ../pthread/$(PACKAGE)/libgolibbegin.a ../pthread/ppc$(AIX_EXTRA_ARCH)/$(PACKAGE)/$(libgolibbegin_a_OBJECTS); \