MALI: utgard: upgrade DDK to r6p1-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / mali400 / umplock / Makefile
1 #
2 # Copyright (C) 2012, 2016 ARM Limited. All rights reserved.
3
4 # This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 # as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6
7 # A copy of the licence is included with the program, and can also be obtained from Free Software
8 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9 #
10
11 # default to building for the host
12 ARCH ?= $(shell uname -m)
13
14 # linux build system integration
15
16 ifneq ($(KERNELRELEASE),)
17 # Inside the kernel build system
18
19 EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)
20
21 SRC =   umplock_driver.c
22
23 MODULE:=umplock.ko
24
25 obj-m := $(MODULE:.ko=.o)
26 $(MODULE:.ko=-y) := $(SRC:.c=.o)
27
28 $(MODULE:.ko=-objs) := $(SRC:.c=.o) 
29
30 else
31 # Outside the kernel build system
32 #
33 #
34
35 # Get any user defined KDIR-<names> or maybe even a hardcoded KDIR
36 -include KDIR_CONFIGURATION
37
38 # Define host system directory
39 KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build
40
41 ifeq ($(ARCH), arm)
42         # when compiling for ARM we're cross compiling
43         export CROSS_COMPILE ?= arm-none-linux-gnueabi-
44         CONFIG ?= arm
45 else
46         # Compiling for the host
47         CONFIG ?= $(shell uname -m)
48 endif
49
50 # default cpu to select
51 CPU ?= $(shell uname -m)
52
53 # look up KDIR based om CPU selection
54 KDIR ?= $(KDIR-$(CPU))
55
56 ifeq ($(KDIR),)
57 $(error No KDIR found for platform $(CPU))
58 endif
59
60 all:
61         $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR)
62
63 kernelrelease:
64         $(MAKE) -C $(KDIR) kernelrelease
65
66 clean:
67         $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean
68
69 endif