automake
[Top][All Lists]
Advanced

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

Rolling your own dependencies


From: Bruce Korb
Subject: Rolling your own dependencies
Date: Sun, 25 Jul 2010 08:31:58 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100520 SUSE/3.0.5 Thunderbird/3.0.5

Hi Ralf,

In the end, this is where I wound up:

1.  In configure.ac, ensure that there is some compilation language
    a la AC_PROG_CC that enables the ``if AMDEP'' machinery
    (i.e. AM_SET_DEPDIR gets invoked).

2.  in Makefile.ac you have something like this:
> if AMDEP
> DEP_ARG         = -MF$(DEPDIR)/opts-dep
> TOUCH_SENTINEL  = touch -r $(DEPDIR)/opts-dep $@
> include $(DEPDIR)/opts-dep
> else
> DEP_FILE        =
> DEP_ARG         =
> TOUCH_SENTINEL  = touch $@
> endif
> stamp-opts : opts.def $(CLexe) $(AGexe)
>       $(AG_ENV) ; $(AGEXE_LIB) $(DEP_ARG) $(srcdir)/opts.def
>       $(TOUCH_SENTINEL)

3.  This depends upon AC_PROG_CC defining AMDEP as an automake
    conditional *AND* jiggering some per-directory configury
    scripting (aka "config.status" scripting) to grep out
    file names from ``include $(DEPDIR)/whatever'' lines to
    insert "# dummy" text into them.

It means that I cannot (directly) use the dependency file as
the sentinel because the time stamp after the ``echo "# dummy">xxx''
command is too recent.  I guess that's not the end of the world
since everybody has "touch -r" :)

Still and all, it would be Really Nice to change the doc for
AM_SET_DEPDIR so I could use it legally:

> 6.4.3 Private Macros
> --------------------
> 
> The following macros are private macros you should not call directly.
> They are called by the other public macros when appropriate.  Do not
> rely on them, as they might be changed in a future version.  Consider
> them as implementation details; or better, do not consider them at all:
> skip this section!
> 
> `_AM_DEPENDENCIES'
> `AM_SET_DEPDIR'
> `AM_DEP_TRACK'
> `AM_OUTPUT_DEPENDENCY_COMMANDS'
>      These macros are used to implement Automake's automatic dependency
>      tracking scheme.  They are called automatically by Automake when
>      required, and there should be no need to invoke them manually.

or some other alternative and document the infrastructure used.  :)

Thanks - Bruce



reply via email to

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