spi_parport with proper irq support
[pub/spi-gpio-pp.git] / Makefile
index f490819..b5ab670 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,17 +8,22 @@
 # If CONFIG_SPI_PARPORT isn't set, we'll assume the user has never configured
 # their kernel to include this module and set up some defaults.
 #
-# NOTE: If you have previously added the SPI_TTY project to your kernel 
-#      and configured it for inclusion, these settings will be 
-#      overridden by your kernel configuration.
+ifndef CONFIG_GPIO_PARPORT
+EXTERNAL_BUILD=y
+CONFIG_GPIO_PARPORT=m
+# CONFIG_GPIO_PARPORT_MUTEX is not set
+# CONFIG_GPIO_PARPORT_EXCLUSIVE is not set
+CONFIG_GPIO_PARPORT_NOCLAIME=y
+endif
+
 ifndef CONFIG_SPI_PARPORT
 EXTERNAL_BUILD=y
 CONFIG_SPI_PARPORT=m
-CONFIG_SPI_PARPORT_DEBUG=n
+# CONFIG_SPI_PARPORT_EXCLUSIVE is not set
 endif
 
 
-ifeq ($(CONFIG_SPI_PARPORT_DEBUG),y)
+ifeq ($(CONFIG_SPI_HSO_DEBUG),y)
        EXTRA_CFLAGS += -g -Wa,-adhlms=$@.lst
 endif
 
@@ -28,7 +33,9 @@ endif
 
 
 list-m :=
+list-$(CONFIG_GPIO_PARPORT) += gpio_parport gpio_test
 list-$(CONFIG_SPI_PARPORT) += spi_parport
+obj-$(CONFIG_GPIO_PARPORT) += gpio_parport.o gpio_test.o
 obj-$(CONFIG_SPI_PARPORT) += spi_parport.o
 
 #
@@ -40,8 +47,22 @@ ifneq ($(KERNELRELEASE),)
 EXTRA_CFLAGS += -DCONFIG_PM
 
 ifeq ($(EXTERNAL_BUILD),y)
-ifeq ($(CONFIG_SPI_PARPORT_DEBUG),y)
-EXTRA_CFLAGS += -DCONFIG_SPI_PARPORT_DEBUG
+ifeq ($(CONFIG_GPIO_PARPORT_MUTEX),y)
+       EXTRA_CFLAGS += -DCONFIG_GPIO_PARPORT_MUTEX
+endif
+ifeq ($(CONFIG_GPIO_PARPORT_EXCLUSIVE),y)
+       EXTRA_CFLAGS += -DCONFIG_GPIO_PARPORT_EXCLUSIVE
+endif
+ifeq ($(CONFIG_GPIO_PARPORT_NOCLAIME),y)
+       EXTRA_CFLAGS += -DCONFIG_GPIO_PARPORT_NOCLAIME
+endif
+
+ifeq ($(CONFIG_SPI_PARPORT_EXCLUSIVE),y)
+       EXTRA_CFLAGS += -DCONFIG_SPI_PARPORT_EXCLUSIVE
+endif
+
+ifeq ($(CONFIG_SPI_HSO_DEBUG),y)
+       EXTRA_CFLAGS += -DCONFIG_SPI_HSO_DEBUG
 endif
 endif
 
@@ -104,8 +125,16 @@ else # We've got a kernel with seperate output, copy the config, and use O=
        $(MAKE) -C $(KSRC) M=$(PWD) MODVERDIR=$(MODVERDIR)) O=$(PWD)/tmp modules
 endif
 
+test-gpio: modules
+       rmmod lp || true
+       rmmod ppdev || true
+       rmmod gpio_test || true
+       rmmod gpio_parport || true
+       insmod gpio_parport.ko
+       insmod gpio_test.ko gpi=254 irq=7
+
 install: modules
-       modprobe -r spi_parport || true
+       for mod; $(list-m); do modprobe -r $mod || true; done
        install -d $(INSTALLDIR)
        install -m 644 -c $(addsuffix .ko,$(list-m)) $(INSTALLDIR)
        /sbin/depmod -a ${KVER}