summaryrefslogtreecommitdiff
path: root/v4l/Makefile
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-04 05:17:58 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-04 05:17:58 -0300
commit60f499c58b5e9b8f97444123f1860f727a72cee4 (patch)
tree213e8d44352f8e461d713a32e539e829940f039b /v4l/Makefile
parent093aa9a5ddcc2707db1816f8efe523a782d85e7e (diff)
downloadmediapointer-dvb-s2-60f499c58b5e9b8f97444123f1860f727a72cee4.tar.gz
mediapointer-dvb-s2-60f499c58b5e9b8f97444123f1860f727a72cee4.tar.bz2
New system for building kernel's config programs
From: Trent Piepho <xyzzy@speakeasy.org> Since v4l-dvb now uses the kernel's config system, it needs certain kernel binaries like qconf, mconf, and lxdialog to run the config targets. The kernel's Makefile is not kind enough to give us a target to just build these programs. What this patch does is introduce a new makefile, Makefile.kernel, which includes the kernel's top-level Makefile. Then adds some new "v4l-*" targets which just build the kernel config programs. The main v4l Makefile is patched to add the necessary kernel conf programs as dependencies to their respective config targets. Rules to build the kernel conf programs are added which invoke a sub-make with the new Makefile.kernel. These rules are only invoked when the kernel conf programs needed don't yet exist. If they already exist, no write access to the kernel source tree is needed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/Makefile')
-rw-r--r--v4l/Makefile78
1 files changed, 34 insertions, 44 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index b8eba1a44..6f86925a6 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -244,66 +244,56 @@ reload::
#################################################
# Configuration rules
-# SHELL used by kbuild
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
- else if [ -x /bin/bash ]; then echo /bin/bash; \
- else echo sh; fi ; fi)
-
-build := srctree=$(KDIR) HOSTCXX="$(CXX)" HOSTCC="$(HOSTCC)" CONFIG_SHELL="$(CONFIG_SHELL)" -f $(KDIR)/scripts/Makefile.build obj
-
-xconfig:: links .version
- -if [ ! -f $(KDIR)/scripts/kconfig/qconf ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/kconfig qconf-target=1 scripts/kconfig/qconf; \
- fi
+# Kernel config programs
+QCONF := $(KDIR)/scripts/kconfig/qconf
+GCONF := $(KDIR)/scripts/kconfig/gconf
+MCONF := $(KDIR)/scripts/kconfig/mconf
+CONF := $(KDIR)/scripts/kconfig/conf
+
+# lxdialog can be in either scripts/lxdialog or scripts/kconfig/lxdialog
+LXDIALOG_DIR := $(shell if [ -d $(KDIR)/scripts/kconfig/lxdialog ]; then echo kconfig/ ; fi)
+LXDIALOG_LNK := $(if $(LXDIALOG_DIR),scripts/kconfig,scripts/lxdialog)
+LXDIALOG := $(KDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog
+
+xconfig:: links .version $(QCONF)
./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/qconf Kconfig
+ $(QCONF) Kconfig
./scripts/make_noconfig.pl
-gconfig:: links .version
- -if [ ! -f $(KDIR)/scripts/kconfig/gconf ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/kconfig scripts/kconfig/gconf; \
- fi
+gconfig:: links .version $(GCONF)
./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/gconf Kconfig
+ $(QCONF) Kconfig
./scripts/make_noconfig.pl
-config:: links .version
- -if [ ! -f $(KDIR)/scripts/kconfig/conf ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/kconfig scripts/kconfig/conf; \
- fi
+config:: links .version $(CONF)
./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/conf Kconfig
+ $(CONF) Kconfig
./scripts/make_noconfig.pl
-menuconfig:: links .version
+menuconfig:: links .version $(MCONF) lxdialog
./scripts/make_kconfig.pl
- -rm scripts/lxdialog scripts/kconfig
- -if [ -d $(KDIR)/scripts/lxdialog ]; then \
- if [ ! -f $(KDIR)/scripts/lxdialog/lxdialog ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/lxdialog; \
- fi; \
- ln -s $(KDIR)/scripts/lxdialog scripts/lxdialog; \
- fi
-
- -if [ -d $(KDIR)/scripts/kconfig ]; then \
- if [ -d $(KDIR)/scripts/kconfig/lxdialog ]; then \
- if [ ! -f $(KDIR)/scripts/kconfig/lxdialog ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/kconfig/lxdialog; \
- fi; \
- fi; \
- if [ ! -f $(KDIR)/scripts/kconfig/mconf ]; then \
- $(MAKE) -C $(KDIR) $(build)=scripts/kconfig scripts/kconfig/mconf; \
- fi; \
- ln -s $(KDIR)/scripts/kconfig scripts/kconfig; \
- fi
-
- $(KDIR)/scripts/kconfig/mconf Kconfig
+ $(MCONF) Kconfig
./scripts/make_noconfig.pl
allyesconfig allmodconfig:: links .version
./scripts/make_kconfig.pl 1
./scripts/make_noconfig.pl
+# rule to build kernel conf programs
+KMAKEVARS := config-targets=1 mixed-targets=0 dot-config=0
+$(QCONF) $(GCONF) $(MCONF) $(CONF):
+ $(MAKE) -C $(KDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(notdir $@)
+
+# lxdialog has two parts, a symlink and the actual binary
+.PHONY: lxdialog
+lxdialog: $(LXDIALOG) $(LXDIALOG_LNK)
+
+$(LXDIALOG_LNK):
+ ln -snf $(KDIR)/$(LXDIALOG_LNK) $(LXDIALOG_LNK)
+
+$(LXDIALOG):
+ $(MAKE) -C $(KDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(LXDIALOG)
+
#################################################
# IVTV link rules