* fi.po: Update.
[official-gcc.git] / libgo / Makefile.am
blob1f5a0212a828dd96c0c1e93e03711d0552718dd6
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) $(OSCFLAGS) \
46         -I $(srcdir)/../libgcc -I $(srcdir)/../libbacktrace \
47         -I $(MULTIBUILDTOP)../../gcc/include
49 AM_LDFLAGS = $(HWCAP_LDFLAGS)
51 if USING_SPLIT_STACK
52 AM_LDFLAGS += -XCClinker $(SPLIT_STACK)
53 endif
55 # Multilib support.
56 MAKEOVERRIDES=
58 # Work around what appears to be a GNU make  handling MAKEFLAGS
59 # values defined in terms of make variables, as is the case for CC and
60 # friends when we are called from the top level Makefile.
61 AM_MAKEFLAGS = \
62         "AR_FLAGS=$(AR_FLAGS)" \
63         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
64         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
65         "CFLAGS=$(CFLAGS)" \
66         "CXXFLAGS=$(CXXFLAGS)" \
67         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
68         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
69         "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
70         "GOC=$(GOC)" \
71         "GOCFLAGS=$(GOCFLAGS)" \
72         "INSTALL=$(INSTALL)" \
73         "INSTALL_DATA=$(INSTALL_DATA)" \
74         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
75         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
76         "LDFLAGS=$(LDFLAGS)" \
77         "LIBCFLAGS=$(LIBCFLAGS)" \
78         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
79         "MAKE=$(MAKE)" \
80         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
81         "PICFLAG=$(PICFLAG)" \
82         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
83         "SHELL=$(SHELL)" \
84         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
85         "exec_prefix=$(exec_prefix)" \
86         "infodir=$(infodir)" \
87         "libdir=$(libdir)" \
88         "includedir=$(includedir)" \
89         "prefix=$(prefix)" \
90         "tooldir=$(tooldir)" \
91         "gxx_include_dir=$(gxx_include_dir)" \
92         "AR=$(AR)" \
93         "AS=$(AS)" \
94         "LD=$(LD)" \
95         "RANLIB=$(RANLIB)" \
96         "NM=$(NM)" \
97         "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
98         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
99         "DESTDIR=$(DESTDIR)" \
100         "WERROR=$(WERROR)"
102 # Subdir rules rely on $(FLAGS_TO_PASS)
103 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
105 if GOC_IS_LLGO
106 toolexeclib_LTLIBRARIES = libgo-llgo.la
107 toolexeclib_LIBRARIES = libgobegin-llgo.a
108 else
109 toolexeclib_LTLIBRARIES = libgo.la
110 toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
111 endif
113 toolexeclibgo_DATA = \
114         bufio.gox \
115         bytes.gox \
116         context.gox \
117         crypto.gox \
118         encoding.gox \
119         errors.gox \
120         expvar.gox \
121         flag.gox \
122         fmt.gox \
123         hash.gox \
124         html.gox \
125         image.gox \
126         io.gox \
127         log.gox \
128         math.gox \
129         mime.gox \
130         net.gox \
131         os.gox \
132         path.gox \
133         reflect.gox \
134         regexp.gox \
135         runtime.gox \
136         sort.gox \
137         strconv.gox \
138         strings.gox \
139         sync.gox \
140         syscall.gox \
141         testing.gox \
142         time.gox \
143         unicode.gox
145 toolexeclibgoarchivedir = $(toolexeclibgodir)/archive
147 toolexeclibgoarchive_DATA = \
148         archive/tar.gox \
149         archive/zip.gox
151 toolexeclibgocompressdir = $(toolexeclibgodir)/compress
153 toolexeclibgocompress_DATA = \
154         compress/bzip2.gox \
155         compress/flate.gox \
156         compress/gzip.gox \
157         compress/lzw.gox \
158         compress/zlib.gox
160 toolexeclibgocontainerdir = $(toolexeclibgodir)/container
162 toolexeclibgocontainer_DATA = \
163         container/heap.gox \
164         container/list.gox \
165         container/ring.gox
167 toolexeclibgocryptodir = $(toolexeclibgodir)/crypto
169 toolexeclibgocrypto_DATA = \
170         crypto/aes.gox \
171         crypto/cipher.gox \
172         crypto/des.gox \
173         crypto/dsa.gox \
174         crypto/ecdsa.gox \
175         crypto/elliptic.gox \
176         crypto/hmac.gox \
177         crypto/md5.gox \
178         crypto/rand.gox \
179         crypto/rc4.gox \
180         crypto/rsa.gox \
181         crypto/sha1.gox \
182         crypto/sha256.gox \
183         crypto/sha512.gox \
184         crypto/subtle.gox \
185         crypto/tls.gox \
186         crypto/x509.gox
188 toolexeclibgocryptox509dir = $(toolexeclibgocryptodir)/x509
190 toolexeclibgocryptox509_DATA = \
191         crypto/x509/pkix.gox
193 toolexeclibgodatabasedir = $(toolexeclibgodir)/database
195 toolexeclibgodatabase_DATA = \
196         database/sql.gox
198 toolexeclibgodatabasesqldir = $(toolexeclibgodatabasedir)/sql
200 toolexeclibgodatabasesql_DATA = \
201         database/sql/driver.gox
203 toolexeclibgodebugdir = $(toolexeclibgodir)/debug
205 toolexeclibgodebug_DATA = \
206         debug/dwarf.gox \
207         debug/elf.gox \
208         debug/gosym.gox \
209         debug/macho.gox \
210         debug/pe.gox \
211         debug/plan9obj.gox
213 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
215 toolexeclibgoencoding_DATA = \
216         encoding/ascii85.gox \
217         encoding/asn1.gox \
218         encoding/base32.gox \
219         encoding/base64.gox \
220         encoding/binary.gox \
221         encoding/csv.gox \
222         encoding/gob.gox \
223         encoding/hex.gox \
224         encoding/json.gox \
225         encoding/pem.gox \
226         encoding/xml.gox
228 toolexeclibgoexpdir = $(toolexeclibgodir)/exp
230 toolexeclibgoexp_DATA = \
231         exp/proxy.gox \
232         exp/terminal.gox
234 toolexeclibgogodir = $(toolexeclibgodir)/go
236 toolexeclibgogo_DATA = \
237         go/ast.gox \
238         go/build.gox \
239         go/constant.gox \
240         go/doc.gox \
241         go/format.gox \
242         go/importer.gox \
243         go/parser.gox \
244         go/printer.gox \
245         go/scanner.gox \
246         go/token.gox \
247         go/types.gox
249 toolexeclibgohashdir = $(toolexeclibgodir)/hash
251 toolexeclibgohash_DATA = \
252         hash/adler32.gox \
253         hash/crc32.gox \
254         hash/crc64.gox \
255         hash/fnv.gox
257 toolexeclibgohtmldir = $(toolexeclibgodir)/html
259 toolexeclibgohtml_DATA = \
260         html/template.gox
262 toolexeclibgoimagedir = $(toolexeclibgodir)/image
264 toolexeclibgoimage_DATA = \
265         image/color.gox \
266         image/draw.gox \
267         image/gif.gox \
268         image/jpeg.gox \
269         image/png.gox
271 toolexeclibgoimagecolordir = $(toolexeclibgoimagedir)/color
273 toolexeclibgoimagecolor_DATA = \
274         image/color/palette.gox
276 toolexeclibgoindexdir = $(toolexeclibgodir)/index
278 toolexeclibgoindex_DATA = \
279         index/suffixarray.gox
281 toolexeclibgoiodir = $(toolexeclibgodir)/io
283 toolexeclibgoio_DATA = \
284         io/ioutil.gox
286 toolexeclibgologdir = $(toolexeclibgodir)/log
288 toolexeclibgolog_DATA = \
289         log/syslog.gox
291 toolexeclibgomathdir = $(toolexeclibgodir)/math
293 toolexeclibgomath_DATA = \
294         math/big.gox \
295         math/cmplx.gox \
296         math/rand.gox
298 toolexeclibgomimedir = $(toolexeclibgodir)/mime
300 toolexeclibgomime_DATA = \
301         mime/multipart.gox \
302         mime/quotedprintable.gox
304 toolexeclibgonetdir = $(toolexeclibgodir)/net
306 toolexeclibgonet_DATA = \
307         net/http.gox \
308         net/mail.gox \
309         net/rpc.gox \
310         net/smtp.gox \
311         net/textproto.gox \
312         net/url.gox
314 toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http
316 toolexeclibgonethttp_DATA = \
317         net/http/cgi.gox \
318         net/http/cookiejar.gox \
319         net/http/fcgi.gox \
320         net/http/httptest.gox \
321         net/http/httptrace.gox \
322         net/http/httputil.gox \
323         net/http/pprof.gox
325 toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc
327 toolexeclibgonetrpc_DATA = \
328         net/rpc/jsonrpc.gox
330 toolexeclibgoosdir = $(toolexeclibgodir)/os
332 toolexeclibgoos_DATA = \
333         os/exec.gox \
334         os/signal.gox \
335         os/user.gox
337 toolexeclibgopathdir = $(toolexeclibgodir)/path
339 toolexeclibgopath_DATA = \
340         path/filepath.gox
342 toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp
344 toolexeclibgoregexp_DATA = \
345         regexp/syntax.gox
347 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
349 toolexeclibgoruntime_DATA = \
350         runtime/debug.gox \
351         runtime/pprof.gox
353 toolexeclibgosyncdir = $(toolexeclibgodir)/sync
355 toolexeclibgosync_DATA = \
356         sync/atomic.gox
358 toolexeclibgotestingdir = $(toolexeclibgodir)/testing
360 toolexeclibgotesting_DATA = \
361         testing/iotest.gox \
362         testing/quick.gox
364 toolexeclibgotextdir = $(toolexeclibgodir)/text
366 toolexeclibgotext_DATA = \
367         text/scanner.gox \
368         text/tabwriter.gox \
369         text/template.gox
371 toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template
373 toolexeclibgotexttemplate_DATA = \
374         text/template/parse.gox
376 toolexeclibgounicodedir = $(toolexeclibgodir)/unicode
378 toolexeclibgounicode_DATA = \
379         unicode/utf16.gox \
380         unicode/utf8.gox
382 if HAVE_SYS_MMAN_H
383 runtime_mem_file = runtime/mem.c
384 else
385 runtime_mem_file = runtime/mem_posix_memalign.c
386 endif
388 if LIBGO_IS_RTEMS
389 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
390 else
391 rtems_task_variable_add_file =
392 endif
394 if LIBGO_IS_LINUX
395 runtime_thread_files = runtime/thread-linux.c
396 else
397 runtime_thread_files = runtime/thread-sema.c
398 endif
400 if LIBGO_IS_LINUX
401 runtime_getncpu_file = runtime/getncpu-linux.c
402 else
403 if LIBGO_IS_DARWIN
404 runtime_getncpu_file = runtime/getncpu-bsd.c
405 else
406 if LIBGO_IS_IRIX
407 runtime_getncpu_file = runtime/getncpu-irix.c
408 else
409 if LIBGO_IS_SOLARIS
410 runtime_getncpu_file = runtime/getncpu-solaris.c
411 else
412 if LIBGO_IS_FREEBSD
413 runtime_getncpu_file = runtime/getncpu-bsd.c
414 else
415 if LIBGO_IS_NETBSD
416 runtime_getncpu_file = runtime/getncpu-bsd.c
417 else
418 runtime_getncpu_file = runtime/getncpu-none.c
419 endif
420 endif
421 endif
422 endif
423 endif
424 endif
426 runtime_files = \
427         runtime/aeshash.c \
428         runtime/go-assert.c \
429         runtime/go-breakpoint.c \
430         runtime/go-caller.c \
431         runtime/go-callers.c \
432         runtime/go-cdiv.c \
433         runtime/go-cgo.c \
434         runtime/go-construct-map.c \
435         runtime/go-ffi.c \
436         runtime/go-fieldtrack.c \
437         runtime/go-matherr.c \
438         runtime/go-memclr.c \
439         runtime/go-memcmp.c \
440         runtime/go-memequal.c \
441         runtime/go-memmove.c \
442         runtime/go-nanotime.c \
443         runtime/go-now.c \
444         runtime/go-new.c \
445         runtime/go-nosys.c \
446         runtime/go-reflect-call.c \
447         runtime/go-runtime-error.c \
448         runtime/go-setenv.c \
449         runtime/go-signal.c \
450         runtime/go-strslice.c \
451         runtime/go-type-complex.c \
452         runtime/go-type-float.c \
453         runtime/go-type-identity.c \
454         runtime/go-type-string.c \
455         runtime/go-typedesc-equal.c \
456         runtime/go-unsafe-new.c \
457         runtime/go-unsafe-newarray.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/heapdump.c \
464         runtime/mcache.c \
465         runtime/mcentral.c \
466         $(runtime_mem_file) \
467         runtime/mfixalloc.c \
468         runtime/mgc0.c \
469         runtime/mheap.c \
470         runtime/msize.c \
471         runtime/panic.c \
472         runtime/parfor.c \
473         runtime/print.c \
474         runtime/proc.c \
475         runtime/runtime_c.c \
476         runtime/thread.c \
477         $(runtime_thread_files) \
478         runtime/yield.c \
479         $(rtems_task_variable_add_file) \
480         malloc.c \
481         $(runtime_getncpu_file)
483 goc2c.$(OBJEXT): runtime/goc2c.c
484         $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) $<
486 goc2c: goc2c.$(OBJEXT)
487         $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $<
489 malloc.c: $(srcdir)/runtime/malloc.goc goc2c
490         ./goc2c $< > $@.tmp
491         mv -f $@.tmp $@
493 %.c: $(srcdir)/runtime/%.goc goc2c
494         ./goc2c $< > $@.tmp
495         mv -f $@.tmp $@
497 version.go: s-version; @true
498 s-version: Makefile
499         rm -f version.go.tmp
500         echo "package sys" > version.go.tmp
501         echo 'const DefaultGoroot = "$(prefix)"' >> version.go.tmp
502         echo 'const TheVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'"' >> version.go.tmp
503         echo 'const GOARCH = "'$(GOARCH)'"' >> version.go.tmp
504         echo 'const GOOS = "'$(GOOS)'"' >> version.go.tmp
505         echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
506         echo >> version.go.tmp
507         echo "type ArchFamilyType int" >> version.go.tmp
508         echo >> version.go.tmp
509         echo "const (" >> version.go.tmp
510         echo "  UNKNOWN ArchFamilyType = iota" >> version.go.tmp
511         for a in $(ALLGOARCHFAMILY); do \
512           echo "        $${a}" >> version.go.tmp; \
513         done
514         echo ")" >> version.go.tmp
515         echo >> version.go.tmp
516         for a in $(ALLGOARCH); do \
517           f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
518           n="$${f}`echo $${a} | sed -e 's/.//'`"; \
519           if test "$${a}" = "$(GOARCH)"; then \
520             echo "const Goarch$${n} = 1" >> version.go.tmp; \
521           else \
522             echo "const Goarch$${n} = 0" >> version.go.tmp; \
523           fi; \
524         done
525         echo >> version.go.tmp
526         echo "const (" >> version.go.tmp
527         echo "  ArchFamily = $(GOARCH_FAMILY)" >> version.go.tmp
528         echo "  BigEndian = $(GOARCH_BIGENDIAN)" >> version.go.tmp
529         echo "  CacheLineSize = $(GOARCH_CACHELINESIZE)" >> version.go.tmp
530         echo "  PhysPageSize = $(GOARCH_PHYSPAGESIZE)" >> version.go.tmp
531         echo "  PCQuantum = $(GOARCH_PCQUANTUM)" >> version.go.tmp
532         echo "  Int64Align = $(GOARCH_INT64ALIGN)" >> version.go.tmp
533         echo "  HugePageSize = $(GOARCH_HUGEPAGESIZE)" >> version.go.tmp
534         echo "  MinFrameSize = $(GOARCH_MINFRAMESIZE)" >> version.go.tmp
535         echo ")" >> version.go.tmp
536         echo >> version.go.tmp
537         for a in $(ALLGOOS); do \
538           f=`echo $${a} | sed -e 's/\(.\).*/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \
539           n="$${f}`echo $${a} | sed -e 's/.//'`"; \
540           if test "$${a}" = "$(GOOS)"; then \
541             echo "const Goos$${n} = 1" >> version.go.tmp; \
542           else \
543             echo "const Goos$${n} = 0" >> version.go.tmp; \
544           fi; \
545         done
546         echo >> version.go.tmp
547         echo "type Uintreg uintptr" >> version.go.tmp
548         $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
549         $(STAMP) $@
551 runtime_sysinfo.go: s-runtime_sysinfo; @true
552 s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
553         $(SHELL) $(srcdir)/mkrsysinfo.sh
554         $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
555         $(STAMP) $@
557 sigtab.go: s-sigtab; @true
558 s-sigtab: $(srcdir)/mksigtab.sh gen-sysinfo.go
559         GOOS=$(GOOS) $(SHELL) $(srcdir)/mksigtab.sh > tmp-sigtab.go
560         $(SHELL) $(srcdir)/mvifdiff.sh tmp-sigtab.go sigtab.go
561         $(STAMP) $@
563 runtime.inc: s-runtime-inc; @true
564 s-runtime-inc: runtime.lo Makefile
565         rm -f runtime.inc.tmp2
566         grep -v "#define _" runtime.inc.tmp | grep -v "#define [cm][01234] " > runtime.inc.tmp2
567         for pattern in '_[GP][a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
568           grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
569         done
570         $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
571         $(STAMP) $@
573 noinst_DATA = zstdpkglist.go
575 # Generate the list of go std packages that were included in libgo
576 zstdpkglist.go: s-zstdpkglist; @true
577 s-zstdpkglist: Makefile
578         rm -f zstdpkglist.go.tmp
579         echo 'package main' > zstdpkglist.go.tmp
580         echo "" >> zstdpkglist.go.tmp
581         echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
582         echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's/\.lo /\": true,\n/g' | grep -v _c | sed 's/\.lo/\": true,/' | sed 's/^/\t\"/' | sort -u >> zstdpkglist.go.tmp
583         echo '}' >> zstdpkglist.go.tmp
584         $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
585         $(STAMP) $@
587 if LIBGO_IS_LINUX
588 syscall_epoll_file = epoll.go
589 else
590 syscall_epoll_file =
591 endif
593 libcalls.go: s-libcalls; @true
594 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
595         rm -f libcalls.go.tmp
596         $(AWK) -f $(srcdir)/go/syscall/mksyscall.awk `cat libcalls-list` > libcalls.go.tmp
597         $(SHELL) $(srcdir)/mvifdiff.sh libcalls.go.tmp libcalls.go
598         $(STAMP) $@
600 libcalls-list: s-libcalls-list; @true
601 s-libcalls-list: Makefile $(srcdir)/go/syscall/*.go
602         rm -f libcalls-list.tmp
603         $(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/syscall $(matchargs_syscall) > libcalls-list.tmp
604         $(SHELL) $(srcdir)/mvifdiff.sh libcalls-list.tmp libcalls-list
605         $(STAMP) $@
607 syscall_arch.go: s-syscall_arch; @true
608 s-syscall_arch: Makefile
609         rm -f syscall_arch.go.tmp
610         echo "package syscall" > syscall_arch.go.tmp
611         echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
612         echo 'const OS = "'$(GOOS)'"' >> syscall_arch.go.tmp
613         $(SHELL) $(srcdir)/mvifdiff.sh syscall_arch.go.tmp syscall_arch.go
614         $(STAMP) $@
616 SYSINFO_FLAGS = \
617         $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
618         $(CPPFLAGS) $(OSCFLAGS) -O
620 gen-sysinfo.go: s-gen-sysinfo; @true
621 s-gen-sysinfo: $(srcdir)/sysinfo.c config.h
622         $(CC) $(SYSINFO_FLAGS) -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s $(srcdir)/sysinfo.c
623         rm -f sysinfo.s
624         $(SHELL) $(srcdir)/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go
625         $(STAMP) $@
627 errno.i: s-errno; @true
628 s-errno:
629         echo '#include <errno.h>' | $(CC) $(SYSINFO_FLAGS) -x c - -E -dM > tmp-errno.i
630         $(SHELL) $(srcdir)/mvifdiff.sh tmp-errno.i errno.i
631         $(STAMP) $@
633 sysinfo.go: s-sysinfo; @true
634 s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i
635         $(SHELL) $(srcdir)/mksysinfo.sh
636         $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go
637         $(STAMP) $@
639 # The epoll struct has an embedded union and is packed on x86_64,
640 # which is too complicated for mksysinfo.sh.  We find the offset of
641 # the only field we care about in configure.ac, and generate the
642 # struct here.
643 epoll.go: s-epoll; @true
644 s-epoll: Makefile
645         rm -f epoll.go.tmp
646         echo 'package syscall' > epoll.go.tmp
647         echo 'type EpollEvent struct {' >> epoll.go.tmp
648         echo '  Events uint32' >> epoll.go.tmp
649         case "$(SIZEOF_STRUCT_EPOLL_EVENT),$(STRUCT_EPOLL_EVENT_FD_OFFSET)" in \
650         0,0) echo 1>&2 "*** struct epoll_event data.fd offset unknown"; \
651            exit 1; ;; \
652         8,4) echo '     Fd int32' >> epoll.go.tmp; ;; \
653         12,4) echo '    Fd int32' >> epoll.go.tmp; \
654            echo '       Pad [4]byte' >> epoll.go.tmp; ;; \
655         12,8) echo '    Pad [4]byte' >> epoll.go.tmp; \
656            echo '       Fd int32' >> epoll.go.tmp; ;; \
657         16,8) echo '    Pad [4]byte' >> epoll.go.tmp; \
658            echo '       Fd int32' >> epoll.go.tmp; \
659            echo '       Pad2 [4]byte' >> epoll.go.tmp; ;; \
660         *) echo 1>&2 "*** struct epoll_event unsupported"; \
661            exit 1; ;; \
662         esac
663         echo '}' >> epoll.go.tmp
664         $(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
665         $(STAMP) $@
667 if LIBGO_IS_LINUX
668 syscall_lib_clone_lo = syscall/clone_linux.lo
669 else
670 syscall_lib_clone_lo =
671 endif
673 PACKAGES = \
674         archive/tar \
675         archive/zip \
676         bufio \
677         bytes \
678         compress/bzip2 \
679         compress/flate \
680         compress/gzip \
681         compress/lzw \
682         compress/zlib \
683         container/heap \
684         container/list \
685         container/ring \
686         context \
687         crypto \
688         crypto/aes \
689         crypto/cipher \
690         crypto/des \
691         crypto/dsa \
692         crypto/ecdsa \
693         crypto/elliptic \
694         crypto/hmac \
695         crypto/md5 \
696         crypto/rand \
697         crypto/rc4 \
698         crypto/rsa \
699         crypto/sha1 \
700         crypto/sha256 \
701         crypto/sha512 \
702         crypto/subtle \
703         crypto/tls \
704         crypto/x509 \
705         crypto/x509/pkix \
706         database/sql \
707         database/sql/driver \
708         debug/dwarf \
709         debug/elf \
710         debug/gosym \
711         debug/macho \
712         debug/pe \
713         debug/plan9obj \
714         encoding \
715         encoding/ascii85 \
716         encoding/asn1 \
717         encoding/base32 \
718         encoding/base64 \
719         encoding/binary \
720         encoding/csv \
721         encoding/gob \
722         encoding/hex \
723         encoding/json \
724         encoding/pem \
725         encoding/xml \
726         errors \
727         exp/proxy \
728         exp/terminal \
729         expvar \
730         flag \
731         fmt \
732         go/ast \
733         go/build \
734         go/constant \
735         go/doc \
736         go/format \
737         go/importer \
738         go/internal/gccgoimporter \
739         go/internal/gcimporter \
740         go/parser \
741         go/printer \
742         go/scanner \
743         go/token \
744         go/types \
745         golang_org/x/net/http2/hpack \
746         golang_org/x/net/lex/httplex \
747         hash \
748         hash/adler32 \
749         hash/crc32 \
750         hash/crc64 \
751         hash/fnv \
752         html \
753         html/template \
754         image \
755         image/color \
756         image/color/palette \
757         image/draw \
758         image/gif \
759         image/internal/imageutil \
760         image/jpeg \
761         image/png \
762         index/suffixarray \
763         internal/nettrace \
764         internal/race \
765         internal/singleflight \
766         internal/syscall/unix \
767         internal/testenv \
768         internal/trace \
769         io \
770         io/ioutil \
771         log \
772         log/syslog \
773         math \
774         math/big \
775         math/cmplx \
776         math/rand \
777         mime \
778         mime/multipart \
779         mime/quotedprintable \
780         net \
781         net/http \
782         net/http/cgi \
783         net/http/cookiejar \
784         net/http/fcgi \
785         net/http/httptest \
786         net/http/httptrace \
787         net/http/httputil \
788         net/http/internal \
789         net/http/pprof \
790         net/internal/socktest \
791         net/mail \
792         net/rpc \
793         net/rpc/jsonrpc \
794         net/smtp \
795         net/textproto \
796         net/url \
797         os \
798         os/exec \
799         os/signal \
800         os/user \
801         path \
802         path/filepath \
803         reflect \
804         regexp \
805         regexp/syntax \
806         runtime \
807         runtime/debug \
808         runtime/internal/atomic \
809         runtime/internal/sys \
810         runtime/pprof \
811         sort \
812         strconv \
813         strings \
814         sync \
815         sync/atomic \
816         syscall \
817         testing \
818         testing/iotest \
819         testing/quick \
820         text/scanner \
821         text/tabwriter \
822         text/template \
823         text/template/parse \
824         time \
825         unicode \
826         unicode/utf16 \
827         unicode/utf8
829 libgo_go_objs = \
830         $(addsuffix .lo,$(PACKAGES)) \
831         bytes/index.lo \
832         reflect/makefunc_ffi_c.lo \
833         strings/index.lo \
834         $(syscall_lib_clone_lo) \
835         syscall/errno.lo \
836         syscall/signame.lo \
837         syscall/wait.lo \
838         $(golang_org_x_net_route_lo) \
839         log/syslog/syslog_c.lo \
840         $(os_lib_inotify_lo) \
841         runtime/internal/atomic_c.lo \
842         sync/atomic_c.lo
844 libgo_ldflags = \
845         -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
847 libgo_libadd = \
848         $(libgo_go_objs) ../libbacktrace/libbacktrace.la \
849         $(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
851 libgo_la_SOURCES = $(runtime_files)
852 libgo_la_LDFLAGS = $(libgo_ldflags)
853 libgo_la_LIBADD = $(libgo_libadd)
855 libgo_llgo_la_SOURCES = $(runtime_files)
856 libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
857 libgo_llgo_la_LIBADD = $(libgo_libadd)
859 libgobegin_a_SOURCES = \
860         runtime/go-main.c
862 libgobegin_llgo_a_SOURCES = \
863         runtime/go-main.c
865 # Use -fPIC for libgobegin so that it can be put in a PIE.
866 libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
867 libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC
869 libgolibbegin_a_SOURCES = \
870         runtime/go-libmain.c
872 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
874 # Make sure runtime.inc is built before compiling any .c file.
875 $(libgo_la_OBJECTS): runtime.inc
876 $(libgo_llgo_la_OBJECTS): runtime.inc
877 $(libgobegin_a_OBJECTS): runtime.inc
878 $(libgobegin_llgo_a_OBJECTS): runtime.inc
879 $(libgolibbegin_a_OBJECTS): runtime.inc
881 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
883 GOCFLAGS = $(CFLAGS)
884 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
885 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
887 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
888         $(AM_GOCFLAGS) $(GOCFLAGS)
890 GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
891         $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) -o $@
893 # Build the dependencies for a Go package.
894 BUILDDEPS = \
895         $(MKDIR_P) $(@D); \
896         dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
897         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,,$@)))`; \
898         $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
899         if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
900           rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
901         fi; \
902         mv -f $@.tmp $@
904 # Build the .go files for a package, generating a .lo file.
905 BUILDPACKAGE = \
906         $(MKDIR_P) $(@D); \
907         files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
908         $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
910 # How to build a .gox file from a .lo file.
911 BUILDGOX = \
912         f=`echo $< | sed -e 's/.lo$$/.o/'`; \
913         $(OBJCOPY) -j .go_export $$f $@.tmp; \
914         $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
916 GOTESTFLAGS =
917 GOBENCH = 
919 # Check a package.
920 CHECK = \
921         GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
922         export GC; \
923         GOLIBS="$(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
924         export GOLIBS; \
925         RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
926         export RUNTESTFLAGS; \
927         MAKE="$(MAKE)"; \
928         export MAKE; \
929         libgccdir=`${GOC} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
930         LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
931         LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
932         export LD_LIBRARY_PATH; \
933         $(MKDIR_P) $(@D); \
934         rm -f $@-testsum $@-testlog; \
935         files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst /,_,$(@D)))" $(matchargs_$(subst /,_,$(@D)))`; \
936         if test "$(USE_DEJAGNU)" = "yes"; then \
937           $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
938         elif test "$(GOBENCH)" != ""; then \
939           $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
940         else \
941           if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
942             echo "PASS: $(@D)" >> $@-testlog; \
943             echo "PASS: $(@D)"; \
944             echo "PASS: $(@D)" > $@-testsum; \
945           else \
946             echo "FAIL: $(@D)" >> $@-testlog; \
947             cat $@-testlog; \
948             echo "FAIL: $(@D)" > $@-testsum; \
949             exit 1; \
950           fi; \
951         fi
953 # Build all packages before checking any.
954 CHECK_DEPS = \
955         $(toolexeclibgo_DATA) \
956         $(toolexeclibgoarchive_DATA) \
957         $(toolexeclibgocompress_DATA) \
958         $(toolexeclibgocontainer_DATA) \
959         $(toolexeclibgocrypto_DATA) \
960         $(toolexeclibgodebug_DATA) \
961         $(toolexeclibgoencoding_DATA) \
962         $(toolexeclibgoexp_DATA) \
963         $(toolexeclibgogo_DATA) \
964         $(toolexeclibgohash_DATA) \
965         $(toolexeclibgoimage_DATA) \
966         $(toolexeclibgoindex_DATA) \
967         $(toolexeclibgoio_DATA) \
968         $(toolexeclibgolog_DATA) \
969         $(toolexeclibgomath_DATA) \
970         $(toolexeclibgomime_DATA) \
971         $(toolexeclibgonet_DATA) \
972         $(toolexeclibgonethttp_DATA) \
973         $(toolexeclibgoos_DATA) \
974         $(toolexeclibgopath_DATA) \
975         $(toolexeclibgorpc_DATA) \
976         $(toolexeclibgoruntime_DATA) \
977         $(toolexeclibgosync_DATA) \
978         $(toolexeclibgotesting_DATA) \
979         $(toolexeclibgotext_DATA) \
980         $(toolexeclibgotexttemplate_DATA) \
981         $(toolexeclibgounicode_DATA)
983 if GOC_IS_LLGO
984 CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
985 else
986 CHECK_DEPS += libgo.la libgobegin.a
987 endif
989 # PACKAGE_template defines the rules for each package.
990 # For example, for the package bufio, it produces:
992 # @go_include@ bufio.lo.dep
993 # bufio.lo.dep: $(srcdir)/go/bufio/*.go
994 #       $(BUILDDEPS)
995 # bufio.lo:
996 #       $(BUILDPACKAGE)
997 # bufio/check: $(CHECK_DEPS)
998 #       @$(CHECK)
999 # .PHONY: bufio/check
1001 # This is invoked with $(1) set to a package, which is a directory name,
1002 # such as "bufio" or "archive/tar".
1003 define PACKAGE_template
1004 @go_include@ $(1).lo.dep
1005 $(1).lo.dep: $(srcdir)/go/$(1)/*.go
1006         $$(BUILDDEPS)
1007 $(1).lo:
1008         $$(BUILDPACKAGE)
1009 $(1)/check: $$(CHECK_DEPS)
1010         @$$(CHECK)
1011 .PHONY: $(1)/check
1012 $(1).gox: $(1).s-gox; @true
1013 $(1).s-gox: $(1).lo
1014         $$(BUILDGOX)
1015         $$(STAMP) $$@
1016 endef
1018 # This line expands PACKAGE_template once for each package name listed
1019 # in $(PACKAGES).
1020 $(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
1022 # Pass -ffp-contract=off, or 386-specific options, when building the
1023 # math package.  MATH_FLAG is defined in configure.ac.
1024 math_lo_GOCFLAGS = $(MATH_FLAG)
1026 # Add the generated file runtime_sysinfo.go to the runtime package.
1027 extra_go_files_runtime = runtime_sysinfo.go sigtab.go
1028 runtime.lo.dep: $(extra_go_files_runtime)
1030 # Add generated files to the syscall package.
1031 extra_go_files_syscall = \
1032         libcalls.go \
1033         sysinfo.go \
1034         syscall_arch.go \
1035         $(syscall_epoll_file)
1036 syscall.lo.dep: $(extra_go_files_syscall)
1038 # Pass -fgo-compiling-runtime when compiling the runtime package.
1039 runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
1040 runtime_check_GOCFLAGS = -fgo-compiling-runtime
1041 runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
1042 runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
1043 runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
1044 runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
1046 # If libffi is supported (the normal case) use the ffi build tag for
1047 # the runtime package.
1048 if USE_LIBFFI
1049 matchargs_runtime = --tag=libffi
1050 else
1051 matchargs_runtime =
1052 endif
1054 # At least for now, we need -static-libgo for this test, because
1055 # otherwise we can't get the line numbers.
1056 # Also use -fno-inline to get better results from the memory profiler.
1057 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
1059 extra_go_files_runtime_internal_sys = version.go
1060 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
1062 # FIXME: The following C files may as well move to the runtime
1063 # directory and be treated like other C files.
1065 # Use C code to speed up {bytes,strings}.IndexByte and friends.
1066 bytes/index.lo: go/bytes/indexbyte.c runtime.inc
1067         @$(MKDIR_P) bytes
1068         $(LTCOMPILE) -c -o $@ $(srcdir)/go/bytes/indexbyte.c
1069 strings/index.lo: go/strings/indexbyte.c runtime.inc
1070         @$(MKDIR_P) strings
1071         $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c
1073 # Use a C function with a fixed number of arguments to call a C
1074 # varargs function.
1075 log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
1076         @$(MKDIR_P) log/syslog
1077         $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
1079 # The interface to libffi from the reflect package is written in C.
1080 reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
1081         @$(MKDIR_P) reflect
1082         $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
1084 # The atomic functions are written in C.
1085 runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
1086         @$(MKDIR_P) runtime/internal
1087         $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
1088 sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
1089         @$(MKDIR_P) sync
1090         $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
1092 # A few syscall functions are written in C.
1093 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
1094         @$(MKDIR_P) syscall
1095         $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
1096 syscall/errno.lo: go/syscall/errno.c runtime.inc
1097         @$(MKDIR_P) syscall
1098         $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
1099 syscall/signame.lo: go/syscall/signame.c runtime.inc
1100         @$(MKDIR_P) syscall
1101         $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
1102 syscall/wait.lo: go/syscall/wait.c runtime.inc
1103         @$(MKDIR_P) syscall
1104         $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
1106 # Solaris 12 changed the type of fields in struct stat.
1107 # Use a build tag, based on a configure check, to cope.
1108 if LIBGO_IS_SOLARIS
1109 if HAVE_STAT_TIMESPEC
1110 matchargs_os = --tag=solaristag
1111 else
1112 matchargs_os =
1113 endif
1114 else
1115 matchargs_os =
1116 endif
1118 if LIBGO_IS_BSD
1120 # Build golang_org/x/net/route only on BSD systems.
1122 $(eval $(call PACKAGE_template,golang_org/x/net/route)
1124 golang_org_x_net_route_lo = \
1125         golang_org/x/net/route/route.lo
1126 golang_org_x_net_route_check = \
1127         golang_org/x/net/route/check
1129 endif
1131 TEST_PACKAGES = \
1132         bufio/check \
1133         bytes/check \
1134         context/check \
1135         errors/check \
1136         expvar/check \
1137         flag/check \
1138         fmt/check \
1139         html/check \
1140         image/check \
1141         io/check \
1142         log/check \
1143         math/check \
1144         mime/check \
1145         net/check \
1146         os/check \
1147         path/check \
1148         reflect/check \
1149         regexp/check \
1150         runtime/check \
1151         sort/check \
1152         strconv/check \
1153         strings/check \
1154         sync/check \
1155         syscall/check \
1156         time/check \
1157         unicode/check \
1158         archive/tar/check \
1159         archive/zip/check \
1160         compress/bzip2/check \
1161         compress/flate/check \
1162         compress/gzip/check \
1163         compress/lzw/check \
1164         compress/zlib/check \
1165         container/heap/check \
1166         container/list/check \
1167         container/ring/check \
1168         crypto/aes/check \
1169         crypto/cipher/check \
1170         crypto/des/check \
1171         crypto/dsa/check \
1172         crypto/ecdsa/check \
1173         crypto/elliptic/check \
1174         crypto/hmac/check \
1175         crypto/md5/check \
1176         crypto/rand/check \
1177         crypto/rc4/check \
1178         crypto/rsa/check \
1179         crypto/sha1/check \
1180         crypto/sha256/check \
1181         crypto/sha512/check \
1182         crypto/subtle/check \
1183         crypto/tls/check \
1184         crypto/x509/check \
1185         database/sql/check \
1186         database/sql/driver/check \
1187         debug/dwarf/check \
1188         debug/elf/check \
1189         debug/macho/check \
1190         debug/pe/check \
1191         debug/plan9obj/check \
1192         encoding/ascii85/check \
1193         encoding/asn1/check \
1194         encoding/base32/check \
1195         encoding/base64/check \
1196         encoding/binary/check \
1197         encoding/csv/check \
1198         encoding/gob/check \
1199         encoding/hex/check \
1200         encoding/json/check \
1201         encoding/pem/check \
1202         encoding/xml/check \
1203         exp/proxy/check \
1204         exp/terminal/check \
1205         html/template/check \
1206         go/ast/check \
1207         go/build/check \
1208         go/constant/check \
1209         go/doc/check \
1210         go/format/check \
1211         go/internal/gcimporter/check \
1212         go/internal/gccgoimporter/check \
1213         go/parser/check \
1214         go/printer/check \
1215         go/scanner/check \
1216         go/token/check \
1217         go/types/check \
1218         golang_org/x/net/http2/hpack/check \
1219         golang_org/x/net/lex/httplex/check \
1220         $(golang_org_x_net_route_check) \
1221         hash/adler32/check \
1222         hash/crc32/check \
1223         hash/crc64/check \
1224         hash/fnv/check \
1225         image/color/check \
1226         image/draw/check \
1227         image/jpeg/check \
1228         image/png/check \
1229         index/suffixarray/check \
1230         internal/singleflight/check \
1231         internal/trace/check \
1232         io/ioutil/check \
1233         log/syslog/check \
1234         math/big/check \
1235         math/cmplx/check \
1236         math/rand/check \
1237         mime/multipart/check \
1238         mime/quotedprintable/check \
1239         net/http/check \
1240         net/http/cgi/check \
1241         net/http/cookiejar/check \
1242         net/http/fcgi/check \
1243         net/http/httptest/check \
1244         net/http/httptrace/check \
1245         net/http/httputil/check \
1246         net/http/internal/check \
1247         net/internal/socktest/check \
1248         net/mail/check \
1249         net/rpc/check \
1250         net/smtp/check \
1251         net/textproto/check \
1252         net/url/check \
1253         net/rpc/jsonrpc/check \
1254         os/exec/check \
1255         os/signal/check \
1256         os/user/check \
1257         path/filepath/check \
1258         regexp/syntax/check \
1259         runtime/debug/check \
1260         runtime/pprof/check \
1261         runtime/internal/atomic/check \
1262         runtime/internal/sys/check \
1263         sync/atomic/check \
1264         text/scanner/check \
1265         text/tabwriter/check \
1266         text/template/check \
1267         text/template/parse/check \
1268         testing/quick/check \
1269         unicode/utf16/check \
1270         unicode/utf8/check
1272 check: check-tail
1273 check-recursive: check-head
1275 check-head:
1276         @echo "Test Run By $${USER} on `date`" > libgo.head
1277         @echo "Native configuration is $(host_triplet)" >> libgo.head
1278         @echo >> libgo.head
1279         @echo "         === libgo tests ===" >> libgo.head
1280         @echo >> libgo.head
1282 check-tail: check-recursive check-multi
1283         @if test "$(USE_DEJAGNU)" = "yes"; then \
1284           exit 0; \
1285         fi; \
1286         lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
1287         for dir in . $(MULTIDIRS); do \
1288           mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \
1289           mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \
1290         done; \
1291         mv libgo.head libgo.sum; \
1292         cp libgo.sum libgo.log; \
1293         echo "Schedule of variations:" >> libgo.sum; \
1294         for dir in . $(MULTIDIRS); do \
1295           multidir=../$${dir}/$${lib}; \
1296           multivar=`cat $${multidir}/libgo.var`; \
1297           echo "    $${multivar}" >> libgo.sum; \
1298         done; \
1299         echo >> libgo.sum; \
1300         pass=0; fail=0; untested=0; \
1301         for dir in . $(MULTIDIRS); do \
1302           multidir=../$${dir}/$${lib}; \
1303           multivar=`cat $${multidir}/libgo.var`; \
1304           echo "Running target $${multivar}" >> libgo.sum; \
1305           echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \
1306           cat $${multidir}/libgo.sum.sep >> libgo.sum; \
1307           cat $${multidir}/libgo.log.sep >> libgo.log; \
1308           if test -n "${MULTIDIRS}"; then \
1309             echo "              === libgo Summary for $${multivar} ===" >> libgo.sum; \
1310             echo >> libgo.sum; \
1311           fi; \
1312           p=`grep -c PASS $${multidir}/libgo.sum.sep`; \
1313           pass=`expr $$pass + $$p`; \
1314           if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1315             echo "# of expected passes          $$p" >> libgo.sum; \
1316           fi; \
1317           p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \
1318           fail=`expr $$fail + $$p`; \
1319           if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1320             echo "# of unexpected failures      $$p" >> libgo.sum; \
1321           fi; \
1322           p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \
1323           untested=`expr $$untested + $$p`; \
1324           if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \
1325             echo "# of untested testcases               $$p" >> libgo.sum; \
1326           fi; \
1327         done; \
1328         echo >> libgo.sum; \
1329         echo "          === libgo Summary ===" >> libgo.sum; \
1330         echo >> libgo.sum; \
1331         if test "$$pass" -ne "0"; then \
1332           echo "# of expected passes            $$pass" >> libgo.sum; \
1333         fi; \
1334         if test "$$fail" -ne "0"; then \
1335           echo "# of unexpected failures        $$fail" >> libgo.sum; \
1336         fi; \
1337         if test "$$untested" -ne "0"; then \
1338           echo "# of untested testcases         $$untested" >> libgo.sum; \
1339         fi; \
1340         echo `echo $(GOC) | sed -e 's/ .*//'`  `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \
1341         echo >> libgo.log; \
1342         echo "runtest completed at `date`" >> libgo.log; \
1343         if test "$$fail" -ne "0"; then \
1344           status=1; \
1345         else \
1346           status=0; \
1347         fi; \
1348         exit $$status
1350 check-am:
1351         @rm -f libgo.sum libgo.log libgo.tail
1352         @multivar="unix"; \
1353         [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \
1354         echo "$${multivar}" > libgo.var
1355         @for f in $(TEST_PACKAGES); do \
1356            rm -f $$f-testsum $$f-testlog; \
1357          done
1358         -@$(MAKE) -k $(TEST_PACKAGES)
1359         @for f in $(TEST_PACKAGES); do \
1360           if test -f $$f-testsum; then \
1361             cat $$f-testsum >> libgo.sum; \
1362           fi; \
1363           if test -f $$f-testlog; then \
1364             cat $$f-testlog >> libgo.log; \
1365           fi; \
1366         done
1368 check-multi:
1369         $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE)
1371 bench:
1372         -@$(MAKE) -k $(TEST_PACKAGES) GOBENCH=.
1374 MOSTLYCLEAN_FILES = libgo.head libgo.sum.sep libgo.log.sep
1376 mostlyclean-local:
1377         find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
1378         find . -name '*.$(OBJEXT)' -print | xargs rm -f
1379         find . -name '*-testsum' -print | xargs rm -f
1380         find . -name '*-testlog' -print | xargs rm -f
1382 CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log
1384 clean-local:
1385         find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
1386         find . -name '*.a' -print | xargs rm -f