]> git.saurik.com Git - apt.git/blobdiff - vendor/makefile
eipp: make no difference between remove & purge
[apt.git] / vendor / makefile
index c05b516ef36375ba6e38d7b4d0bfda9952e508cc..966c3d080896434c0e751736c52b3d9290e1ea5b 100644 (file)
@@ -5,7 +5,7 @@ SUBDIR=vendor
 # Bring in the default rules
 include ../buildlib/defaults.mak
 
 # Bring in the default rules
 include ../buildlib/defaults.mak
 
-all headers library binary program doc manpages debiandoc test update-po startup dirs: current
+all headers library binary program doc manpages docbook test update-po startup dirs: current
 all: all/subdirs
 binary: binary/subdirs
 doc: doc/subdirs
 all: all/subdirs
 binary: binary/subdirs
 doc: doc/subdirs
@@ -14,11 +14,9 @@ veryclean: veryclean/subdirs
 dirs: dirs/subdirs
 manpages: manpages/subdirs
 
 dirs: dirs/subdirs
 manpages: manpages/subdirs
 
-all/subdirs binary/subdirs doc/subdirs dirs/subdirs manpages/subdirs:
-       $(MAKE) -C current $(patsubst %/subdirs,%,$@)
-
-clean/subdirs veryclean/subdirs:
-       test ! -e current || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+all/subdirs binary/subdirs doc/subdirs dirs/subdirs manpages/subdirs clean/subdirs veryclean/subdirs:
+       test ! -e current/makefile || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+       test ! -e current/makefile.auto || $(MAKE) -C current -f makefile.auto $(patsubst %/subdirs,%,$@)
 
 current:
        rm -f $@
 
 current:
        rm -f $@
@@ -29,15 +27,32 @@ current:
                        break; \
                fi; \
        done
                        break; \
                fi; \
        done
-       # if we haven't found a specific, look for a deriving in hardcoded order
-       test -e $@ || \
-               (dpkg-vendor --derives-from ubuntu && cp ln -s ubuntu $@ ) || \
-               ln -s debian $@
+       # if we haven't found a specific, look for a deriving
+       # we do ubuntu and debian last as those are the biggest families
+       # and would therefore potentially 'shadow' smaller families
+       # (especially debian as it sorts quiet early)
+       if ! test -e $@; then \
+               find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | while read DISTRO; do \
+                       if [ "$$DISTRO" = 'debian' -o "$$DISTRO" = 'ubuntu' ]; then continue; fi; \
+                       if dpkg-vendor --derives-from $$DISTRO; then \
+                               ln -s $$DISTRO $@; \
+                               break; \
+                       fi; \
+               done; \
+               test -e $@ || \
+                       (dpkg-vendor --derives-from ubuntu && cp ln -s ubuntu $@ ) || \
+                       ln -s debian $@; \
+       fi
+       if test ! -e current/makefile; then \
+               sed "s#@@VENDOR@@#$(notdir $(shell readlink -f current))#" vendor.makefile > current/makefile.auto; \
+       fi
 
 .PHONY: clean veryclean all binary vendor
 
 clean: clean/current
 
 .PHONY: clean veryclean all binary vendor
 
 clean: clean/current
+clean/current: clean/subdirs
+       rm -f current/makefile.auto current
 
 
-clean/current:
-       test ! -e current || $(MAKE) -C current clean
-       rm -f current
+veryclean: veryclean/current
+veryclean/current: veryclean/subdirs
+       rm -f current/makefile.auto current