summaryrefslogtreecommitdiff
path: root/vendor/makefile
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-11-30 14:01:28 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-11-30 22:15:31 +0100
commiteef71f11a5836eb82df133cb4e24cb4806642188 (patch)
treee58a2b15c0ae4df9f0f23fdf7f8a2ebb15ffc7b3 /vendor/makefile
parenta40310a5e60d880ce1bd82f0513c5d6658bb48ef (diff)
introduce a vendor system to change sources.list
Many derivatives make quiet a few simple changes to apt introducing silly diffs just to change examples and co making it harder for them to update apt and harder for us to merge real changes back. First stop: doc/examples/sources.list
Diffstat (limited to 'vendor/makefile')
-rw-r--r--vendor/makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/makefile b/vendor/makefile
new file mode 100644
index 000000000..a6d53abd0
--- /dev/null
+++ b/vendor/makefile
@@ -0,0 +1,42 @@
+# -*- make -*-
+BASE=..
+SUBDIR=vendor
+
+# Bring in the default rules
+include ../buildlib/defaults.mak
+
+all headers library binary program doc manpages debiandoc test update-po startup dirs: current
+all: all/subdirs
+binary: binary/subdirs
+doc: doc/subdirs
+clean: clean/subdirs
+veryclean: veryclean/subdirs
+dirs: dirs/subdirs
+
+all/subdirs binary/subdirs doc/subdirs dirs/subdirs:
+ $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+
+clean/subdirs veryclean/subdirs:
+ test ! -e current || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+
+current:
+ rm -f $@
+ # search for an exact match to use the correct sources.list example
+ find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | while read DISTRO; do \
+ if dpkg-vendor --is $$DISTRO; then \
+ ln -s $$DISTRO $@; \
+ 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 $@
+
+.PHONY: clean veryclean all binary vendor
+
+clean: clean/current
+
+clean/current:
+ test ! -e current || $(MAKE) -C current clean
+ rm -f current