Andrew Walbran | 13c3a0b | 2018-11-30 11:51:53 +0000 | [diff] [blame] | 1 | # 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 Scull | 5570423 | 2018-08-10 17:19:54 +0100 | [diff] [blame] | 16 | # 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. |
| 19 | HAFNIUM_PATH ?= $(PWD)/../.. |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 20 | |
| 21 | ifneq ($(KERNELRELEASE),) |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 22 | |
| 23 | obj-m += hafnium.o |
| 24 | |
| 25 | hafnium-y += main.o |
Andrew Scull | 5570423 | 2018-08-10 17:19:54 +0100 | [diff] [blame] | 26 | hafnium-y += hf_call.o |
| 27 | |
| 28 | ccflags-y = -I$(HAFNIUM_PATH)/inc/vmapi |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 29 | |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 30 | else |
| 31 | |
Andrew Scull | ce08e9e | 2019-01-03 10:10:33 +0000 | [diff] [blame] | 32 | KERNEL_PATH ?= $(HAFNIUM_PATH)/third_party/linux |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 33 | ARCH ?= arm64 |
| 34 | CROSS_COMPILE ?= aarch64-linux-gnu- |
| 35 | |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 36 | all: |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 37 | make -C $(KERNEL_PATH) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 38 | |
| 39 | clean: |
| 40 | make -C $(KERNEL_PATH) M=$(PWD) clean |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 41 | |
| 42 | endif |