# Makefile for the /contrib subdirectory
-# by default do nothing
-default:
+# by default: check whether the updated kdoc is up-to-date with the
+# sources
+default: bin/kdoc
+# let's see whether the installed kdoc is as recent as the sources. we
+# check so by comparing the installation date of the executable with
+# the modification dates of the source `kdoc' and the subpackages used
+# by it. if it is not up-to-date, then install it afresh
+#
+# note that we only check whether bin/kdoc is up-to-date. this
+# suffices, as all the other files are installed at the same time and
+# all-or-none, so they should have the same time stamp
+bin/kdoc: src/kdoc $(shell echo src/kdoc*.pm)
+ @echo ================== Remaking kdoc ====
+ $(MAKE) install
+
# specific targets
install:
cd src ; $(MAKE) ; $(MAKE) install
kdoc: kdoc-installed $(kdoc.library-files)
-# check whether kdoc is already installed. if not, then try to do so
+# check whether kdoc is already installed. if not, then try to do
+# so. also install afresh if not up-to-date with the sources
kdoc-installed:
- @if test ! -d $(kdocdir) ; then \
- echo "========================================" ; \
- echo "Trying to install kdoc first" ; \
- echo "========================================" ; \
- cd $(kdocdir:kdoc/bin=kdoc) ; \
- $(MAKE) install ; \
- echo "========================================" ; \
- echo "Done" ; \
- echo "========================================" ; \
- fi
+ cd $(kdocdir:kdoc/bin=kdoc) ; $(MAKE)
+
# now for the generation of the documentation of the sublibraries.