blob: 18f01a6e996ede718d44043e52bbeeb42686ab83 [file] [log] [blame]
Andrew Walbran13c3a0b2018-11-30 11:51:53 +00001# Copyright 2018 Google LLC
2#
3# This program is free software; you can redistribute it and/or
4# modify it under the terms of the GNU General Public License
5# version 2 as published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program; if not, write to the Free Software
14# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
Andrew Scull55704232018-08-10 17:19:54 +010016# By default, assume this was checked out as a submodule of the Hafnium repo
17# and that Linux was checked out along side that checkout. These paths can be
18# overridden if that assumption is incorrect.
19HAFNIUM_PATH ?= $(PWD)/../..
Andrew Scull82257c42018-10-01 10:37:48 +010020
21ifneq ($(KERNELRELEASE),)
Wedson Almeida Filho2f62b422018-06-19 06:44:32 +010022
23obj-m += hafnium.o
24
25hafnium-y += main.o
Andrew Scull55704232018-08-10 17:19:54 +010026hafnium-y += hf_call.o
27
28ccflags-y = -I$(HAFNIUM_PATH)/inc/vmapi
Wedson Almeida Filho2f62b422018-06-19 06:44:32 +010029
Andrew Scull82257c42018-10-01 10:37:48 +010030else
31
Andrew Scullce08e9e2019-01-03 10:10:33 +000032KERNEL_PATH ?= $(HAFNIUM_PATH)/third_party/linux
Andrew Scull82257c42018-10-01 10:37:48 +010033ARCH ?= arm64
34CROSS_COMPILE ?= aarch64-linux-gnu-
35
Wedson Almeida Filho2f62b422018-06-19 06:44:32 +010036all:
Andrew Scull82257c42018-10-01 10:37:48 +010037 make -C $(KERNEL_PATH) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
Wedson Almeida Filho2f62b422018-06-19 06:44:32 +010038
39clean:
40 make -C $(KERNEL_PATH) M=$(PWD) clean
Andrew Scull82257c42018-10-01 10:37:48 +010041
42endif