Преглед изворни кода

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