gmake/make dependency problem

Harlan Stenn stenn at ntp.isc.org
Mon Sep 19 12:00:41 PDT 2005


I'm confused.

I believe that:

 a: b

means that 'a' depends on 'b', and if 'b' has a later timestamp than 'a'
then the rule will be invoked to produce a new 'a' from  whatever is
done with 'b'.

In this case, 'a' is ntpd-opts.c, and 'b' is ntpd-opts.def.

As can be seen on your system and mine:

> It seems that ntpd-opts.c has a timestamp 1 minute after ntpd-opts.def,

which means it is up-to-date with respect to its dependencies.

You will also note the VPATH in the Makefile includes the source
directory.

I believe this is a VPATH issues.

Am I missing something?

I appreciate your working with me on this issue.

H
--
> >
> > should show it trying to run autogen to produce ../../ntpd/ntpd-opts.c
> > (which exists and should have "proper" timestamps with respect to its
> > dependencies), and:
> 
> It doesn't though.  ntpd-opts.c depends on ntpd-opts.def, and their
> timestamps are:
> 
> % flame:/home/keramida/ws/ntp/ntp-4.2.0b/obj/ntpd$ make -ndm
> % Examining ntpd-opts.def...modified 11:01:00 Aug 30, 2005...up-to-date.
> % Examining ntpdbase-opts.def...modified 10:57:02 Aug 26, 2005...up-to-date.
> % Examining ntpd-opts.c...non-existent...modified before source...out-of-date
> .
> % cd ../../ntpd && autogen ntpd-opts.def
% update time: 17:38:09 Sep 19, 2005
> % [...]
> % flame:/home/keramida/ws/ntp/ntp-4.2.0b/obj/ntpd$ ls -ld ../../ntpd/ntpd-opt
> s.c ../../ntpd/ntpd-opts.def
> % -r--r--r--  1 keramida  keramida  - 32849 Aug 30 11:02 ../../ntpd/ntpd-opts
> .c
> % -rw-rw-r--  1 keramida  keramida  -  1255 Aug 30 11:01 ../../ntpd/ntpd-opts
> .def
> 
> It seems that ntpd-opts.c has a timestamp 1 minute after ntpd-opts.def,
> and this is what triggers the autogen run.
> 
> >  % gmake ntpd-opts.c
> >
> > should say the target is up-to-date.
> 
> I don't think this is correct.  The obj/ntpd/Makefile file contains:
> 
> % flame:/home/keramida/ws/ntp/ntp-4.2.0b/obj/ntpd$ grep ntpd-opts.def * | cat
>  -n
> %      1  EXTRA_DIST = ntpd-opts.def ntpdbase-opts.def ntpdsim-opts.def $(BUI
> LT_SOURCES)
> %      2  ntpd-opts.c: ntpd-opts.def ntpdbase-opts.def
> %      3          cd $(srcdir) && autogen ntpd-opts.def
> %      4  ntpd.1: ntpd-opts.def ntpdbase-opts.def
> %      5          cd $(srcdir) && autogen -Tagman1.tpl -bntpd ntpd-opts.def
> %      6  ntpd-opts.texi ntpd-opts.menu: ntpd-opts.def
> %      7                  -Taginfo.tpl -DLEVEL=section ntpd-opts.def
> % flame:/home/keramida/ws/ntp/ntp-4.2.0b/obj/ntpd$
> 
> The second matched line clearly states that ntpd-opts.c depends on
> ntpd-opts.def and their timestamps are backwards.  make(1) is right in
> this case, IMHO
> 


More information about the freebsd-questions mailing list