Andrew Walbran | 2bc0a32 | 2019-03-07 15:48:06 +0000 | [diff] [blame] | 1 | # Copyright 2018 The Hafnium Authors. |
Andrew Walbran | 13c3a0b | 2018-11-30 11:51:53 +0000 | [diff] [blame] | 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. |
Andrew Walbran | 13c3a0b | 2018-11-30 11:51:53 +0000 | [diff] [blame] | 11 | |
Andrew Scull | 5570423 | 2018-08-10 17:19:54 +0100 | [diff] [blame] | 12 | # By default, assume this was checked out as a submodule of the Hafnium repo |
| 13 | # and that Linux was checked out along side that checkout. These paths can be |
| 14 | # overridden if that assumption is incorrect. |
Andrew Walbran | 3b4db94 | 2019-10-17 19:14:17 +0100 | [diff] [blame] | 15 | HAFNIUM_PATH ?= $(CURDIR)/../.. |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 16 | |
| 17 | ifneq ($(KERNELRELEASE),) |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 18 | |
| 19 | obj-m += hafnium.o |
| 20 | |
| 21 | hafnium-y += main.o |
Raghu Krishnamurthy | ad9005b | 2021-10-13 13:09:57 -0700 | [diff] [blame] | 22 | hafnium-y += vmlib/aarch64/hvc_call.o |
Andrew Walbran | 196ed0e | 2020-04-30 11:32:29 +0100 | [diff] [blame] | 23 | hafnium-y += vmlib/ffa.o |
Andrew Scull | 5570423 | 2018-08-10 17:19:54 +0100 | [diff] [blame] | 24 | |
Andrew Walbran | 3b4db94 | 2019-10-17 19:14:17 +0100 | [diff] [blame] | 25 | ccflags-y = -I$(HAFNIUM_PATH)/inc/vmapi -I$(M)/inc |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 26 | |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 27 | else |
| 28 | |
Andrew Scull | ce08e9e | 2019-01-03 10:10:33 +0000 | [diff] [blame] | 29 | KERNEL_PATH ?= $(HAFNIUM_PATH)/third_party/linux |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 30 | ARCH ?= arm64 |
| 31 | CROSS_COMPILE ?= aarch64-linux-gnu- |
Andrew Scull | 0177811 | 2019-01-14 15:37:53 +0000 | [diff] [blame] | 32 | CHECKPATCH ?= $(KERNEL_PATH)/scripts/checkpatch.pl -q |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 33 | |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 34 | all: |
Andrew Walbran | 4cc539b | 2019-11-07 15:42:48 +0000 | [diff] [blame] | 35 | cp -r $(HAFNIUM_PATH)/vmlib/ $(CURDIR) |
Serban Constantinescu | 06046ea | 2019-11-07 13:23:00 +0000 | [diff] [blame] | 36 | make -C $(KERNEL_PATH) HAFNIUM_PATH=$(HAFNIUM_PATH) M=$(CURDIR) O=$(O) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules |
Wedson Almeida Filho | 2f62b42 | 2018-06-19 06:44:32 +0100 | [diff] [blame] | 37 | |
| 38 | clean: |
Serban Constantinescu | 06046ea | 2019-11-07 13:23:00 +0000 | [diff] [blame] | 39 | make -C $(KERNEL_PATH) HAFNIUM_PATH=$(HAFNIUM_PATH) M=$(CURDIR) O=$(O) clean |
Andrew Walbran | 4cc539b | 2019-11-07 15:42:48 +0000 | [diff] [blame] | 40 | rm -rf vmlib |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 41 | |
Andrew Scull | 0177811 | 2019-01-14 15:37:53 +0000 | [diff] [blame] | 42 | checkpatch: |
Andrew Walbran | 4cc539b | 2019-11-07 15:42:48 +0000 | [diff] [blame] | 43 | $(CHECKPATCH) -f main.c |
Andrew Scull | 0177811 | 2019-01-14 15:37:53 +0000 | [diff] [blame] | 44 | |
Andrew Scull | 82257c4 | 2018-10-01 10:37:48 +0100 | [diff] [blame] | 45 | endif |