
# To build modules outside of the kernel tree, we run "make"
# in the kernel source tree; the Makefile these then includes this
# Makefile once again.
# This conditional selects whether we are being included from the
# kernel Makefile or not.
ifeq ($(KERNELRELEASE),)

    # Assume the source tree is where the running kernel was built
    # You should set KERNELDIR in the environment if it's elsewhere
    KERNELVER ?= 2.6.27.7
    #KERNELVER ?= 2.6.24-smp
    KERNELDIR ?= /lib/modules/$(KERNELVER)/build
    # The current directory is passed to sub-makes as argument
    PWD := $(shell pwd)

modules:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order

.PHONY: modules modules_install clean

else
    obj-m := dvbstub1.o dvbstub1_baudc_test.o

    EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -Idrivers/media/dvb/frontends
	
    CFLAGS_dvbstub1_baudc_test.o += -DBAUDCALC_TEST

	dvbstub1-objs := dvbstub1_dvb.o dvbstub1_input.o dvbstub1_frontend.o dvbstub1_baudc.o

endif

