Cgo transforms the input file into four output files: two Go source
files, a C file for 6c (or 8c or 5c), and a C file for gcc.
-The standard package makefile rules in Make.pkg automate the
-process of using cgo. See $GOROOT/misc/cgo/stdio and
-$GOROOT/misc/cgo/gmp for examples.
+The standard package construction rules of the go command
+automate the process of using cgo. See $GOROOT/misc/cgo/stdio
+and $GOROOT/misc/cgo/gmp for examples.
Cgo does not yet work with gccgo.
// cgo -dynimport is essentially a separate helper command
// built into the cgo binary. It scans a gcc-produced executable
// and dumps information about the imported symbols and the
- // imported libraries. The Make.pkg rules for cgo prepare an
+ // imported libraries. The 'go build' rules for cgo prepare an
// appropriate executable and then use its import information
// instead of needing to make the linkers duplicate all the
// specialized knowledge gcc has about where to look for imported
# The library is built by the Makefile in the parent directory.
# This Makefile only builds mkrunetype.
-
-include ../../Make.inc
-O:=$(HOST_O)
+# GOROOT, GOOS, and GOARCH must be set explicitly.
TARG=mkrunetype
-OFILES=\
- mkrunetype.$O\
-
-include ../../Make.ccmd
-
UnicodeData-%.txt:
curl http://www.unicode.org/Public/$*/ucd/UnicodeData.txt >_$@
mv _$@ $@
+mkrunetype: mkrunetype.c
+ cc -I../../../include -o mkrunetype -L$(GOROOT)/pkg/obj/$(GOOS)_$(GOARCH)/ mkrunetype.c -l9
+
runetypebody-%.c: mkrunetype UnicodeData-%.txt
mkrunetype -p UnicodeData-$*.txt >_$@
mv _$@ $@
test: mkrunetype UnicodeData-$(UNICODE_VERSION).txt
mkrunetype -c UnicodeData-$(UNICODE_VERSION).txt
+clean:
+ rm -f UnicodeData.txt mkrunetype
\ No newline at end of file
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../../src/Make.inc
-
ALL=\
parser\
peano\
tree\
tree2\
-all: $(addsuffix .out, $(ALL))
-
-%.$O: %.go stats.go
- $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go
+all: $(ALL)
-%.out: %.$O
- $(LD) -o $@ $*.$O
+%: %.go
+ go build $*.go stats.go
-%.bench: %.out
- time ./$*.out
+%.bench: %
+ time ./$*
bench: $(addsuffix .bench, $(ALL))
clean:
- rm -f *.[$(OS)] $(addsuffix .out, $(ALL))
+ rm -f $(ALL)
-include $(GOROOT)/src/Make.inc
TARG=go1
-GOFILES=\
- dummy.go\
-
-include $(GOROOT)/src/Make.pkg
test:
echo go1: tests disabled for now TODO