Greg Kroah-Hartman | de536e3 | 2014-08-31 16:17:04 -0700 | [diff] [blame] | 1 | greybus-y := core.o \ |
Greg Kroah-Hartman | de536e3 | 2014-08-31 16:17:04 -0700 | [diff] [blame] | 2 | debugfs.o \ |
| 3 | ap.o \ |
Alex Elder | b09c94a | 2014-10-01 21:54:16 -0500 | [diff] [blame] | 4 | manifest.o \ |
Greg Kroah-Hartman | 0f035ac | 2015-04-07 20:26:53 +0200 | [diff] [blame] | 5 | endo.o \ |
Greg Kroah-Hartman | df67155 | 2014-12-21 14:10:26 -0800 | [diff] [blame] | 6 | module.o \ |
Greg Kroah-Hartman | a93938a | 2014-12-19 14:56:30 -0800 | [diff] [blame] | 7 | interface.o \ |
Greg Kroah-Hartman | 3bdec69 | 2014-12-12 17:10:16 -0500 | [diff] [blame] | 8 | bundle.o \ |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 9 | connection.o \ |
Alex Elder | 4ccb6b7 | 2014-10-28 19:36:00 -0500 | [diff] [blame] | 10 | protocol.o \ |
Greg Kroah-Hartman | e1308c1 | 2014-12-24 13:01:43 -0800 | [diff] [blame] | 11 | operation.o |
| 12 | |
John Stultz | a4749bb | 2015-05-08 12:57:36 -0700 | [diff] [blame] | 13 | gb-phy-y := gpb.o \ |
Viresh Kumar | 5357cf3 | 2015-01-21 16:10:40 +0530 | [diff] [blame] | 14 | sdio.o \ |
| 15 | uart.o \ |
| 16 | pwm.o \ |
| 17 | gpio.o \ |
Viresh Kumar | 96eab77 | 2015-03-16 16:49:37 +0530 | [diff] [blame] | 18 | hid.o \ |
Viresh Kumar | 5357cf3 | 2015-01-21 16:10:40 +0530 | [diff] [blame] | 19 | i2c.o \ |
Viresh Kumar | 15d651b | 2015-01-23 13:07:45 +0530 | [diff] [blame] | 20 | spi.o \ |
John Stultz | a4749bb | 2015-05-08 12:57:36 -0700 | [diff] [blame] | 21 | usb.o \ |
| 22 | audio.o \ |
| 23 | audio-pcm.o \ |
| 24 | audio-dai.o \ |
| 25 | audio-gb-cmds.o |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 26 | |
Viresh Kumar | 98abb41 | 2015-01-21 16:10:41 +0530 | [diff] [blame] | 27 | # Prefix all modules with gb- |
| 28 | gb-vibrator-y := vibrator.o |
| 29 | gb-battery-y := battery.o |
Alexandre Bailon | 355a705 | 2015-03-31 09:51:59 +0200 | [diff] [blame] | 30 | gb-loopback-y := loopback.o |
Viresh Kumar | 98abb41 | 2015-01-21 16:10:41 +0530 | [diff] [blame] | 31 | gb-es1-y := es1.o |
| 32 | gb-es2-y := es2.o |
| 33 | |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 34 | obj-m += greybus.o |
Greg Kroah-Hartman | 71479f6 | 2015-01-14 17:07:59 -0800 | [diff] [blame] | 35 | obj-m += gb-phy.o |
Greg Kroah-Hartman | 419a8cf | 2015-01-14 17:08:00 -0800 | [diff] [blame] | 36 | obj-m += gb-vibrator.o |
Greg Kroah-Hartman | 347fedb | 2015-01-14 17:08:01 -0800 | [diff] [blame] | 37 | obj-m += gb-battery.o |
Alexandre Bailon | 355a705 | 2015-03-31 09:51:59 +0200 | [diff] [blame] | 38 | obj-m += gb-loopback.o |
Greg Kroah-Hartman | 60a7ad7 | 2015-01-14 17:08:02 -0800 | [diff] [blame] | 39 | obj-m += gb-es1.o |
Greg Kroah-Hartman | f587027 | 2015-01-21 10:24:15 +0800 | [diff] [blame] | 40 | obj-m += gb-es2.o |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 41 | |
| 42 | KERNELVER ?= $(shell uname -r) |
| 43 | KERNELDIR ?= /lib/modules/$(KERNELVER)/build |
Bryan O'Donoghue | 68fff96 | 2015-05-07 17:00:50 -0700 | [diff] [blame] | 44 | INSTALL_MOD_PATH ?= /.. |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 45 | PWD := $(shell pwd) |
| 46 | |
Rui Miguel Silva | 65cac60 | 2015-05-13 18:59:00 +0100 | [diff] [blame^] | 47 | # kernel config option that shall be enable |
| 48 | CONFIG_OPTIONS_ENABLE := SYSFS SPI USB SND_SOC |
| 49 | |
| 50 | # kernel config option that shall be disable |
| 51 | CONFIG_OPTIONS_DISABLE := |
| 52 | |
| 53 | # this only run in kbuild part of the makefile |
| 54 | ifneq ($(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),)) |
| 61 | endif |
| 62 | |
Greg Kroah-Hartman | 7486dfd | 2014-11-19 19:09:53 -0800 | [diff] [blame] | 63 | # add -Wall to try to catch everything we can. |
| 64 | ccFlags-y := -Wall |
| 65 | |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 66 | all: module |
| 67 | |
| 68 | module: |
| 69 | $(MAKE) -C $(KERNELDIR) M=$(PWD) |
| 70 | |
Greg Kroah-Hartman | ac7171e | 2014-09-13 12:39:23 -0700 | [diff] [blame] | 71 | check: |
| 72 | $(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__" |
| 73 | |
Greg Kroah-Hartman | c8a797a | 2014-08-11 15:30:45 +0800 | [diff] [blame] | 74 | clean: |
| 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 | |
| 79 | coccicheck: |
| 80 | $(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck |
| 81 | |
Greg Kroah-Hartman | 025677d | 2015-01-14 14:55:24 -0800 | [diff] [blame] | 82 | install: module |
Bryan O'Donoghue | 68fff96 | 2015-05-07 17:00:50 -0700 | [diff] [blame] | 83 | 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) |