Explorar o código

Support in-tree compilation

Harry Youd %!s(int64=6) %!d(string=hai) anos
pai
achega
bde9b3208a
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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