Commit f94a3edc by Ian Lance Taylor

libgo: only rebuild package if dependent .gox has changed

    
    Use mvifdiff and stamp files to track whether a .gox file has changed.
    When package A depends on package B, and we rebuild package B, only
    rebuild package A if package B's .gox file changes.  This is safe
    because when package A imports package B it only reads package B's .gox
    file.  This means that changes that do not affect export information
    will not cause dependent packages to be recompiled.
    
    Reviewed-on: https://go-review.googlesource.com/32476

From-SVN: r241742
parent 380f39b9
9ee8ad540d6f2f77af1821bfd977dc1820e1be8f 90f12ac1fa72a95e73cb88b6114fa3131c4ca8ee
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -924,7 +924,8 @@ BUILDPACKAGE = \ ...@@ -924,7 +924,8 @@ BUILDPACKAGE = \
# How to build a .gox file from a .lo file. # How to build a .gox file from a .lo file.
BUILDGOX = \ BUILDGOX = \
f=`echo $< | sed -e 's/.lo$$/.o/'`; \ f=`echo $< | sed -e 's/.lo$$/.o/'`; \
$(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@ $(OBJCOPY) -j .go_export $$f $@.tmp; \
$(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
GOTESTFLAGS = GOTESTFLAGS =
GOBENCH = GOBENCH =
...@@ -1022,8 +1023,10 @@ $(1).lo: ...@@ -1022,8 +1023,10 @@ $(1).lo:
$(1)/check: $$(CHECK_DEPS) $(1)/check: $$(CHECK_DEPS)
@$$(CHECK) @$$(CHECK)
.PHONY: $(1)/check .PHONY: $(1)/check
$(1).gox: $(1).lo $(1).gox: $(1).s-gox; @true
$(1).s-gox: $(1).lo
$$(BUILDGOX) $$(BUILDGOX)
$$(STAMP) $$@
endef endef
# This line expands PACKAGE_template once for each package name listed # This line expands PACKAGE_template once for each package name listed
......
...@@ -1079,7 +1079,8 @@ BUILDPACKAGE = \ ...@@ -1079,7 +1079,8 @@ BUILDPACKAGE = \
# How to build a .gox file from a .lo file. # How to build a .gox file from a .lo file.
BUILDGOX = \ BUILDGOX = \
f=`echo $< | sed -e 's/.lo$$/.o/'`; \ f=`echo $< | sed -e 's/.lo$$/.o/'`; \
$(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@ $(OBJCOPY) -j .go_export $$f $@.tmp; \
$(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
GOTESTFLAGS = GOTESTFLAGS =
GOBENCH = GOBENCH =
...@@ -3366,8 +3367,10 @@ $(1).lo: ...@@ -3366,8 +3367,10 @@ $(1).lo:
$(1)/check: $$(CHECK_DEPS) $(1)/check: $$(CHECK_DEPS)
@$$(CHECK) @$$(CHECK)
.PHONY: $(1)/check .PHONY: $(1)/check
$(1).gox: $(1).lo $(1).gox: $(1).s-gox; @true
$(1).s-gox: $(1).lo
$$(BUILDGOX) $$(BUILDGOX)
$$(STAMP) $$@
endef endef
# This line expands PACKAGE_template once for each package name listed # This line expands PACKAGE_template once for each package name listed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment