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