summaryrefslogtreecommitdiff
path: root/src/lib/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-06 22:04:50 -0700
committerRuss Cox <rsc@golang.org>2009-06-06 22:04:50 -0700
commit37d2834a38670064a80d6a53dadb250424efafbc (patch)
tree9c314c5b9ad4a29289e29cb52a48aa567bc7c6d2 /src/lib/runtime
parent8257be5f9d4a4bdbb0ff096756a0e48401d620c8 (diff)
downloadgolang-37d2834a38670064a80d6a53dadb250424efafbc.tar.gz
move src/runtime -> src/lib/runtime;
hand-edited files. R=r DELTA=125 (77 added, 16 deleted, 32 changed) OCL=30001 CL=30008
Diffstat (limited to 'src/lib/runtime')
-rw-r--r--src/lib/runtime/Makefile148
1 files changed, 106 insertions, 42 deletions
diff --git a/src/lib/runtime/Makefile b/src/lib/runtime/Makefile
index 21bf4a8a8..d4652a34f 100644
--- a/src/lib/runtime/Makefile
+++ b/src/lib/runtime/Makefile
@@ -2,59 +2,123 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-# DO NOT EDIT. Automatically generated by gobuild.
-# gobuild -m >Makefile
-
-D=
-
-include $(GOROOT)/src/Make.$(GOARCH)
-AR=gopack
-
-default: packages
+# Set SIZE to 32 or 64.
+SIZE_386=32
+SIZE_amd64=64
+SIZE_arm=32
+SIZE=$(SIZE_$(GOARCH))
+
+# Setup CFLAGS. Add -D_64BIT on 64-bit platforms (sorry).
+CFLAGS_64=-D_64BIT
+CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE))
+
+# Set O to right letter.
+O_386=8
+O_amd64=6
+O_arm=5
+O=$(O_$(GOARCH))
+
+# Tools
+CC=$(O)c
+GC=$(O)g
+AS=$(O)a
+AR=6ar # sic
+
+LIB=runtime.a
+
+# 386-specific object files
+OFILES_386=\
+ vlop.$O\
+ vlrt.$O\
+
+OFILES=\
+ array.$O\
+ asm.$O\
+ chan.$O\
+ closure.$O\
+ extern.$O\
+ float.$O\
+ float_go.$O\
+ hashmap.$O\
+ iface.$O\
+ malloc.$O\
+ malloc_go.$O\
+ mcache.$O\
+ mcentral.$O\
+ mem.$O\
+ mfixalloc.$O\
+ mgc0.$O\
+ mheap.$O\
+ mheapmap$(SIZE).$O\
+ msize.$O\
+ print.$O\
+ proc.$O\
+ rune.$O\
+ runtime.$O\
+ rt0.$O\
+ sema.$O\
+ sema_go.$O\
+ signal.$O\
+ string.$O\
+ symtab.$O\
+ sys.$O\
+ thread.$O\
+ traceback.$O\
+ $(OFILES_$(GOARCH))\
+
+HFILES=\
+ runtime.h\
+ hashmap.h\
+ malloc.h\
+ $(GOOS)/os.h\
+ $(GOOS)/$(GOARCH)/defs.h\
+
+install: $(LIB) runtime.acid
+ cp $(LIB) $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/$(LIB)
+ cp runtime.acid $(GOROOT)/acid/runtime.acid
+
+$(LIB): $(OFILES)
+ $(AR) grc $(LIB) $(OFILES)
+
+$(OFILES): $(HFILES)
+
+nuke:
+ rm -f *.[568] *.a $(GOROOT)/lib/$(LIB)
clean:
- rm -rf *.[$(OS)] *.a [$(OS)].out _obj
+ rm -f *.[568] *.a runtime.acid cgo2c
-test: packages
- gotest
+%.$O: %.go
+ $(GC) $<
-coverage: packages
- gotest
- 6cov -g `pwd` | grep -v '_test\.go:'
+%.$O: %.c
+ $(CC) $(CFLAGS) $<
-%.$O: %.go
- $(GC) -I_obj $*.go
-
-%.$O: %.c
- $(CC) $*.c
-
-%.$O: %.s
- $(AS) $*.s
-
-O1=\
- runtime.$O\
+%.$O: $(GOARCH)/%.c
+ $(CC) $(CFLAGS) $<
+%.$O: $(GOOS)/%.c
+ $(CC) $(CFLAGS) $<
-phases: a1
-_obj$D/runtime.a: phases
+%.$O: $(GOOS)/$(GOARCH)/%.c
+ $(CC) $(CFLAGS) $<
-a1: $(O1)
- $(AR) grc _obj$D/runtime.a runtime.$O
- rm -f $(O1)
+%.$O: $(GOARCH)/%.s
+ $(AS) $<
+%.$O: $(GOOS)/$(GOARCH)/%.s
+ $(AS) $<
-newpkg: clean
- mkdir -p _obj$D
- $(AR) grc _obj$D/runtime.a
+cgo2c: cgo2c.c
+ quietgcc -o $@ $<
-$(O1): newpkg
-$(O2): a1
+%.c: %.cgo cgo2c
+ ./cgo2c $< > $@.tmp
+ mv -f $@.tmp $@
-nuke: clean
- rm -f $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/runtime.a
+runtime.acid: runtime.h proc.c
+ $(CC) -a proc.c >runtime.acid
-packages: _obj$D/runtime.a
+chan.acid: runtime.h chan.c
+ $(CC) -a chan.c >chan.acid
-install: packages
- test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D
- cp _obj$D/runtime.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/runtime.a