]> Cypherpunks repositories - gostls13.git/commitdiff
use a makefile to build math
authorRob Pike <r@golang.org>
Fri, 5 Sep 2008 16:55:33 +0000 (09:55 -0700)
committerRob Pike <r@golang.org>
Fri, 5 Sep 2008 16:55:33 +0000 (09:55 -0700)
fix a typo in syscall/Makefile

R=ken
OCL=14863
CL=14863

src/lib/math/Makefile [new file with mode: 0644]
src/lib/math/clean.bash
src/lib/math/make.bash
src/syscall/Makefile

diff --git a/src/lib/math/Makefile b/src/lib/math/Makefile
new file mode 100644 (file)
index 0000000..f1f2426
--- /dev/null
@@ -0,0 +1,47 @@
+# 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
+GC=$(O)g
+
+# TODO(r): building directly in the target makes internal dependencies self-consistent.
+# need to address this a better way.
+PKG=$(GOROOT)/pkg/math.a
+
+O1=\
+       atan.$O fabs.$O floor.$O fmod.$O hypot.$O log.$O pow10.$O sin.$O sqrt.$O tan.$O
+O2=\
+       asin.$O atan2.$O exp.$O
+O3=\
+       pow.$O sinh.$O
+O4=\
+       tanh.$O
+
+install: $(PKG)
+
+$(PKG): a1 a2 a3 a4
+
+a1: $(O1)
+       $(O)ar grc $(PKG) $(O1)
+
+a2: $(O2)
+       $(O)ar grc $(PKG) $(O2)
+
+a3: $(O3)
+       $(O)ar grc $(PKG) $(O3)
+
+a4: $(O4)
+       $(O)ar grc $(PKG) $(O4)
+
+nuke:
+       rm -f *.$(O) *.a $(PKG)
+
+clean:
+       rm -f *.$(O) *.a
+
+%.$O:  %.go
+       $(GC) $<
index 2cafa206d47130c2c32c5dd99019a246bf413039..9028ac2a3e57887dc27fc935884a5c197d6d01b0 100644 (file)
@@ -4,4 +4,4 @@
 
 #!/bin/bash
 
-rm -f 6.out *.6 math.a
+make nuke
index 52d0727ad3edf9fe1d7630c0fe2fdd33d598d8f0..cdc9a92682c3d9f49e9eafa38c8f3ddda3787ae5 100644 (file)
@@ -4,6 +4,6 @@
 
 #!/bin/bash
 
-# should probably just be a makefile
+make install
 
-bash g1 && cp math.a $GOROOT/pkg/math.a
+# old way: bash g1 && cp math.a $GOROOT/pkg/math.a
index 7013eeee11af8edc8e7230a54957cf9cb362cdc0..468909a109cea0df6f915fbcc367fc825af960b9 100644 (file)
@@ -18,13 +18,13 @@ OFILES=\
 
 
 install: $(PKG)
-       cp $(PKG) $(GOROOT)/pkg
+       cp $(PKG) $(GOROOT)/pkg/$(PKG)
 
 $(PKG): $(OFILES)
        $(O)ar grc $(PKG) $(OFILES)
 
 nuke:
-       rm -f *.$(O) *.a $(GOROOT)/lib/$(PKG)
+       rm -f *.$(O) *.a $(GOROOT)/pkg/$(PKG)
 
 clean:
        rm -f *.$(O) *.a