9f13a83c4b256a4ae0d75ed1ec543830fdf00ba9
   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_TTY isn't set, we'll assume the user has never configured 
   9 # their kernel to include this module and set up some defaults. 
  11 # NOTE: If you have previously added the SPI_TTY project to your kernel  
  12 #       and configured it for inclusion, these settings will be  
  13 #       overridden by your kernel configuration. 
  17 CONFIG_SPI_TTY_DEBUG
=n
 
  21 ifeq ($(CONFIG_SPI_TTY_DEBUG
),y
) 
  22         EXTRA_CFLAGS 
+= -g 
-Wa
,-adhlms
=$@.lst
 
  26         EXTRA_CFLAGS 
+= -I
$(KBUILD_EXTMOD
) 
  31 list-
$(CONFIG_SPI_TTY
) += spi_tty
 
  32 obj-
$(CONFIG_SPI_TTY
) += spi_tty.o
 
  35 # Begin dual Makefile mode here.  First we provide support for when we 
  36 # are being invoked by the kernel build system 
  38 ifneq ($(KERNELRELEASE
),) 
  40 EXTRA_CFLAGS 
+= -DCONFIG_PM
 
  42 ifeq ($(EXTERNAL_BUILD
),y
) 
  43 ifeq ($(CONFIG_SPI_TTY_DEBUG
),y
) 
  44 EXTRA_CFLAGS 
+= -DCONFIG_SPI_TTY_DEBUG
 
  49 # Here we begin the portion that is executed if the user invoked this Makefile 
  52 # KSRC should be set to the path to your sources 
  53 KVER 
:= $(shell uname 
-r
) 
  54 KSRC 
:= /lib
/modules
/$(KVER
)/build
 
  55 INSTALLDIR
:=/lib
/modules
/$(KVER
)/kernel
/drivers
/net
/wwan
/ 
  57 # KSRC_OUTPUT should be overridden if you are using a 2.6 kernel that 
  58 # has it's output sent elsewhere via KBUILD_OUTPUT= or O= 
  59 KSRC_OUTPUT 
:= $(KSRC
) 
  63 VERFILE 
:= $(KSRC_OUTPUT
)/include/linux
/version.h
 
  64 KERNELRELEASE 
:= $(shell \
 
  65         if 
[ -r 
$(VERFILE
) ]; then \
 
  66                 (cat 
$(VERFILE
); echo UTS_RELEASE
) | \
 
  67                 $(CC
) -I
$(KSRC_OUTPUT
) $(CFLAGS
) -E 
- | \
 
  74 MODPATH 
:= $(DESTDIR
)/lib
/modules
/$(KERNELRELEASE
) 
  79         $(RM
) -f 
*.mod.
* *.mod 
*.o 
*.ko .
*.o.cmd .
*.ko.cmd 
*.flags .lst 
*.lst Module
*.symvers
 
  81         $(RM
) -rf .tmp_versions
 
  87 MODVERDIR
=$(TMP
)/.tmp_versions
 
  91 ifdef ($(KSRC_OUTPUT
)/.tmp_versions
) 
  92         -cp 
$(KSRC_OUTPUT
)/.tmp_versions
/*.mod 
$(MODVERDIR
) 
  94 ifeq ($(KSRC
),$(KSRC_OUTPUT
)) # We're not outputting elsewhere 
  95 ifdef ($(KSRC
)/.tmp_versions
) 
  96         -cp 
$(KSRC
)/.tmp_versions
/*.mod 
$(MODVERDIR
) 
  98         $(MAKE
) -C 
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
) modules
 
  99 else # We've got a kernel with seperate output, copy the config, and use O= 
 101         cp 
$(KSRC_OUTPUT
)/.config 
$(TMP
) 
 102         $(MAKE
) -C 
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
)) O
=$(PWD
)/tmp modules
 
 106         modprobe 
-r spi_tty || true
 
 107         install -d 
$(INSTALLDIR
) 
 108         install -m 
644 -c 
$(addsuffix .ko
,$(list-m
)) $(INSTALLDIR
) 
 109         /sbin
/depmod 
-a 
${KVER} 
 112         rm -rf 
$(addprefix $(INSTALLDIR
),$(addsuffix .ko
,$(list-m
))) 
 113         /sbin
/depmod 
-a 
${KVER} 
 115 endif # End of internal build 
 119 RCS_FIND_IGNORE 
:= \
( -name SCCS 
-o 
-name BitKeeper 
-o 
-name .svn 
-o 
-name CVS \
) -prune 
-o
 
 121         ( find . 
$(RCS_FIND_IGNORE
) -name 
'*.[chS]' -print ) 
 125         $(all-sources
) | etags 
- 
 128         CTAGSF
=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
 
 129         $(all-sources
) | xargs ctags 
$$CTAGSF -a