blob: 130758f27298f144871ed8120ec7e51c1682a01b [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
Viresh Kumar98abb412015-01-21 16:10:41 +053031gb-es1-y := es1.o
32gb-es2-y := es2.o
33
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080034obj-m += greybus.o
Greg Kroah-Hartman71479f62015-01-14 17:07:59 -080035obj-m += gb-phy.o
Greg Kroah-Hartman419a8cf2015-01-14 17:08:00 -080036obj-m += gb-vibrator.o
Greg Kroah-Hartman347fedb2015-01-14 17:08:01 -080037obj-m += gb-battery.o
Alexandre Bailon355a7052015-03-31 09:51:59 +020038obj-m += gb-loopback.o
Greg Kroah-Hartman60a7ad72015-01-14 17:08:02 -080039obj-m += gb-es1.o
Greg Kroah-Hartmanf5870272015-01-21 10:24:15 +080040obj-m += gb-es2.o
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080041
42KERNELVER ?= $(shell uname -r)
43KERNELDIR ?= /lib/modules/$(KERNELVER)/build
Bryan O'Donoghue68fff962015-05-07 17:00:50 -070044INSTALL_MOD_PATH ?= /..
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080045PWD := $(shell pwd)
46
Rui Miguel Silva65cac602015-05-13 18:59:00 +010047# kernel config option that shall be enable
48CONFIG_OPTIONS_ENABLE := SYSFS SPI USB SND_SOC
49
50# kernel config option that shall be disable
51CONFIG_OPTIONS_DISABLE :=
52
53# this only run in kbuild part of the makefile
54ifneq ($(KERNELRELEASE),)
55$(foreach opt,$(CONFIG_OPTIONS_ENABLE),$(if $(CONFIG_$(opt)),, \
56 $(error CONFIG_$(opt) is disabled in the kernel configuration and must be enable \
57 to continue compilation)))
58$(foreach opt,$(CONFIG_OPTIONS_DISABLE),$(if $(filter m y, $(CONFIG_$(opt))), \
59 $(error CONFIG_$(opt) is enabled in the kernel configuration and must be disable \
60 to continue compilation),))
61endif
62
Greg Kroah-Hartman7486dfd2014-11-19 19:09:53 -080063# add -Wall to try to catch everything we can.
64ccFlags-y := -Wall
65
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080066all: module
67
68module:
69 $(MAKE) -C $(KERNELDIR) M=$(PWD)
70
Greg Kroah-Hartmanac7171e2014-09-13 12:39:23 -070071check:
72 $(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__"
73
Greg Kroah-Hartmanc8a797a2014-08-11 15:30:45 +080074clean:
75 rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
76 rm -f Module.markers Module.symvers modules.order
77 rm -rf .tmp_versions Modules.symvers
78
79coccicheck:
80 $(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
81
Greg Kroah-Hartman025677d2015-01-14 14:55:24 -080082install: module
Bryan O'Donoghue68fff962015-05-07 17:00:50 -070083 mkdir -p $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
84 cp -f *.ko $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
85 depmod -b $(INSTALL_MOD_PATH) -a $(KERNELVER)