Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | # |
2 | # This confidential and proprietary software may be used only as | |
3 | # authorised by a licensing agreement from ARM Limited | |
4 | # (C) COPYRIGHT 2008-2012 ARM Limited | |
5 | # ALL RIGHTS RESERVED | |
6 | # The entire notice above must be reproduced on all authorised | |
7 | # copies and copies may only be made to the extent permitted | |
8 | # by a licensing agreement from ARM Limited. | |
9 | # | |
10 | ||
11 | # For each arch check: CROSS_COMPILE , KDIR , CFLAGS += -DARCH | |
12 | ||
13 | export ARCH ?= arm | |
14 | BUILD ?= debug | |
15 | ||
16 | check_cc2 = \ | |
17 | $(shell if $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ | |
18 | then \ | |
19 | echo "$(2)"; \ | |
20 | else \ | |
21 | echo "$(3)"; \ | |
22 | fi ;) | |
23 | ||
24 | # Check that required parameters are supplied. | |
25 | ifeq ($(CONFIG),) | |
26 | $(error "CONFIG must be specified.") | |
27 | endif | |
28 | ifeq ($(CPU)$(KDIR),) | |
29 | $(error "KDIR or CPU must be specified.") | |
30 | endif | |
31 | ||
32 | # Get any user defined KDIR-<names> or maybe even a hardcoded KDIR | |
33 | -include KDIR_CONFIGURATION | |
34 | ||
35 | # Define host system directory | |
36 | KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build | |
37 | ||
38 | ifeq ($(ARCH), arm) | |
39 | # when compiling for ARM we're cross compiling | |
40 | export CROSS_COMPILE ?= $(call check_cc2, arm-linux-gnueabi-gcc, arm-linux-gnueabi-, arm-none-linux-gnueabi-) | |
41 | endif | |
42 | ||
43 | # look up KDIR based om CPU selection | |
44 | KDIR ?= $(KDIR-$(CPU)) | |
45 | ||
46 | export CONFIG | |
47 | ||
48 | export CONFIG_UMP := m | |
49 | ifeq ($(BUILD),debug) | |
50 | export CONFIG_UMP_DEBUG := y | |
51 | else | |
52 | export CONFIG_UMP_DEBUG := n | |
53 | endif | |
54 | ||
55 | ifeq ($(KDIR),) | |
56 | $(error No KDIR found for platform $(CPU)) | |
57 | endif | |
58 | ||
59 | all: | |
60 | $(MAKE) -C $(KDIR) M=$(CURDIR) modules | |
61 | ||
62 | kernelrelease: | |
63 | $(MAKE) -C $(KDIR) kernelrelease | |
64 | ||
65 | clean: | |
66 | $(MAKE) -C $(KDIR) M=$(CURDIR) clean | |
67 | $(MAKE) -C $(KDIR) M=$(CURDIR)/../mali clean |