mirror of
https://github.com/golang/go.git
synced 2025-05-18 22:04:38 +00:00
Make.pkg: add DEPS= support
allow Makefiles using Make.pkg to specify a list of directories that should be installed before trying to build the package. this is a stopgap for small package trees maintained outside the standard tree. R=r http://go/go-review/1016012
This commit is contained in:
parent
eef3fbb83e
commit
bf991bb7df
@ -18,6 +18,7 @@ GOFILES+=$(patsubst %.go,%.cgo1.go,$(CGOFILES))
|
|||||||
GOFILES+=$(patsubst %.go,%.cgo2.go,$(CGOFILES))
|
GOFILES+=$(patsubst %.go,%.cgo2.go,$(CGOFILES))
|
||||||
OFILES+=$(patsubst %.go,%.cgo3.$O,$(CGOFILES))
|
OFILES+=$(patsubst %.go,%.cgo3.$O,$(CGOFILES))
|
||||||
INSTALLFILES+=$(patsubst %.go,$(pkgdir)/$(dir)/$(elem)_%.so,$(CGOFILES))
|
INSTALLFILES+=$(patsubst %.go,$(pkgdir)/$(dir)/$(elem)_%.so,$(CGOFILES))
|
||||||
|
PREREQ+=$(patsubst %,%.make,$(DEPS))
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
gotest
|
gotest
|
||||||
@ -41,10 +42,10 @@ $(pkgdir)/$(TARG).a: package
|
|||||||
@test -d $(GOROOT)/pkg && mkdir -p $(pkgdir)/$(dir)
|
@test -d $(GOROOT)/pkg && mkdir -p $(pkgdir)/$(dir)
|
||||||
cp _obj/$(TARG).a $@
|
cp _obj/$(TARG).a $@
|
||||||
|
|
||||||
_go_.$O: $(GOFILES)
|
_go_.$O: $(GOFILES) $(PREREQ)
|
||||||
$(GC) -o $@ $(GOFILES)
|
$(GC) -o $@ $(GOFILES)
|
||||||
|
|
||||||
_gotest_.$O: $(GOFILES) $(GOTESTFILES)
|
_gotest_.$O: $(GOFILES) $(GOTESTFILES) $(PREREQ)
|
||||||
$(GC) -o $@ $(GOFILES) $(GOTESTFILES)
|
$(GC) -o $@ $(GOFILES) $(GOTESTFILES)
|
||||||
|
|
||||||
_obj/$(TARG).a: _go_.$O $(OFILES)
|
_obj/$(TARG).a: _go_.$O $(OFILES)
|
||||||
@ -63,6 +64,8 @@ importpath:
|
|||||||
dir:
|
dir:
|
||||||
@echo $(dir)
|
@echo $(dir)
|
||||||
|
|
||||||
|
%.make:
|
||||||
|
(cd $* && make)
|
||||||
|
|
||||||
# To use cgo in a Go package, add a line
|
# To use cgo in a Go package, add a line
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user