浏览代码

Support in-tree compilation

Harry Youd 6 年之前
父节点
当前提交
bde9b3208a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Makefile

+ 5 - 1
Makefile

@@ -20,7 +20,11 @@ ifeq ($(GCC_VER_49),1)
 EXTRA_CFLAGS += -Wno-date-time	# Fix compile error && warning on gcc 4.9 and later
 endif
 
-export TopDIR ?= $(shell pwd)
+ifneq (,$(findstring /usr/lib/dkms,$(PATH)))
+    export TopDIR ?= $(shell pwd)
+else
+    export TopDIR ?= $(srctree)/$(src)
+endif
 
 EXTRA_CFLAGS += -I$(TopDIR)/include