]> Cypherpunks repositories - gostls13.git/commitdiff
convert lib to a Makefile,
authorRuss Cox <rsc@golang.org>
Fri, 21 Nov 2008 20:36:16 +0000 (12:36 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 21 Nov 2008 20:36:16 +0000 (12:36 -0800)
mainly for "make bufio.install".

R=r
DELTA=144  (80 added, 62 deleted, 2 changed)
OCL=19760
CL=19799

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

index b381c1137f097a6cc3751cac770097fd167c91ec..143eb0b7a6f310aeaca7e1a5a9f82fd00e6f22a7 100755 (executable)
@@ -7,7 +7,7 @@ for i in lib9 libbio libmach_amd64 libregexp cmd runtime lib
 do
        cd $i
        case $i in
-       cmd | lib)
+       cmd)
                bash clean.bash
                ;;
        *)
diff --git a/src/lib/Makefile b/src/lib/Makefile
new file mode 100644 (file)
index 0000000..114b27a
--- /dev/null
@@ -0,0 +1,84 @@
+# 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.
+
+all: install
+
+GC=6g
+
+DIRS=\
+       container/array\
+       fmt\
+       http\
+       math\
+       net\
+       os\
+       reflect\
+       regexp\
+       strconv\
+       time\
+
+FILES=\
+       bignum\
+       bufio\
+       vector\
+       flag\
+       io\
+       once\
+       rand\
+       sort\
+       strings\
+       testing\
+
+clean.dirs: $(addsuffix .dirclean, $(DIRS))
+install.dirs: $(addsuffix .dirinstall, $(DIRS))
+install.files: $(addsuffix .install, $(FILES))
+nuke.dirs: $(addsuffix .dirnuke, $(DIRS))
+
+%.6: container/%.go
+       $(GC) container/$*.go
+
+%.6: %.go
+       $(GC) $*.go
+
+%.clean:
+       rm -f $*.6
+
+%.install: %.6
+       cp $*.6 $(GOROOT)/pkg/$*.6
+
+%.dirclean:
+       +cd $* && make clean
+
+%.dirinstall:
+       +cd $* && make install
+
+%.dirnuke:
+       +cd $* && make nuke
+
+clean.files:
+       rm -f 6.out *.6
+
+clean: clean.dirs clean.files
+
+install: install.dirs install.files
+
+nuke: nuke.dirs clean.files
+       rm -f $(GOROOT)/pkg/*
+
+# dependencies - should auto-generate
+
+bignum.6: fmt.dirinstall
+bufio.6: io.install os.dirinstall
+flag.6: fmt.dirinstall
+io.6: os.dirinstall syscall.dirinstall
+testing.6: flag.install fmt.dirinstall
+
+fmt.dirinstall: io.install reflect.dirinstall strconv.dirinstall
+http.dirinstall: bufio.install io.install net.dirinstall os.dirinstall strings.install 
+net.dirinstall: once.install os.dirinstall strconv.dirinstall
+os.dirinstall: syscall.dirinstall
+regexp.dirinstall: os.dirinstall
+reflect.dirinstall: strconv.dirinstall
+strconv.dirinstall: os.dirinstall
+time.dirinstall: once.install os.dirinstall
diff --git a/src/lib/clean.bash b/src/lib/clean.bash
deleted file mode 100755 (executable)
index 02f5aab..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# 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.
-
-#!/bin/bash
-
-rm -f $GOROOT/pkg/*
-
-for i in syscall math os strconv container/array reflect fmt tabwriter net time http regexp
-do
-       (cd $i; make nuke)
-done
-
diff --git a/src/lib/make.bash b/src/lib/make.bash
deleted file mode 100755 (executable)
index 4398d44..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# 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.
-
-#!/bin/bash
-
-function buildfiles() {
-       rm -f *.6
-       for i
-       do
-               base=$(basename $i .go)
-               echo 6g -o $GOROOT/pkg/$base.6 $i
-               6g -o $GOROOT/pkg/$base.6 $i
-       done
-}
-
-function builddirs() {
-       for i
-       do
-               echo; echo; echo %%%% making lib/$i %%%%; echo
-               (cd $i; make install)
-       done
-}
-
-set -e
-rm -f *.6
-
-# Don't sort the elements of the lists - some of the orderings matter.
-
-buildfiles     strings.go
-
-builddirs      syscall\
-               math\
-               os\
-               strconv\
-               container/array\
-               reflect\
-       
-buildfiles     io.go
-
-builddirs      fmt\
-               tabwriter\
-
-buildfiles     flag.go\
-               container/vector.go\
-               rand.go\
-               sort.go\
-               bufio.go\
-               once.go\
-               bignum.go\
-               testing.go\
-       
-builddirs      net\
-               time\
-               http\
-               regexp\
index a6f5fd92c6a2509e70420e73a24a3cfff25a01a5..830ac70689e1bbfaf85280b8eac5a8bae4f679b5 100755 (executable)
@@ -23,7 +23,7 @@ do
        echo; echo; echo %%%% making $i %%%%; echo
        cd $i
        case $i in
-       cmd | lib)
+       cmd)
                bash make.bash
                ;;
        *)