2017-08-12 15:27:33 +00:00
|
|
|
ifneq ($(KERNELRELEASE),)
|
|
|
|
isgx-y := \
|
|
|
|
sgx_main.o \
|
|
|
|
sgx_page_cache.o \
|
|
|
|
sgx_ioctl.o \
|
|
|
|
sgx_vma.o \
|
2017-12-14 12:36:34 +00:00
|
|
|
sgx_util.o\
|
|
|
|
sgx_encl.o
|
2017-08-12 15:27:33 +00:00
|
|
|
obj-m += isgx.o
|
|
|
|
else
|
|
|
|
KDIR := /lib/modules/$(shell uname -r)/build
|
|
|
|
PWD := $(shell pwd)
|
|
|
|
|
|
|
|
default:
|
2017-12-14 12:36:34 +00:00
|
|
|
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CFLAGS_MODULE="-DDEBUG -g -O0" modules
|
2017-08-12 15:27:33 +00:00
|
|
|
|
|
|
|
install: default
|
|
|
|
$(MAKE) INSTALL_MOD_DIR=kernel/drivers/intel/sgx -C $(KDIR) M=$(PWD) modules_install
|
|
|
|
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
|