Selaa lähdekoodia

Support in-tree compilation

Harry Youd 6 vuotta sitten
vanhempi
commit
bde9b3208a
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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