summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2014-03-06 01:59:13 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2014-03-06 01:59:13 +0000
commit50dd852b28257f33e7858588f0f5c25b353cb45e (patch)
treecf8cd409c44fc8e4ec2387397b83bb8bb84ba76d
parent6a3645bbb90ce771e075e96a754dece0d91484ef (diff)
Notes
-rw-r--r--sys/modules/cyclic/Makefile14
-rw-r--r--sys/modules/dtrace/dtmalloc/Makefile12
-rw-r--r--sys/modules/dtrace/dtnfscl/Makefile12
-rw-r--r--sys/modules/dtrace/dtnfsclient/Makefile12
-rw-r--r--sys/modules/dtrace/dtrace/Makefile30
-rw-r--r--sys/modules/dtrace/dtrace_test/Makefile8
-rw-r--r--sys/modules/dtrace/dtraceall/Makefile6
-rw-r--r--sys/modules/dtrace/fasttrap/Makefile20
-rw-r--r--sys/modules/dtrace/fbt/Makefile12
-rw-r--r--sys/modules/dtrace/lockstat/Makefile12
-rw-r--r--sys/modules/dtrace/profile/Makefile12
-rw-r--r--sys/modules/dtrace/prototype/Makefile12
-rw-r--r--sys/modules/dtrace/sdt/Makefile12
-rw-r--r--sys/modules/dtrace/systrace/Makefile12
-rw-r--r--sys/modules/dtrace/systrace_freebsd32/Makefile12
-rw-r--r--sys/modules/dtrace/systrace_linux32/Makefile12
-rw-r--r--sys/modules/opensolaris/Makefile14
17 files changed, 129 insertions, 95 deletions
diff --git a/sys/modules/cyclic/Makefile b/sys/modules/cyclic/Makefile
index 6b29be4bdd051..985b514fd7945 100644
--- a/sys/modules/cyclic/Makefile
+++ b/sys/modules/cyclic/Makefile
@@ -1,19 +1,21 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../cddl/dev/cyclic
+SYSDIR?= ${.CURDIR}/../..
+
+.PATH: ${SYSDIR}/cddl/dev/cyclic
KMOD= cyclic
SRCS= cyclic.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../.. \
- -I${.CURDIR}/../../cddl/dev/cyclic/i386
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR} \
+ -I${SYSDIR}/cddl/dev/cyclic/i386
IGNORE_PRAGMA= 1
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtmalloc/Makefile b/sys/modules/dtrace/dtmalloc/Makefile
index 3034b46642d4d..e2d4968aba05d 100644
--- a/sys/modules/dtrace/dtmalloc/Makefile
+++ b/sys/modules/dtrace/dtmalloc/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/dtmalloc
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/dtmalloc
KMOD= dtmalloc
SRCS= dtmalloc.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtnfscl/Makefile b/sys/modules/dtrace/dtnfscl/Makefile
index 6c40e625867c8..fc0438c787b5e 100644
--- a/sys/modules/dtrace/dtnfscl/Makefile
+++ b/sys/modules/dtrace/dtnfscl/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../fs/nfsclient
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/fs/nfsclient
KMOD= dtnfscl
SRCS= nfs_clkdtrace.c \
vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtnfsclient/Makefile b/sys/modules/dtrace/dtnfsclient/Makefile
index b19cc3f17cbb4..1c5208f9bd791 100644
--- a/sys/modules/dtrace/dtnfsclient/Makefile
+++ b/sys/modules/dtrace/dtnfsclient/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../nfsclient
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/nfsclient
KMOD= dtnfsclient
SRCS= nfs_kdtrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile
index 52f87d01d7eda..ea2c1f1654aaf 100644
--- a/sys/modules/dtrace/dtrace/Makefile
+++ b/sys/modules/dtrace/dtrace/Makefile
@@ -1,12 +1,14 @@
# $FreeBSD$
+SYSDIR?= ${.CURDIR}/../../..
+
ARCHDIR= ${MACHINE_CPUARCH}
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace
-.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/kern
-.PATH: ${.CURDIR}/../../../cddl/kern
-.PATH: ${.CURDIR}/../../../cddl/dev/dtrace
-.PATH: ${.CURDIR}/../../../cddl/dev/dtrace/${ARCHDIR}
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
+.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
+.PATH: ${SYSDIR}/cddl/kern
+.PATH: ${SYSDIR}/cddl/dev/dtrace
+.PATH: ${SYSDIR}/cddl/dev/dtrace/${ARCHDIR}
KMOD= dtrace
SRCS= dtrace.c \
@@ -14,11 +16,11 @@ SRCS= dtrace.c \
dtrace_subr.c
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
-.PATH: ${.CURDIR}/../../../cddl/dev/dtrace/x86
+.PATH: ${SYSDIR}/cddl/dev/dtrace/x86
SRCS+= dis_tables.c \
instr_size.c
-CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel \
- -I${.CURDIR}/../../../cddl/dev/dtrace/x86
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
+ -I${SYSDIR}/cddl/dev/dtrace/x86
.endif
SRCS+= bus_if.h device_if.h vnode_if.h
@@ -36,11 +38,11 @@ SRCS += opensolaris_taskq.c
SRCS+= opt_apic.h
.endif
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/dev/dtrace \
- -I${.CURDIR}/../../../cddl/dev/dtrace/${ARCHDIR} \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../.. -DDIS_MEM
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/dev/dtrace \
+ -I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR} -DDIS_MEM
CFLAGS+= -DSMP
@@ -52,7 +54,7 @@ dtrace_asm.o: assym.s
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
CWARNFLAGS+= -Wno-parentheses
CWARNFLAGS+= -Wno-uninitialized
diff --git a/sys/modules/dtrace/dtrace_test/Makefile b/sys/modules/dtrace/dtrace_test/Makefile
index 9725ad9f9a24b..56099b68e72c3 100644
--- a/sys/modules/dtrace/dtrace_test/Makefile
+++ b/sys/modules/dtrace/dtrace_test/Makefile
@@ -1,16 +1,18 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/dtrace
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/dtrace
KMOD= dtrace_test
SRCS= dtrace_test.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}
CFLAGS+= -D_KERNEL
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtraceall/Makefile b/sys/modules/dtrace/dtraceall/Makefile
index d57e41e9db219..b5d9494ca6d5c 100644
--- a/sys/modules/dtrace/dtraceall/Makefile
+++ b/sys/modules/dtrace/dtraceall/Makefile
@@ -1,9 +1,11 @@
# $FreeBSD$
+SYSDIR?= ${.CURDIR}/../../..
+
KMOD= dtraceall
SRCS= dtraceall.c opt_compat.h opt_nfs.h
-CFLAGS+= -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}
.if !defined(KERNBUILDDIR)
.if ${MACHINE_ARCH} == "amd64"
@@ -14,4 +16,4 @@ opt_compat.h:
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile
index 50b5c58a78517..45ff7bf51eef0 100644
--- a/sys/modules/dtrace/fasttrap/Makefile
+++ b/sys/modules/dtrace/fasttrap/Makefile
@@ -1,26 +1,28 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
KMOD= fasttrap
SRCS= fasttrap.c fasttrap_isa.c opt_compat.h
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
-CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/intel/dtrace
.elif ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc/dtrace
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace
.endif
CFLAGS+= -DSMP
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
CWARNFLAGS+= -Wno-unused
diff --git a/sys/modules/dtrace/fbt/Makefile b/sys/modules/dtrace/fbt/Makefile
index 7c03d3182e636..2305710571f18 100644
--- a/sys/modules/dtrace/fbt/Makefile
+++ b/sys/modules/dtrace/fbt/Makefile
@@ -1,6 +1,8 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/fbt
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/fbt
KMOD= fbt
.if ${MACHINE_CPUARCH} == "powerpc"
@@ -10,10 +12,10 @@ SRCS= fbt.c
.endif
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/lockstat/Makefile b/sys/modules/dtrace/lockstat/Makefile
index 11b695a291b7f..8780dd8cea415 100644
--- a/sys/modules/dtrace/lockstat/Makefile
+++ b/sys/modules/dtrace/lockstat/Makefile
@@ -1,16 +1,18 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/lockstat
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/lockstat
KMOD= lockstat
SRCS= lockstat.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/profile/Makefile b/sys/modules/dtrace/profile/Makefile
index daa5d2ca6da95..b0f59f53e1534 100644
--- a/sys/modules/dtrace/profile/Makefile
+++ b/sys/modules/dtrace/profile/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/profile
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/profile
KMOD= profile
SRCS= profile.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/prototype/Makefile b/sys/modules/dtrace/prototype/Makefile
index cad750a20dc71..68d4c35f44063 100644
--- a/sys/modules/dtrace/prototype/Makefile
+++ b/sys/modules/dtrace/prototype/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev
KMOD= prototype
SRCS= prototype.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/sdt/Makefile b/sys/modules/dtrace/sdt/Makefile
index 96605e1115220..b77299dd77fd7 100644
--- a/sys/modules/dtrace/sdt/Makefile
+++ b/sys/modules/dtrace/sdt/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/sdt
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/sdt
KMOD= sdt
SRCS= sdt.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace/Makefile b/sys/modules/dtrace/systrace/Makefile
index f495d550cdabd..88daa0bf6f42b 100644
--- a/sys/modules/dtrace/systrace/Makefile
+++ b/sys/modules/dtrace/systrace/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/systrace
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
KMOD= systrace
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_freebsd32/Makefile b/sys/modules/dtrace/systrace_freebsd32/Makefile
index ec72d0bd8b56a..4c5da4478a60c 100644
--- a/sys/modules/dtrace/systrace_freebsd32/Makefile
+++ b/sys/modules/dtrace/systrace_freebsd32/Makefile
@@ -1,15 +1,17 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/systrace
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
KMOD= systrace_freebsd32
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR} -DFREEBSD32_SYSTRACE
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_linux32/Makefile b/sys/modules/dtrace/systrace_linux32/Makefile
index a2bfc81230800..b3eedeea1d536 100644
--- a/sys/modules/dtrace/systrace_linux32/Makefile
+++ b/sys/modules/dtrace/systrace_linux32/Makefile
@@ -1,6 +1,8 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../../cddl/dev/systrace
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
.if ${MACHINE} == "amd64"
KMOD= systrace_linux32
@@ -11,10 +13,10 @@ KMOD= systrace_linux
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../.. -DLINUX_SYSTRACE
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR} -DLINUX_SYSTRACE
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile
index a49462ac4c20c..1620ab9719895 100644
--- a/sys/modules/opensolaris/Makefile
+++ b/sys/modules/opensolaris/Makefile
@@ -1,6 +1,8 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern
+SYSDIR?= ${.CURDIR}/../..
+
+.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
KMOD= opensolaris
SRCS= opensolaris.c \
@@ -9,7 +11,7 @@ SRCS= opensolaris.c \
opensolaris_misc.c \
opensolaris_sunddi.c
-_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic
+_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
.PATH: ${_A}/${MACHINE_CPUARCH}
SRCS+= opensolaris_atomic.S
@@ -20,12 +22,12 @@ SRCS+= opensolaris_atomic.S
SRCS+= opensolaris_atomic.c
.endif
-CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \
- -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../..
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}
IGNORE_PRAGMA= 1
.include <bsd.kmod.mk>
-CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h