makefile 1.8 KB

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