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