]> Cypherpunks repositories - gostls13.git/commitdiff
Install runtime.h and cgocall.h.
authorIan Lance Taylor <iant@golang.org>
Thu, 25 Feb 2010 01:00:25 +0000 (17:00 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 25 Feb 2010 01:00:25 +0000 (17:00 -0800)
This permits cgo generated code to use these header files even
if the Go sources are not around.

R=rsc
CC=golang-dev
https://golang.org/cl/224045

src/Make.pkg
src/pkg/runtime/Makefile

index 3dd57b71046677709a658a4e6917551a6d020ea4..5d956c05a4c87453e60ccae1f5ecf61f29b9659f 100644 (file)
@@ -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.
index b6e4eed7086b33919869175f7d470c3db4bda274..76747206353086755d1ea28a7e0f4cf1209770ef 100644 (file)
@@ -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: