5 # Bring in the default rules
 
   6 include ../buildlib/defaults.mak
 
   8 all headers library binary program doc manpages docbook test update-po startup dirs: current
 
  10 binary: binary/subdirs
 
  13 veryclean: veryclean/subdirs
 
  15 manpages: manpages/subdirs
 
  17 all/subdirs binary/subdirs doc/subdirs dirs/subdirs manpages/subdirs clean/subdirs veryclean/subdirs:
 
  18         test ! -e current/makefile || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
 
  19         test ! -e current/makefile.auto || $(MAKE) -C current -f makefile.auto $(patsubst %/subdirs,%,$@)
 
  23         # search for an exact match to use the correct sources.list example
 
  24         find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | while read DISTRO; do \
 
  25                 if dpkg-vendor --is $$DISTRO; then \
 
  30         # if we haven't found a specific, look for a deriving
 
  31         # we do ubuntu and debian last as those are the biggest families
 
  32         # and would therefore potentially 'shadow' smaller families
 
  33         # (especially debian as it sorts quiet early)
 
  34         if ! test -e $@; then \
 
  35                 find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | while read DISTRO; do \
 
  36                         if [ "$$DISTRO" = 'debian' -o "$$DISTRO" = 'ubuntu' ]; then continue; fi; \
 
  37                         if dpkg-vendor --derives-from $$DISTRO; then \
 
  43                         (dpkg-vendor --derives-from ubuntu && cp ln -s ubuntu $@ ) || \
 
  46         if test ! -e current/makefile; then \
 
  47                 sed "s#@@VENDOR@@#$(notdir $(shell readlink -f current))#" vendor.makefile > current/makefile.auto; \
 
  50 .PHONY: clean veryclean all binary vendor
 
  54 clean/current: clean/subdirs
 
  55         rm -f current/makefile.auto current