Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / ntp / dist / depsver.mf
blob3e4a6185a13c2ac5d4d9232dea87d45fa22743fe
1 $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
2         @[ -f $@ ] ||                                                   \
3                 cp $(top_srcdir)/deps-ver $@
4         @[ -w $@ ] ||                                                   \
5                 chmod ug+w $@
6         @cmp $(top_srcdir)/deps-ver $@ > /dev/null || (                 \
7                 $(MAKE) clean &&                                        \
8                 echo -n "Prior $(subdir)/$(DEPDIR) version " &&         \
9                 cat $@ &&                                               \
10                 rm -rf $(DEPDIR) &&                                     \
11                 mkdir $(DEPDIR) &&                                      \
12                 case "$(top_builddir)" in                               \
13                  .)                                                     \
14                     ./config.status Makefile depfiles                   \
15                     ;;                                                  \
16                  ..)                                                    \
17                         cd .. &&                                        \
18                         ./config.status $(subdir)/Makefile depfiles &&  \
19                         cd $(subdir)                                    \
20                     ;;                                                  \
21                  *)                                                     \
22                     echo 'Fatal: depsver.mf Automake fragment limited'  \
23                          'to immediate subdirectories.' &&              \
24                     echo "top_builddir: $(top_builddir)" &&             \
25                     echo "subdir:       $(subdir)" &&                   \
26                     exit 1                                              \
27                     ;;                                                  \
28                 esac &&                                                 \
29                 echo -n "Cleaned $(subdir)/$(DEPDIR) version " &&       \
30                 cat $(top_srcdir)/deps-ver                              \
31         )
32         cp $(top_srcdir)/deps-ver $@
34 .deps-ver: $(top_srcdir)/deps-ver
35         @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver
36         @touch $@
38 BUILT_SOURCES += .deps-ver
39 CLEANFILES += .deps-ver
42 # depsver.mf    included in Makefile.am for directories with .deps
44 # When building in the same directory with sources that change over
45 # time, such as when tracking using bk, the .deps files can become
46 # stale with respect to moved, deleted, or superceded headers.  Most
47 # commonly, this would exhibit as make reporting a failure to make a
48 # header file which is no longer in the location given.  To address
49 # this issue, we use a deps-ver file which is updated with each change
50 # that breaks old .deps files.  A copy of deps-ver is made into
51 # $(DEPDIR) if not already present.  If $(DEPDIR)/deps-ver is present
52 # with different contents than deps-ver, we make clean to ensure all
53 # .o files built before the incompatible change are rebuilt along with
54 # their updated .deps files, then remove $(DEPDIR) and recreate it as
55 # empty stubs.
57 # It is normal when configured with --disable-dependency-tracking for
58 # the DEPDIR to not have been created.  For this reason, we use the
59 # intermediate target .deps-ver, which invokes make recursively if
60 # DEPDIR exists.
62 # If you modify depsver.mf, please make the changes to the master
63 # copy, the one in sntp is copied by the bootstrap script from it.
65 # This comment block follows rather than leads the related code so that
66 # it stays with it in the generated Makefile.in and Makefile.