octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding or speeding up full tree recompilations


From: John W. Eaton
Subject: Re: Avoiding or speeding up full tree recompilations
Date: Mon, 13 Dec 2010 15:14:58 -0500

On 13-Dec-2010, Jordi Gutiérrez Hermoso wrote:

| 2010/12/13 John W. Eaton <address@hidden>:
| > On 13-Dec-2010, Jordi Gutiérrez Hermoso wrote:
| >
| > | Whenever someone touches any build files, I think, a full tree
| > | recompilation ensues. E.g. touching foo.mk in order to add some bar.m
| > | seems to trigger this.
| 
| > If you think that the dependency information is incorrect,
| 
| Ok, having some CPU cycles to spare, I just decided to try a little
| experiment. After finishing my previous build, I touched
| src/OPERATORS/module.mk, and this did indeed ensue in a recompilation
| of, as far as I can tell, everything under src/, perhaps a few other
| things (sorry, didn't think of saving the log, oops). It didn't rerun
| configure. I probably need to touch a build file in the top-level
| directory for that to happen, but I don't want to risk another
| full-tree recompilation today to try that out.

This happens because when you touch that file, you cause the
src/Makefile to change, and generated files like version.h, mxarray.h,
and graphics.h depend that Makefile.

Does the following patch help?

The downside of using move-if-change is that if you change a file like
mxarray.h.in in a way that does not change the generated mxarray.h
file, then you will always run the rule for recreating mxarray.h even
though it doesn't need to be done.  This is why I did not change the
mv to move-if-change for the .cc.df rule.  In that case, it seems
better to go ahead and let the .df files change, even if they don't
change significantly.  But then we use move-if-change in the rules
that use the .df files, and running those commands just to find that
they are not needed takes much less time than running all the rules
for the .df files.

jwe

diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -625,12 +625,12 @@
 
 builtins.cc: $(DEF_FILES) mkbuiltins
        $(srcdir)/mkbuiltins $(DEF_FILES) > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 mxarray.h: mxarray.h.in Makefile
        $(SED) < $< \
          -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 version.h: version.h.in Makefile
        $(SED) < $< \
@@ -639,19 +639,19 @@
          -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
          -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
          -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|" > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 graphics.h: graphics.h.in genprops.awk Makefile
        $(AWK) -f $(srcdir)/genprops.awk $< > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 graphics-props.cc: graphics.h.in genprops.awk Makefile
        $(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > 
address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 DLD-FUNCTIONS/PKG_ADD: $(DLD_DYNAMIC_DEF_FILES) mk-pkg-add
        $(srcdir)/mk-pkg-add $(DLD_DYNAMIC_DEF_FILES) > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 .DOCSTRINGS: gendoc$(BUILD_EXEEXT)
        if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/DOCSTRINGS ] && [ ! -f 
DOCSTRINGS ]; then \
@@ -665,18 +665,18 @@
 
 doc-files: $(ALL_DEF_FILES)
        echo $(ALL_DEF_FILES) > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 gendoc.cc: doc-files mkgendoc
        $(srcdir)/mkgendoc doc-files > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 gendoc$(BUILD_EXEEXT): gendoc.cc
        $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS)
 
 ops.cc: $(OPERATORS_SRC) mkops
        $(srcdir)/mkops $(OPERATORS_SRC) > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 install-exec-hook: make-version-links
 
@@ -728,7 +728,7 @@
 
 $(OPT_HANDLERS) : %.cc : $(top_srcdir)/liboctave/%.in $(top_srcdir)/mk-opts.pl
        $(PERL) $(top_srcdir)/mk-opts.pl --opt-handler-fcns $< > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 ## We require Bison.
 #parse.cc : parse.y
@@ -761,7 +761,7 @@
        else \
          $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > address@hidden; \
        fi
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
 
 ## Don't use a pipeline to process gperf output since if gperf
 ## is missing but sed is not, the exit status of the pipeline
@@ -770,7 +770,7 @@
 oct-gperf.h: octave.gperf
        $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > address@hidden
        $(SED) 's,lookup\[,gperf_lookup[,' < address@hidden > address@hidden
-       mv address@hidden $@
+       $(top_srcdir)/move-if-change address@hidden $@
        rm -f address@hidden
 
 display.df display.lo: CPPFLAGS += $(X11_FLAGS)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]