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 # 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.
14 ifndef CONFIG_SPI_PARPORT
17 CONFIG_SPI_PARPORT_DEBUG
=n
21 ifeq ($(CONFIG_SPI_PARPORT_DEBUG
),y
)
22 EXTRA_CFLAGS
+= -g
-Wa
,-adhlms
=$@.lst
26 EXTRA_CFLAGS
+= -I
$(KBUILD_EXTMOD
)
31 list-
$(CONFIG_SPI_PARPORT
) += spi_parport
32 obj-
$(CONFIG_SPI_PARPORT
) += spi_parport.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_PARPORT_DEBUG
),y
)
44 EXTRA_CFLAGS
+= -DCONFIG_SPI_PARPORT_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
82 $(RM
) -f modules.order
83 $(RM
) -f Module.markers
89 MODVERDIR
=$(TMP
)/.tmp_versions
93 ifdef ($(KSRC_OUTPUT
)/.tmp_versions
)
94 -cp
$(KSRC_OUTPUT
)/.tmp_versions
/*.mod
$(MODVERDIR
)
96 ifeq ($(KSRC
),$(KSRC_OUTPUT
)) # We're not outputting elsewhere
97 ifdef ($(KSRC
)/.tmp_versions
)
98 -cp
$(KSRC
)/.tmp_versions
/*.mod
$(MODVERDIR
)
100 $(MAKE
) -C
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
) modules
101 else # We've got a kernel with seperate output, copy the config, and use O=
103 cp
$(KSRC_OUTPUT
)/.config
$(TMP
)
104 $(MAKE
) -C
$(KSRC
) M
=$(PWD
) MODVERDIR
=$(MODVERDIR
)) O
=$(PWD
)/tmp modules
108 modprobe
-r spi_parport || true
109 install -d
$(INSTALLDIR
)
110 install -m
644 -c
$(addsuffix .ko
,$(list-m
)) $(INSTALLDIR
)
111 /sbin
/depmod
-a
${KVER}
114 rm -rf
$(addprefix $(INSTALLDIR
),$(addsuffix .ko
,$(list-m
)))
115 /sbin
/depmod
-a
${KVER}
117 endif # End of internal build
121 RCS_FIND_IGNORE
:= \
( -name SCCS
-o
-name BitKeeper
-o
-name .svn
-o
-name CVS \
) -prune
-o
123 ( find .
$(RCS_FIND_IGNORE
) -name
'*.[chS]' -print )
127 $(all-sources
) | etags
-
130 CTAGSF
=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
131 $(all-sources
) | xargs ctags
$$CTAGSF -a