Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 1 | # Copyright 2009 The Go Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file. |
| 4 | |
Russ Cox | da392d9 | 2010-08-18 10:08:49 -0400 | [diff] [blame] | 5 | include ../../Make.inc |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 6 | |
| 7 | TARG=runtime |
| 8 | |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 9 | # Set SIZE to 32 or 64. |
| 10 | SIZE_386=32 |
| 11 | SIZE_amd64=64 |
| 12 | SIZE_arm=32 |
| 13 | SIZE=$(SIZE_$(GOARCH)) |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 14 | |
Alex Brainman | f81d471 | 2010-04-29 23:45:14 -0700 | [diff] [blame] | 15 | CFLAGS_windows=-D__WINDOWS__ |
Ian Lance Taylor | 1fab0cd | 2010-11-18 12:34:47 -0800 | [diff] [blame] | 16 | CFLAGS=-I$(GOOS) -I$(GOARCH) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(GOARCH)) $(CFLAGS_$(GOOS)) |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 17 | |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 18 | GOFILES=\ |
Russ Cox | e63ae24 | 2010-06-21 20:53:49 -0700 | [diff] [blame] | 19 | debug.go\ |
Russ Cox | 63e878a | 2010-03-31 15:55:10 -0700 | [diff] [blame] | 20 | error.go\ |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 21 | extern.go\ |
Russ Cox | 591c74a | 2011-03-11 15:09:21 -0500 | [diff] [blame] | 22 | mem.go\ |
Russ Cox | e63ae24 | 2010-06-21 20:53:49 -0700 | [diff] [blame] | 23 | sig.go\ |
Russ Cox | 7c2b159 | 2010-10-25 17:55:50 -0700 | [diff] [blame] | 24 | softfloat64.go\ |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 25 | type.go\ |
Russ Cox | 0c3a93c | 2010-03-16 23:10:33 -0700 | [diff] [blame] | 26 | version.go\ |
Russ Cox | bc874ec | 2011-02-02 15:35:54 -0500 | [diff] [blame] | 27 | version_$(GOOS).go\ |
| 28 | version_$(GOARCH).go\ |
Luuk van Dijk | 85cae87 | 2010-11-30 18:21:26 +0100 | [diff] [blame] | 29 | runtime_defs.go\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 30 | |
Russ Cox | bc874ec | 2011-02-02 15:35:54 -0500 | [diff] [blame] | 31 | CLEANFILES+=version.go version_*.go |
| 32 | |
Alex Brainman | f81d471 | 2010-04-29 23:45:14 -0700 | [diff] [blame] | 33 | OFILES_windows=\ |
Alex Brainman | e007958 | 2010-03-09 15:09:09 -0800 | [diff] [blame] | 34 | syscall.$O\ |
| 35 | |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 36 | # 386-specific object files |
| 37 | OFILES_386=\ |
| 38 | vlop.$O\ |
| 39 | vlrt.$O\ |
| 40 | |
Kai Backman | 5289195 | 2009-06-10 11:53:07 -0700 | [diff] [blame] | 41 | # arm-specific object files |
| 42 | OFILES_arm=\ |
Kai Backman | be639b9 | 2009-06-23 11:54:23 -0700 | [diff] [blame] | 43 | memset.$O\ |
Kai Backman | d85bb81 | 2009-12-17 16:08:42 -0800 | [diff] [blame] | 44 | softfloat.$O\ |
Kai Backman | 5289195 | 2009-06-10 11:53:07 -0700 | [diff] [blame] | 45 | vlop.$O\ |
| 46 | vlrt.$O\ |
| 47 | |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 48 | OFILES=\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 49 | asm.$O\ |
Dmitriy Vyukov | 997c00f | 2011-06-28 15:09:53 -0400 | [diff] [blame] | 50 | atomic.$O\ |
Russ Cox | fdc4b4a | 2009-08-24 17:30:00 -0700 | [diff] [blame] | 51 | cgocall.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 52 | chan.$O\ |
| 53 | closure.$O\ |
Russ Cox | c19b373 | 2011-03-23 11:43:37 -0400 | [diff] [blame] | 54 | cpuprof.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 55 | float.$O\ |
Ken Thompson | f229c8b | 2010-03-09 12:49:24 -0800 | [diff] [blame] | 56 | complex.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 57 | hashmap.$O\ |
| 58 | iface.$O\ |
| 59 | malloc.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 60 | mcache.$O\ |
| 61 | mcentral.$O\ |
| 62 | mem.$O\ |
Russ Cox | ed0beea | 2009-11-17 22:16:55 -0800 | [diff] [blame] | 63 | memmove.$O\ |
Russ Cox | 33e396a | 2010-02-03 16:31:34 -0800 | [diff] [blame] | 64 | mfinal.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 65 | mfixalloc.$O\ |
| 66 | mgc0.$O\ |
| 67 | mheap.$O\ |
Russ Cox | 596c16e | 2010-03-23 20:48:23 -0700 | [diff] [blame] | 68 | mprof.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 69 | msize.$O\ |
| 70 | print.$O\ |
| 71 | proc.$O\ |
| 72 | rune.$O\ |
| 73 | runtime.$O\ |
Russ Cox | 12518e4 | 2010-01-13 17:50:02 -0800 | [diff] [blame] | 74 | runtime1.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 75 | rt0.$O\ |
| 76 | sema.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 77 | signal.$O\ |
David Symonds | b586649 | 2009-12-15 18:21:29 -0800 | [diff] [blame] | 78 | sigqueue.$O\ |
Rob Pike | 87f2208 | 2009-08-25 15:54:25 -0700 | [diff] [blame] | 79 | slice.$O\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 80 | string.$O\ |
| 81 | symtab.$O\ |
| 82 | sys.$O\ |
| 83 | thread.$O\ |
| 84 | traceback.$O\ |
| 85 | $(OFILES_$(GOARCH))\ |
Russ Cox | 12518e4 | 2010-01-13 17:50:02 -0800 | [diff] [blame] | 86 | $(OFILES_$(GOOS))\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 87 | |
| 88 | HFILES=\ |
Russ Cox | fdc4b4a | 2009-08-24 17:30:00 -0700 | [diff] [blame] | 89 | cgocall.h\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 90 | runtime.h\ |
| 91 | hashmap.h\ |
| 92 | malloc.h\ |
Russ Cox | 820dc9f | 2011-02-24 13:46:44 -0800 | [diff] [blame] | 93 | stack.h\ |
Russ Cox | 7343e03 | 2009-06-17 15:12:16 -0700 | [diff] [blame] | 94 | $(GOARCH)/asm.h\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 95 | $(GOOS)/os.h\ |
David Symonds | b586649 | 2009-12-15 18:21:29 -0800 | [diff] [blame] | 96 | $(GOOS)/signals.h\ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 97 | $(GOOS)/$(GOARCH)/defs.h\ |
| 98 | |
Russ Cox | 12518e4 | 2010-01-13 17:50:02 -0800 | [diff] [blame] | 99 | GOFILES+=$(GOFILES_$(GOOS)) |
| 100 | |
Ian Lance Taylor | 7c99dcb | 2010-02-24 17:00:25 -0800 | [diff] [blame] | 101 | # For use by cgo. |
| 102 | INSTALLFILES=$(pkgdir)/runtime.h $(pkgdir)/cgocall.h |
| 103 | |
Russ Cox | 1cecac8 | 2010-01-24 23:33:59 -0800 | [diff] [blame] | 104 | # special, out of the way compiler flag that means "add runtime metadata to output" |
| 105 | GC+= -+ |
| 106 | |
Sergio Luis O. B. Correia | 6fc8207 | 2009-11-23 17:32:51 -0800 | [diff] [blame] | 107 | include ../../Make.pkg |
Russ Cox | ab7a8d4 | 2009-06-18 13:33:28 -0700 | [diff] [blame] | 108 | |
Ian Lance Taylor | 7c99dcb | 2010-02-24 17:00:25 -0800 | [diff] [blame] | 109 | $(pkgdir)/%.h: %.h |
| 110 | @test -d $(QUOTED_GOROOT)/pkg && mkdir -p $(pkgdir) |
Christopher Nielsen | 31ccf19 | 2011-02-03 00:42:03 -0500 | [diff] [blame] | 111 | cp $< "$@" |
Ian Lance Taylor | 7c99dcb | 2010-02-24 17:00:25 -0800 | [diff] [blame] | 112 | |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 113 | clean: clean-local |
Russ Cox | a0bcaf4 | 2009-06-25 20:24:55 -0700 | [diff] [blame] | 114 | |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 115 | clean-local: |
Luuk van Dijk | 7400be8 | 2011-01-31 12:27:28 +0100 | [diff] [blame] | 116 | rm -f goc2c mkversion version.go */asm.h runtime.acid.* runtime_defs.go $$(ls *.goc | sed 's/goc$$/c/') |
Russ Cox | a0bcaf4 | 2009-06-25 20:24:55 -0700 | [diff] [blame] | 117 | |
Russ Cox | 32e979c | 2009-10-28 14:03:16 -0700 | [diff] [blame] | 118 | $(GOARCH)/asm.h: mkasmh.sh runtime.acid.$(GOARCH) |
Russ Cox | 133a158 | 2009-10-03 10:37:12 -0700 | [diff] [blame] | 119 | ./mkasmh.sh >$@.x |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 120 | mv -f $@.x $@ |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 121 | |
Russ Cox | 20c50cf | 2010-04-20 17:03:25 -0700 | [diff] [blame] | 122 | goc2c: goc2c.c |
Russ Cox | 2261021 | 2011-05-31 14:24:21 -0400 | [diff] [blame] | 123 | quietgcc -o $@ $< |
Russ Cox | b7f0580 | 2009-06-06 22:04:50 -0700 | [diff] [blame] | 124 | |
Russ Cox | 0c3a93c | 2010-03-16 23:10:33 -0700 | [diff] [blame] | 125 | mkversion: mkversion.c |
Russ Cox | 2261021 | 2011-05-31 14:24:21 -0400 | [diff] [blame] | 126 | quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a" |
Russ Cox | 0c3a93c | 2010-03-16 23:10:33 -0700 | [diff] [blame] | 127 | |
| 128 | version.go: mkversion |
Russ Cox | d3ac545 | 2011-02-18 11:35:43 -0500 | [diff] [blame] | 129 | GOROOT="$(GOROOT_FINAL)" ./mkversion >version.go |
Russ Cox | 0c3a93c | 2010-03-16 23:10:33 -0700 | [diff] [blame] | 130 | |
Russ Cox | bc874ec | 2011-02-02 15:35:54 -0500 | [diff] [blame] | 131 | version_$(GOARCH).go: |
| 132 | (echo 'package runtime'; echo 'const theGoarch = "$(GOARCH)"') >$@ |
| 133 | |
| 134 | version_$(GOOS).go: |
| 135 | (echo 'package runtime'; echo 'const theGoos = "$(GOOS)"') >$@ |
| 136 | |
Russ Cox | 20c50cf | 2010-04-20 17:03:25 -0700 | [diff] [blame] | 137 | %.c: %.goc goc2c |
Christopher Nielsen | 31ccf19 | 2011-02-03 00:42:03 -0500 | [diff] [blame] | 138 | ./goc2c "`pwd`/$<" > $@.tmp |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 139 | mv -f $@.tmp $@ |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 140 | |
Russ Cox | 820dc9f | 2011-02-24 13:46:44 -0800 | [diff] [blame] | 141 | %.$O: $(GOARCH)/%.c $(HFILES) |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 142 | $(CC) $(CFLAGS) $< |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 143 | |
Russ Cox | 820dc9f | 2011-02-24 13:46:44 -0800 | [diff] [blame] | 144 | %.$O: $(GOOS)/%.c $(HFILES) |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 145 | $(CC) $(CFLAGS) $< |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 146 | |
Russ Cox | 820dc9f | 2011-02-24 13:46:44 -0800 | [diff] [blame] | 147 | %.$O: $(GOOS)/$(GOARCH)/%.c $(HFILES) |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 148 | $(CC) $(CFLAGS) $< |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 149 | |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 150 | %.$O: $(GOARCH)/%.s $(GOARCH)/asm.h |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 151 | $(AS) $< |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 152 | |
Russ Cox | 090efde | 2009-08-13 14:41:10 -0700 | [diff] [blame] | 153 | %.$O: $(GOOS)/$(GOARCH)/%.s $(GOARCH)/asm.h |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 154 | $(AS) $< |
Russ Cox | d06a79e | 2009-05-12 16:15:52 -0700 | [diff] [blame] | 155 | |
Rob Pike | 8a20cfc | 2009-10-22 11:52:35 -0700 | [diff] [blame] | 156 | # for discovering offsets inside structs when debugging |
Russ Cox | 32e979c | 2009-10-28 14:03:16 -0700 | [diff] [blame] | 157 | runtime.acid.$(GOARCH): runtime.h proc.c |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 158 | $(CC) $(CFLAGS) -a proc.c >$@ |
Russ Cox | 2b7d147 | 2010-03-23 17:01:17 -0700 | [diff] [blame] | 159 | |
| 160 | # 386 traceback is really amd64 traceback |
| 161 | ifeq ($(GOARCH),386) |
Russ Cox | 2b7d147 | 2010-03-23 17:01:17 -0700 | [diff] [blame] | 162 | traceback.$O: amd64/traceback.c |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 163 | $(CC) $(CFLAGS) $< |
Russ Cox | c6138ef | 2010-04-22 17:52:22 -0700 | [diff] [blame] | 164 | endif |
Luuk van Dijk | 7400be8 | 2011-01-31 12:27:28 +0100 | [diff] [blame] | 165 | |
| 166 | runtime_defs.go: proc.c iface.c hashmap.c chan.c |
| 167 | CC="$(CC)" CFLAGS="$(CFLAGS)" ./mkgodefs.sh $^ > $@.x |
| 168 | mv -f $@.x $@ |