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