summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2010-02-24 17:00:25 -0800
committerIan Lance Taylor <iant@golang.org>2010-02-24 17:00:25 -0800
commitb9735a128b9a45776d364d37e78b60b02bc78773 (patch)
tree2f51b87e7fea93f3acf0dc77f26b0543a77ee4d9 /src
parent7d9ed9a739596cdbc82850e2a2ac6fa3a74db65d (diff)
downloadgolang-b9735a128b9a45776d364d37e78b60b02bc78773.tar.gz
Install runtime.h and cgocall.h.
This permits cgo generated code to use these header files even if the Go sources are not around. R=rsc CC=golang-dev http://codereview.appspot.com/224045
Diffstat (limited to 'src')
-rw-r--r--src/Make.pkg4
-rw-r--r--src/pkg/runtime/Makefile7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Make.pkg b/src/Make.pkg
index 3dd57b710..5d956c05a 100644
--- a/src/Make.pkg
+++ b/src/Make.pkg
@@ -30,7 +30,7 @@ QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT))
pkgdir=$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)
-INSTALLFILES=$(pkgdir)/$(TARG).a
+INSTALLFILES+=$(pkgdir)/$(TARG).a
# The rest of the cgo rules are below, but these variable updates
# must be done here so they apply to the main rules.
@@ -150,7 +150,7 @@ _cgo_.so: $(GCC_OFILES)
gcc $(_CGO_CFLAGS_$(GOARCH)) -o $@ $(GCC_OFILES) $(CGO_LDFLAGS) $(_CGO_LDFLAGS_$(GOOS))
$(pkgdir)/$(TARG).so: _cgo_.so
- @test -d $(QUOTED_GOROOT/pkg && mkdir -p $(pkgdir)/$(dir)
+ @test -d $(QUOTED_GOROOT)/pkg && mkdir -p $(pkgdir)/$(dir)
cp _cgo_.so "$@"
# Generic build rules.
diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile
index b6e4eed70..767472063 100644
--- a/src/pkg/runtime/Makefile
+++ b/src/pkg/runtime/Makefile
@@ -92,11 +92,18 @@ HFILES=\
GOFILES+=$(GOFILES_$(GOOS))
+# For use by cgo.
+INSTALLFILES=$(pkgdir)/runtime.h $(pkgdir)/cgocall.h
+
# special, out of the way compiler flag that means "add runtime metadata to output"
GC+= -+
include ../../Make.pkg
+$(pkgdir)/%.h: %.h
+ @test -d $(QUOTED_GOROOT)/pkg && mkdir -p $(pkgdir)
+ cp $< $@
+
clean: clean-local
clean-local: