blob: e636fe01f0330b66e29f078e8590727afa0a77df [file] [log] [blame]
Greg Kroah-Hartmande536e32014-08-31 16:17:04 -07001greybus-y := core.o \
Greg Kroah-Hartmande536e32014-08-31 16:17:04 -07002 debugfs.o \
3 ap.o \
Alex Elderb09c94a2014-10-01 21:54:16 -05004 manifest.o \
Greg Kroah-Hartman0f035ac2015-04-07 20:26:53 +02005 endo.o \
Greg Kroah-Hartmandf671552014-12-21 14:10:26 -08006 module.o \
Greg Kroah-Hartmana93938a2014-12-19 14:56:30 -08007 interface.o \
Greg Kroah-Hartman3bdec692014-12-12 17:10:16 -05008 bundle.o \
Alex Elderc68adb22014-10-01 21:54:14 -05009 connection.o \
Alex Elder4ccb6b72014-10-28 19:36:00 -050010 protocol.o \
Greg Kroah-Hartmane1308c12014-12-24 13:01:43 -080011 operation.o
12
John Stultza4749bb2015-05-08 12:57:36 -070013gb-phy-y := gpb.o \
Viresh Kumar5357cf32015-01-21 16:10:40 +053014 sdio.o \
15 uart.o \
16 pwm.o \
17 gpio.o \
Viresh Kumar96eab772015-03-16 16:49:37 +053018 hid.o \
Viresh Kumar5357cf32015-01-21 16:10:40 +053019 i2c.o \
Viresh Kumar15d651b2015-01-23 13:07:45 +053020 spi.o \
John Stultza4749bb2015-05-08 12:57:36 -070021 usb.o \
22 audio.o \
23 audio-pcm.o \
24 audio-dai.o \
25 audio-gb-cmds.o
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080026
Viresh Kumar98abb412015-01-21 16:10:41 +053027# Prefix all modules with gb-
28gb-vibrator-y := vibrator.o
29gb-battery-y := battery.o
Alexandre Bailon355a7052015-03-31 09:51:59 +020030gb-loopback-y := loopback.o
Greg Kroah-Hartmane806c7f2015-05-08 15:50:17 +020031gb-raw-y := raw.o
Viresh Kumar98abb412015-01-21 16:10:41 +053032gb-es1-y := es1.o
33gb-es2-y := es2.o
34
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080035obj-m += greybus.o
Greg Kroah-Hartman71479f62015-01-14 17:07:59 -080036obj-m += gb-phy.o
Greg Kroah-Hartman419a8cf2015-01-14 17:08:00 -080037obj-m += gb-vibrator.o
Greg Kroah-Hartman347fedb2015-01-14 17:08:01 -080038obj-m += gb-battery.o
Alexandre Bailon355a7052015-03-31 09:51:59 +020039obj-m += gb-loopback.o
Greg Kroah-Hartmane806c7f2015-05-08 15:50:17 +020040obj-m += gb-raw.o
Greg Kroah-Hartman60a7ad72015-01-14 17:08:02 -080041obj-m += gb-es1.o
Greg Kroah-Hartmanf5870272015-01-21 10:24:15 +080042obj-m += gb-es2.o
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080043
44KERNELVER ?= $(shell uname -r)
45KERNELDIR ?= /lib/modules/$(KERNELVER)/build
Bryan O'Donoghue68fff962015-05-07 17:00:50 -070046INSTALL_MOD_PATH ?= /..
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080047PWD := $(shell pwd)
48
Rui Miguel Silva65cac602015-05-13 18:59:00 +010049# kernel config option that shall be enable
50CONFIG_OPTIONS_ENABLE := SYSFS SPI USB SND_SOC
51
52# kernel config option that shall be disable
53CONFIG_OPTIONS_DISABLE :=
54
55# this only run in kbuild part of the makefile
56ifneq ($(KERNELRELEASE),)
57$(foreach opt,$(CONFIG_OPTIONS_ENABLE),$(if $(CONFIG_$(opt)),, \
58 $(error CONFIG_$(opt) is disabled in the kernel configuration and must be enable \
59 to continue compilation)))
60$(foreach opt,$(CONFIG_OPTIONS_DISABLE),$(if $(filter m y, $(CONFIG_$(opt))), \
61 $(error CONFIG_$(opt) is enabled in the kernel configuration and must be disable \
62 to continue compilation),))
63endif
64
Greg Kroah-Hartman7486dfd2014-11-19 19:09:53 -080065# add -Wall to try to catch everything we can.
66ccFlags-y := -Wall
67
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080068all: module
69
70module:
71 $(MAKE) -C $(KERNELDIR) M=$(PWD)
72
Greg Kroah-Hartmanac7171e2014-09-13 12:39:23 -070073check:
74 $(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__"
75
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080076clean:
77 rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
78 rm -f Module.markers Module.symvers modules.order
79 rm -rf .tmp_versions Modules.symvers
80
81coccicheck:
82 $(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
83
Greg Kroah-Hartman025677d2015-01-14 14:55:24 -080084install: module
Bryan O'Donoghue68fff962015-05-07 17:00:50 -070085 mkdir -p $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
86 cp -f *.ko $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
87 depmod -b $(INSTALL_MOD_PATH) -a $(KERNELVER)