-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 891 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
UK_DIRECTORY ?= $(HOME)/.unikraft
UK_ROOT ?= $(UK_DIRECTORY)/unikraft
UK_LIBS ?= $(UK_DIRECTORY)/libs
UK_PLATS ?= $(UK_DIRECTORY)/plats
LIBS ?= $(UK_LIBS)/newlib
ifneq ($(KERNELRELEASE),)
isgx-y := \
sgx_main.o \
sgx_page_cache.o \
sgx_ioctl.o \
sgx_vma.o \
sgx_util.o\
sgx_encl.o \
sgx_encl2.o
obj-m += isgx.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
$(MAKECMDGOALS):
@make -C $(UK_ROOT) A=$(PWD) L=$(LIBS) P=$(PLATS) $(MAKECMDGOALS)
ukbuild:
@make -C $(UK_ROOT) A=$(PWD) L=$(LIBS) P=$(PLATS)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install: default
$(MAKE) INSTALL_MOD_DIR=kernel/drivers/intel/sgx -C $(KDIR) M=$(PWD) modules_install
depmod -A
sh -c "cat /etc/modules | grep -Fxq isgx || echo isgx >> /etc/modules"
endif
clean:
rm -vrf *.o *.ko *.order *.symvers *.mod.c .tmp_versions .*o.cmd build/