bug-gnulib
[Top][All Lists]
Advanced

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

configmake: avoid make avalanche


From: Bruno Haible
Subject: configmake: avoid make avalanche
Date: Sun, 19 Apr 2009 22:10:37 +0200
User-agent: KMail/1.9.9

Currently, in a project that uses the 'configmake' module, modifying
lib/Makefile can cause an avalanche of rebuilds during the next "make".
In my case, it's because we have dependencies
    configmake.h            from Makefile,
    config.h                from $(BUILT_SOURCES), which contains configmake.h,
    all *.o files           from config.h

It's actually unnecessary to rebuild all this if the contents of configmake.h
actually did not change. I'm committing this optimization:

2009-04-19  Bruno Haible  <address@hidden>

        * modules/configmake (Makefile.am): When the contents of configmake.h
        does not change, arrange to preserve its modification time.

*** modules/configmake.orig     2009-04-19 22:05:35.000000000 +0200
--- modules/configmake  2009-04-19 21:56:12.000000000 +0200
***************
*** 26,32 ****
  # The Automake-defined pkg* macros are appended, in the order
  # listed in the Automake 1.10a+ documentation.
  configmake.h: Makefile
!       rm -f address@hidden $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
--- 26,32 ----
  # The Automake-defined pkg* macros are appended, in the order
  # listed in the Automake 1.10a+ documentation.
  configmake.h: Makefile
!       rm -f address@hidden
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
***************
*** 56,62 ****
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > address@hidden
!       mv address@hidden $@
  BUILT_SOURCES += configmake.h
  CLEANFILES += configmake.h configmake.h-t
  
--- 56,67 ----
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > address@hidden
!       if test -f $@ && cmp address@hidden $@ > /dev/null; then \
!         rm -f address@hidden; \
!       else \
!         rm -f $@; mv address@hidden $@; \
!       fi
! 
  BUILT_SOURCES += configmake.h
  CLEANFILES += configmake.h configmake.h-t
  




reply via email to

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