aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/Makefile40
-rw-r--r--src/runtime/clean.bash8
-rw-r--r--src/runtime/make.bash20
3 files changed, 51 insertions, 17 deletions
diff --git a/src/runtime/Makefile b/src/runtime/Makefile
new file mode 100644
index 0000000000..52741c1257
--- /dev/null
+++ b/src/runtime/Makefile
@@ -0,0 +1,40 @@
+# Copyright 2009 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+CFLAGS=
+O=6
+CC=$(O)c
+AS=$(O)a
+
+LIB=lib_$(GOARCH)_$(GOOS).a
+
+RT0OFILES=\
+ rt0_$(GOARCH)_$(GOOS).$O\
+
+LIBOFILES=\
+ rt1_$(GOARCH)_$(GOOS).$O\
+ rt2_$(GOARCH).$O\
+
+OFILES=$(RT0OFILES) $(LIBOFILES)
+HFILES=
+
+install: rt0 $(LIB)
+ cp $(RT0OFILES) $(GOROOT)/lib
+ cp $(LIB) $(GOROOT)/lib
+
+rt0: $(RT0OFILES)
+
+$(LIB): $(LIBOFILES)
+ $(O)ar rc $(LIB) $(LIBOFILES)
+
+$(OFILES): $(HFILES)
+
+clean:
+ rm -f *.$(O) *.a
+
+%.$O: %.c
+ $(CC) $<
+
+%.$O: %.s
+ $(AS) $<
diff --git a/src/runtime/clean.bash b/src/runtime/clean.bash
index df203183e0..8d6bed7d10 100644
--- a/src/runtime/clean.bash
+++ b/src/runtime/clean.bash
@@ -2,4 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-echo nothing to clean here
+set -ex
+
+for GOOS in linux darwin
+do
+ make clean
+done
+
diff --git a/src/runtime/make.bash b/src/runtime/make.bash
index 9a6d42e26a..cfeed307c0 100644
--- a/src/runtime/make.bash
+++ b/src/runtime/make.bash
@@ -4,20 +4,8 @@
set -ex
-$HOME/bin/6a rt0_amd64_darwin.s
-mv rt0_amd64_darwin.6 ../../lib/rt0_amd64_darwin.6
+for GOOS in linux darwin
+do
+ make install
+done
-$HOME/bin/6a rt0_amd64_linux.s
-mv rt0_amd64_linux.6 ../../lib/rt0_amd64_linux.6
-
-$HOME/bin/6c rt1_amd64_linux.c
-mv rt1_amd64_linux.6 ../../lib/rt1_amd64_linux.6
-
-$HOME/bin/6c rt1_amd64_darwin.c
-mv rt1_amd64_darwin.6 ../../lib/rt1_amd64_darwin.6
-
-$HOME/bin/6c rt2_amd64.c
-mv rt2_amd64.6 ../../lib/rt2_amd64.6
-
-$HOME/bin/6c runtime.c
-mv runtime.6 ../../lib/rt_amd64.6