diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-08 11:01:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-08 11:01:58 -0300 |
commit | 05b97b078973c39870f58b53238dca456d2b43d7 (patch) | |
tree | 79c35b9d690667bef5471ca022bc6d6ede4fbff6 | |
parent | 672521a35cb79a8a1ae4de74f446ed1ae73a31b2 (diff) | |
download | mediapointer-dvb-s2-05b97b078973c39870f58b53238dca456d2b43d7.tar.gz mediapointer-dvb-s2-05b97b078973c39870f58b53238dca456d2b43d7.tar.bz2 |
Fix make install
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Previous patch broke make install. This patch fix it.
Also, serveral cleanups were made at core Makefile.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | v4l/Makefile | 344 | ||||
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 41 |
2 files changed, 146 insertions, 239 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index e0dbb6cef..f9c6fe516 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -3,11 +3,20 @@ obj = . endif ################################################# -# configuration +# default compilation rule + +default:: Makefile.media links .version + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules + +################################################# +# Object specific rules -include $(obj)/.myconfig -include $(obj)/Makefile.media +################################################# +# CFLAGS configuration + # for DVB EXTRA_CFLAGS += -DDVB_CVS=1 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core/ @@ -35,8 +44,12 @@ ifeq ($(CONFIG_VIDEO_PVRUSB2_24XXX),y) EXTRA_CFLAGS += -DCONFIG_VIDEO_PVRUSB2_24XXX endif +EXTRA_CFLAGS += -g + +EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) + ################################################# -# compile modules +# Kernel 2.4/2.6 specific rules ifneq ($(KERNELRELEASE),) ifeq ($(VERSION).$(PATCHLEVEL),2.6) @@ -48,10 +61,15 @@ else export-objs := $(filter $(int-m) $(obj-m),$(export-objs)) endif -CC += -I$(obj) -EXTRA_CFLAGS += -g +include $(obj)/Makefile.kern24 +-include $(TOPDIR)/Rules.make +else +# take version info from last module build if available +-include $(obj)/.version +endif -EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) +################################################# +# Directories to be used snapshot := $(wildcard $(obj)/.snapshot) ifneq ($(snapshot),) @@ -59,19 +77,17 @@ SNAPSHOT_CFLAGS := -DSNAPSHOT='$(shell cat $(snapshot))' EXTRA_CFLAGS += $(SNAPSHOT_CFLAGS) endif -include $(obj)/Makefile.kern24 --include $(TOPDIR)/Rules.make -else -# take version info from last module build if available --include $(obj)/.version -endif - KDIR := /lib/modules/$(KERNELRELEASE)/build PWD := $(shell pwd) DEST := /lib/modules/$(KERNELRELEASE)/$(MDIR) KDIR26 := /lib/modules/$(KERNELRELEASE)/kernel/drivers/media KDIRUSB := /lib/modules/$(KERNELRELEASE)/kernel/drivers/usb/media +################################################# +# Compiler fixup rules + +CC += -I$(obj) + ifeq ($(VERSION).$(PATCHLEVEL),2.6) CPPFLAGS := -I$(SUBDIRS)/../linux/include $(CPPFLAGS) -I$(SUBDIRS)/ MYCFLAGS := @@ -79,66 +95,96 @@ else MYCFLAGS := CFLAGS="-I../linux/include -D__KERNEL__ -I$(KDIR)/include -DEXPORT_SYMTAB" endif + +################################################# # which files to install? + inst-m := $(wildcard *.ko) ifeq ($(inst-m),) inst-m := $(obj-m) endif -inst_common := ir-common.ko -inst_video := btcx-risc.ko bttv.ko tda9887.ko tuner.ko tvaudio.ko tveeprom.ko saa6588.ko -#inst_video += bt87x.ko -inst_video += tvmixer.ko v4l1-compat.ko v4l2-common.ko wm8775.ko wm8739.ko cs53l32a.ko -inst_video += video-buf.ko video-buf-dvb.ko -inst_video += videodev.ko -inst_video += ir-kbd-i2c.ko msp3400.ko -inst_video += tvp5150.ko saa7134-alsa.ko saa7134-oss.ko -inst_video += saa7115.ko cx25840.ko saa7127.ko compat_ioctl32.ko -inst_video += upd64031a.ko upd64083.ko -inst_cx88 := cx88xx.ko cx8800.ko cx8802.ko cx88-alsa.ko cx88-dvb.ko -inst_video += vivi.ko -inst_cx88 += cx88-blackbird.ko cx88-vp3054-i2c.ko cx88-ivtv.ko -inst_saa7134 := saa6752hs.ko saa7134.ko saa7134-empress.ko saa7134-dvb.ko -inst_em28xx := em28xx.ko -inst_bt8xx := bt878.ko dvb-bt8xx.ko dst.ko dst_ca.ko -inst_frontends := cx22702.ko dvb-pll.ko lgdt330x.ko or51132.ko tda1004x.ko -inst_frontends += mt352.ko sp887x.ko nxt6000.ko cx24110.ko or51211.ko -inst_frontends += nxt200x.ko cx24123.ko mt312.ko stv0299.ko bcm3510.ko -inst_frontends += dib3000-common.ko dib3000mb.ko dib3000mc.ko ves1820.ko -inst_frontends += cx22700.ko tda8083.ko ves1x93.ko stv0297.ko sp8870.ko -inst_frontends += l64781.ko s5h1420.ko tda10021.ko at76c651.ko tda80xx.ko -inst_frontends += stv0297_cs2.ko zl10353.ko -inst_dvb-core := dvb-core.ko -inst_saa7146 := saa7146.ko saa7146_vv.ko -inst_b2c2 := b2c2-flexcop.ko b2c2-flexcop-pci.ko b2c2-flexcop-usb.ko -inst_cinergyT2 := cinergyT2.ko -inst_dvb-usb := dvb-usb.ko dvb-usb-vp7045.ko dvb-usb-vp702x.ko -inst_dvb-usb += dvb-usb-dtt200u.ko dvb-usb-a800.ko dvb-usb-nova-t-usb2.ko -inst_dvb-usb += dvb-usb-dibusb-common.ko dvb-usb-dibusb-mc.ko dvb-usb-dibusb-mb.ko -inst_dvb-usb += dvb-usb-umt-010.ko dvb-usb-digitv.ko dvb-usb-cxusb.ko -inst_pluto2 := pluto2.ko -inst_ttpci := budget-core.ko budget.ko ttpci-eeprom.ko budget-av.ko -inst_ttpci += budget-ci.ko budget-patch.ko dvb-ttpci.ko -inst_ttusb-budget := dvb-ttusb-budget.ko -inst_ttusb-dec := ttusb_dec.ko ttusbdecfe.ko -inst_pvrusb2 := pvrusb2.ko -inst_firesat := dvb-firesat.ko -inst_ivtv := ivtv.ko ivtv-fb.ko - v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) +################################################# # locales seem to cause trouble sometimes. LC_ALL = POSIX export LC_ALL -default:: Makefile.media links .version - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules + +################################################# +# Generic wildcard rules + +%.asm: %.o + objdump -S $< > $@ + +################################################# +# all file compilation rule all:: allmodconfig default +################################################# +# Compiling preparation rules + Makefile.media:: scripts/make_makefile.pl +.version: +ifneq ($(KERNELRELEASE),) + echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version +else + echo "No version yet." + uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version +endif + +links:: + @echo creating symbolic links... + @find ../linux/drivers/media -name '*.[ch]' -type f -exec ln -sf '{}' . \; + @find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \; + +kernel-links makelinks:: + cd ..; v4l/scripts/makelinks.sh $(KDIR) + +################################################# +# Cardlist updating rule + +card cardlist cardlists: + scripts/cardlist + +################################################# +# Cleaning rules + +clean:: + @find . -name '*.c' -type l -exec rm '{}' \; + @find . -name '*.h' -type l -exec rm '{}' \; + -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \ + ivtv-svnversion.h \ + Kconfig Kconfig.kern .config .config.cmd + +distclean:: clean + -rm -f .version .*.o.flags .*.o.d Makefile.media + -rm -rf .tmp_versions + @find .. -name '*.orig' -exec rm '{}' \; + @find .. -name '*.rej' -exec rm '{}' \; + +################################################# +# Kernel module insert/removal rules + +rmmodules:: + rmmod -w $(shell echo "$(v4l_modules)"|sed s,' ','\n',g|sed s,'-','_',g|sort|uniq -d) + +insmod load:: + scripts/insmod.sh load + +rmmod unload:: + scripts/insmod.sh unload + +reload:: + scripts/insmod.sh reload + +################################################# +# Configuration rules + xconfig:: links .version ./scripts/make_kconfig.pl $(KDIR)/scripts/kconfig/qconf Kconfig @@ -161,6 +207,9 @@ allmodconfig:: links .version mv .config.new .config ./scripts/make_noconfig.pl +################################################# +# IVTV link rules + ivtv-checkout:: @if [ ! -d ivtv ]; then \ echo retrieving the latest ivtv sources from ivtvdriver.org; \ @@ -186,91 +235,8 @@ cx88-ivtv:: @echo creating cx88-ivtv symbolic links... @ln -sf ../v4l_experimental/cx88-ivtv.c . -links:: - @echo creating symbolic links... - @find ../linux/drivers/media -name '*.[ch]' -type f -exec ln -sf '{}' . \; - @find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \; - -# @find ../linux/include -name '*.[h]' -type f -exec ln -sf '{}' . \; - -kernel-links makelinks:: - cd ..; v4l/scripts/makelinks.sh $(KDIR) - -install:: v4l-install dvb-install - -v4l-install:: v4l-rminstall - @echo -e "\nInstalling new V4L modules at corresponding Kernel dir..." - - @strip --strip-debug $(inst-m) - - -install -d $(KDIR26)/common - -install -m 644 -c $(inst_common) $(KDIR26)/common - - -install -d $(KDIR26)/video - -install -m 644 -c $(inst_video) $(KDIR26)/video - - -install -d $(KDIR26)/video/cx88 - -install -m 644 -c $(inst_cx88) $(KDIR26)/video/cx88 - - -install -d $(KDIR26)/video/saa7134 - -install -m 644 -c $(inst_saa7134) $(KDIR26)/video/saa7134 - - -install -d $(KDIR26)/video/em28xx - -install -m 644 -c $(inst_em28xx) $(KDIR26)/video/em28xx - - -install -d $(KDIR26)/video/pvrusb2 - -install -m 644 -c $(inst_pvrusb2) $(KDIR26)/video/pvrusb2 - - -install -d $(KDIR26)/video/ivtv - -install -m 644 -c $(inst_ivtv) $(KDIR26)/video/ivtv - -# -install -d $(KDIRUSB) -# -install -m 644 -c $(inst_usb) $(KDIRUSB)/ - - /sbin/depmod -a ${KERNELRELEASE} - -dvb-install:: dvb-rminstall - @echo -e "\nInstalling new DVB modules at corresponding Kernel dir..." - - @strip --strip-debug $(inst-m) - - -install -d $(KDIR26)/common - -install -m 644 -c $(inst_saa7146) $(KDIR26)/common - - -install -d $(KDIR26)/dvb/frontends - -install -m 644 -c $(inst_frontends) $(KDIR26)/dvb/frontends - - -install -d $(KDIR26)/dvb/bt8xx - -install -m 644 -c $(inst_bt8xx) $(KDIR26)/dvb/bt8xx - - -install -d $(KDIR26)/dvb/dvb-core - -install -m 644 -c $(inst_dvb-core) $(KDIR26)/dvb/dvb-core - - -install -d $(KDIR26)/dvb/b2c2 - -install -m 644 -c $(inst_b2c2) $(KDIR26)/dvb/b2c2 - - -install -d $(KDIR26)/dvb/cinergyT2 - -install -m 644 -c $(inst_cinergyT2) $(KDIR26)/dvb/cinergyT2 - - -install -d $(KDIR26)/dvb/dvb-usb - -install -m 644 -c $(inst_dvb-usb) $(KDIR26)/dvb/dvb-usb - - -install -d $(KDIR26)/dvb/pluto2 - -install -m 644 -c $(inst_pluto2) $(KDIR26)/dvb/pluto2 - - -install -d $(KDIR26)/dvb/ttpci - -install -m 644 -c $(inst_ttpci) $(KDIR26)/dvb/ttpci - - -install -d $(KDIR26)/dvb/ttusb-budget - -install -m 644 -c $(inst_ttusb-budget) $(KDIR26)/dvb/ttusb-budget - - -install -d $(KDIR26)/dvb/ttusb-dec - -install -m 644 -c $(inst_ttusb-dec) $(KDIR26)/dvb/ttusb-dec - - -install -d $(KDIR26)/dvb/firesat - -install -m 644 -c $(inst_firesat) $(KDIR26)/dvb/firesat - - /sbin/depmod -a ${KERNELRELEASE} +################################################# +# Old instalation rule old-install:: rminstall @echo -e "\nInstalling new V4L modules at $(DEST)..." @@ -282,73 +248,8 @@ old-install:: rminstall /sbin/depmod -a ${KERNELRELEASE} -rminstall:: v4l-rminstall dvb-rminstall - -v4l-rminstall:: - @echo -e "\nEliminating old V4L modules (errors on this step is not a problem).." - - -@rm -r $(DEST) \ - $(addprefix $(KDIR26)/common/, $(inst_common)) \ - $(addprefix $(KDIR26)/video/, $(inst_video)) \ - $(addprefix $(KDIR26)/video/cx88/, $(inst_cx88)) \ - $(addprefix $(KDIR26)/video/saa7134/, $(inst_saa7134)) \ - $(addprefix $(KDIR26)/video/pvrusb2/, $(inst_pvrusb2)) \ - $(addprefix $(KDIR26)/video/ivtv/, $(inst_ivtv)) \ - $(addprefix $(KDIR26)/video/em28xx/, $(inst_em28xx)) \ - $(addprefix $(KDIRUSB)/, $(inst_em28xx)) \ - $(addprefix $(KDIR26)/common/, $(addsuffix .gz,$(inst_common))) \ - $(addprefix $(KDIR26)/video/, $(addsuffix .gz,$(inst_video))) \ - $(addprefix $(KDIR26)/video/cx88/, $(addsuffix .gz,$(inst_cx88))) \ - $(addprefix $(KDIR26)/video/saa7134/, $(addsuffix .gz,$(inst_saa7134))) 2>/dev/null \ - $(addprefix $(KDIR26)/video/pvrusb2/, $(addsuffix .gz,$(inst_pvrusb2))) 2>/dev/null \ - $(addprefix $(KDIR26)/video/ivtv/, $(addsuffix .gz,$(inst_ivtv))) 2>/dev/null \ - $(addprefix $(KDIR26)/video/em28xx/, $(addsuffix .gz,$(inst_em28xx))) 2>/dev/null \ - $(addprefix $(KDIRUSB)/, $(addsuffix .gz,$(inst_em28xx))) 2>/dev/null - @echo - -dvb-rminstall:: - @echo -e "\nEliminating old DVB modules (errors on this step is not a problem).." - - -@rm -r $(DEST) \ - $(addprefix $(KDIR26)/dvb/bt8xx/, $(inst_bt8xx)) \ - $(addprefix $(KDIR26)/dvb/frontends/, $(inst_frontends)) \ - $(addprefix $(KDIR26)/dvb/dvb-core/, $(inst_dvb-core)) \ - $(addprefix $(KDIR26)/dvb/b2c2/, $(inst_b2c2)) \ - $(addprefix $(KDIR26)/dvb/cinergyT2/, $(inst_cinergyT2)) \ - $(addprefix $(KDIR26)/dvb/dvb-usb/, $(inst_dvb-usb)) \ - $(addprefix $(KDIR26)/dvb/pluto2/, $(inst_pluto2)) \ - $(addprefix $(KDIR26)/dvb/ttpci/, $(inst_ttpci)) \ - $(addprefix $(KDIR26)/dvb/ttusb-budget/, $(inst_ttusb-budget)) \ - $(addprefix $(KDIR26)/dvb/ttusb-dec/, $(inst_ttusb-dec)) \ - $(addprefix $(KDIR26)/dvb/firesat/, $(inst_firesat)) \ - $(addprefix $(KDIR26)/dvb/bt8xx/, $(addsuffix .gz,$(inst_bt8xx))) \ - $(addprefix $(KDIR26)/dvb/frontends/, $(addsuffix .gz,$(inst_frontends))) \ - $(addprefix $(KDIR26)/dvb/dvb-core/, $(addsuffix .gz,$(inst_dvb-core))) \ - $(addprefix $(KDIR26)/dvb/b2c2/, $(addsuffix .gz,$(inst_b2c2))) \ - $(addprefix $(KDIR26)/dvb/cinergyT2/, $(addsuffix .gz,$(inst_cinergyT2))) \ - $(addprefix $(KDIR26)/dvb/dvb-usb/, $(addsuffix .gz,$(inst_dvb-usb))) \ - $(addprefix $(KDIR26)/dvb/pluto2/, $(addsuffix .gz,$(inst_pluto2))) \ - $(addprefix $(KDIR26)/dvb/ttpci/, $(addsuffix .gz,$(inst_ttpci))) \ - $(addprefix $(KDIR26)/dvb/ttusb-budget/, $(addsuffix .gz,$(inst_ttusb-budget))) \ - $(addprefix $(KDIR26)/dvb/ttusb-dec/, $(addsuffix .gz,$(inst_ttusb-dec))) \ - $(addprefix $(KDIR26)/dvb/firesat/, $(addsuffix .gz,$(inst_firesat))) 2>/dev/null - @echo - -rmmodules:: - rmmod -w $(shell echo "$(v4l_modules)"|sed s,' ','\n',g|sed s,'-','_',g|sort|uniq -d) - -clean:: - @find . -name '*.c' -type l -exec rm '{}' \; - @find . -name '*.h' -type l -exec rm '{}' \; - -rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \ - ivtv-svnversion.h \ - Kconfig Kconfig.kern .config .config.cmd - -distclean:: clean - -rm -f .version .*.o.flags .*.o.d Makefile.media - -rm -rf .tmp_versions - @find .. -name '*.orig' -exec rm '{}' \; - @find .. -name '*.rej' -exec rm '{}' \; +################################################# +# Tree management rules change changes changelog:: make -C .. changelog @@ -362,26 +263,8 @@ commit cvscommit hgcommit:: push:: make -C .. push -insmod load:: - scripts/insmod.sh load - -rmmod unload:: - scripts/insmod.sh unload - -reload:: - scripts/insmod.sh reload - -.version: -ifneq ($(KERNELRELEASE),) - echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version -else - echo "No version yet." - uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version - -endif - ################################################# -# build tarballs +# build tarballs rules RPWD := $(shell cd .. && pwd) thisdir := $(notdir $(RPWD)) @@ -399,14 +282,3 @@ snapshot snap tarball: update distclean (cd ..; tar czf $(snapdir)/$(snap)-$(date).tar.gz .) cp ChangeLog /$(snapdir)/$(snap)-ChangeLog-$(date) $(MAKE) -C $(snapdir) - - -################################################# -# other stuff - -%.asm: %.o - objdump -S $< > $@ - -card cardlist cardlists: - scripts/cardlist - diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 135b8bdb1..48552c425 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use FileHandle; +my $instdir = (); + sub check_line($$$) { my $dir=shift; @@ -8,6 +10,10 @@ sub check_line($$$) my $arg=shift; my $arg2=""; + my $idir = $dir; + + $idir =~ s|^../linux/drivers/media/||; + $arg=$arg." "; while ($arg ne "") { @@ -18,7 +24,15 @@ sub check_line($$$) $arg =~ s/^[^ ]+ //; } else { $arg =~ s/^([^ ]+ )//; - $arg2 = $arg2.$1; + my $cur=$1; + $arg2 = $arg2.$cur; + $cur =~ s/\s+$//; + $cur =~ s/\\$//; + $cur =~ s/\s+$//; + $cur =~ s/\.o$/.ko/; + if ( ($cur ne "") && (! ($instdir { $idir } =~ m/($cur) /))) { + $instdir { $idir } = $instdir { $idir }.$cur." "; + } } } $arg2 =~ s/\s+$//; @@ -95,10 +109,32 @@ sub open_makefile($) { open OUT,">Makefile.media"; open_makefile ("../linux/drivers/media/Makefile"); + +# Creating Install rule +printf OUT "install::\n"; +printf OUT "\t@strip --strip-debug \$(inst-m)\n\n"; + +while ( my ($key, $value) = each(%instdir) ) { + printf OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$key files\\n\"\n"; + printf OUT "\t-install -d \$(KDIR26)/$key\n"; + printf OUT "\t-install -m 644 -c $value \$(KDIR26)/$key\n\n"; +} + +# Creating Remove rule +printf OUT "remove::\n"; +printf OUT "\t\@echo -e \"\\nRemoving old \$(DEST) files\\n\"\n"; +printf OUT "\t-rm -r \$(DEST)\n\n"; + +while ( my ($key, $value) = each(%instdir) ) { + printf OUT "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$key files\\n\"\n"; + printf OUT "\tcd \$(KDIR26)/$key\n"; + printf OUT "\t-rm $value\n\n"; +} + close OUT; while ( my ($key, $value) = each(%config) ) { - delete $depend{$key}; + delete $depend{$key}; } open OUT,">Kconfig.kern"; @@ -106,4 +142,3 @@ while ( my ($key, $value) = each(%depend) ) { print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault m\n\n"; } close OUT; - |