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