################################################# # config # where the kernel sources are located #KERNEL_LOCATION=/usr/src/kernel/2.2.6-ac1 #KERNEL_LOCATION=/usr/src/kernel/2.3.99-pre1 KERNEL_LOCATION=/usr/src/linux # currently running kernel #CURRENT=$(shell uname -r) CURRENT=$(shell grep "UTS_RELEASE" $(KERNEL_LOCATION)/include/linux/version.h | cut -d\" -f2) ################################################# # some magic for using linux kernel settings # when compiling module(s) M_OBJS = msp3400.o tea6300.o tea6420.o tda8425.o tda985x.o \ tda7432.o dpl3518.o tuner.o ir.o MX_OBJS = bttv.o here: DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules) @echo @echo '"make list" prints a list of supported cards' list: @echo "bttv.o" @grep "{ \"" bttv.c | perl -ne '/"([^"]+)"/;printf(" card=%d - %s\n",$$i++,$$1)' @echo @echo "tuner.o" @grep "{ \"" tuner.c | perl -ne '/"([^"]+)"/;printf(" type=%d - %s\n",$$i++,$$1)' install: su -c "cp -v $(M_OBJS) $(MX_OBJS) /lib/modules/$(CURRENT)/misc" clean: -rm -f $(M_OBJS) $(MX_OBJS) .*.o.flags *~ include $(KERNEL_LOCATION)/Rules.make