2 # Makefile for the Linux WWAN device drivers. 
   4 # NOTE: This make file can serve as both an external Makefile (launched 
   5 #       directly by the user), or as the sub-dir Makefile used by the kernel 
   8 # If CONFIG_SPI_PARPORT isn't set, we'll assume the user has never configured 
   9 # their kernel to include this module and set up some defaults. 
  11 ifndef CONFIG_GPIO_PARPORT
 
  14 # CONFIG_GPIO_PARPORT_MUTEX is not set 
  15 # CONFIG_GPIO_PARPORT_EXCLUSIVE is not set 
  16 CONFIG_GPIO_PARPORT_NOCLAIME
=y
 
  19 ifndef CONFIG_SPI_PARPORT
 
  22 # CONFIG_SPI_PARPORT_EXCLUSIVE is not set 
  26 ifeq ($(CONFIG_SPI_HSO_DEBUG
),y
) 
  27         EXTRA_CFLAGS 
+= -g 
-Wa
,-adhlms
=$@.lst
 
  31         EXTRA_CFLAGS 
+= -I
$(KBUILD_EXTMOD
) 
  36 list-
$(CONFIG_GPIO_PARPORT
) += gpio_parport gpio_test
 
  37 list-
$(CONFIG_SPI_PARPORT
) += spi_parport
 
  38 obj-
$(CONFIG_GPIO_PARPORT
) += gpio_parport.o gpio_test.o
 
  39 obj-
$(CONFIG_SPI_PARPORT
) += spi_parport.o
 
  42 # Begin dual Makefile mode here.  First we provide support for when we 
  43 # are being invoked by the kernel build system 
  45 ifneq ($(KERNELRELEASE
),) 
  47 EXTRA_CFLAGS 
+= -DCONFIG_PM
 
  49 ifeq ($(EXTERNAL_BUILD
),y
) 
  50 ifeq ($(CONFIG_GPIO_PARPORT_MUTEX
),y
) 
  51         EXTRA_CFLAGS 
+= -DCONFIG_GPIO_PARPORT_MUTEX
 
  53 ifeq ($(CONFIG_GPIO_PARPORT_EXCLUSIVE
),y
) 
  54         EXTRA_CFLAGS 
+= -DCONFIG_GPIO_PARPORT_EXCLUSIVE
 
  56 ifeq ($(CONFIG_GPIO_PARPORT_NOCLAIME
),y
) 
  57         EXTRA_CFLAGS 
+= -DCONFIG_GPIO_PARPORT_NOCLAIME
 
  60 ifeq ($(CONFIG_SPI_PARPORT_EXCLUSIVE
),y
) 
  61         EXTRA_CFLAGS 
+= -DCONFIG_SPI_PARPORT_EXCLUSIVE
 
  64 ifeq ($(CONFIG_SPI_HSO_DEBUG
),y
) 
  65         EXTRA_CFLAGS 
+= -DCONFIG_SPI_HSO_DEBUG
 
  70 # Here we begin the portion that is executed if the user invoked this Makefile 
  73 # KSRC should be set to the path to your sources 
  74 KVER 
:= $(shell uname 
-r
) 
  75 KSRC 
:= /lib
/modules
/$(KVER
)/build
 
  76 INSTALLDIR
:=/lib
/modules
/$(KVER
)/kernel
/drivers
/net
/wwan
/ 
  78 # KSRC_OUTPUT should be overridden if you are using a 2.6 kernel that 
  79 # has it's output sent elsewhere via KBUILD_OUTPUT= or O= 
  80 KSRC_OUTPUT 
:= $(KSRC
) 
  84 VERFILE 
:= $(KSRC_OUTPUT
)/include/linux
/version.h
 
  85 KERNELRELEASE 
:= $(shell \
 
  86         if 
[ -r 
$(VERFILE
) ]; then \
 
  87                 (cat 
$(VERFILE
); echo UTS_RELEASE
) | \
 
  88                 $(CC
) -I
$(KSRC_OUTPUT
) $(CFLAGS
) -E 
- | \
 
  95 MODPATH 
:= $(DESTDIR
)/lib
/modules
/$(KERNELRELEASE
) 
 100         $(RM
) -f 
*.mod.
* *.mod 
*.o 
*.ko .
*.o.cmd .
*.ko.cmd 
*.flags .lst 
*.lst Module
*.symvers
 
 102         $(RM
) -rf .tmp_versions
 
 103         $(RM
) -f modules.order
 
 104         $(RM
) -f Module.markers
 
 110 MODVERDIR
=$(TMP
)/.tmp_versions
 
 113         mkdir 
-p 
$(MODVERDIR
) 
 114 ifdef ($(KSRC_OUTPUT
)/.tmp_versions
) 
 115         -cp 
$(KSRC_OUTPUT
)/.tmp_versions
/*.mod 
$(MODVERDIR
) 
 117 ifeq ($(KSRC
),$(KSRC_OUTPUT
)) # We're not outputting elsewhere 
 118 ifdef ($(KSRC
)/.tmp_versions
) 
 119         -cp 
$(KSRC
)/.tmp_versions
/*.mod 
$(MODVERDIR
) 
 121         $(MAKE
) -C 
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
) modules
 
 122 else # We've got a kernel with seperate output, copy the config, and use O= 
 124         cp 
$(KSRC_OUTPUT
)/.config 
$(TMP
) 
 125         $(MAKE
) -C 
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
)) O
=$(PWD
)/tmp modules
 
 129         for mod
; $(list-m
); do modprobe 
-r 
$mod || true
; done
 
 130         install -d 
$(INSTALLDIR
) 
 131         install -m 
644 -c 
$(addsuffix .ko
,$(list-m
)) $(INSTALLDIR
) 
 132         /sbin
/depmod 
-a 
${KVER} 
 135         rm -rf 
$(addprefix $(INSTALLDIR
),$(addsuffix .ko
,$(list-m
))) 
 136         /sbin
/depmod 
-a 
${KVER} 
 138 endif # End of internal build 
 142 RCS_FIND_IGNORE 
:= \
( -name SCCS 
-o 
-name BitKeeper 
-o 
-name .svn 
-o 
-name CVS \
) -prune 
-o
 
 144         ( find . 
$(RCS_FIND_IGNORE
) -name 
'*.[chS]' -print ) 
 148         $(all-sources
) | etags 
- 
 151         CTAGSF
=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
 
 152         $(all-sources
) | xargs ctags 
$$CTAGSF -a