summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-03-06 01:59:13 +0000
committermarcel <marcel@FreeBSD.org>2014-03-06 01:59:13 +0000
commit4509bceae4169ce8bd2114b470c5348b0bcc6da2 (patch)
treecf8cd409c44fc8e4ec2387397b83bb8bb84ba76d
parent995f6a98b00f70dd68c492328a958b89514aad83 (diff)
downloadFreeBSD-src-4509bceae4169ce8bd2114b470c5348b0bcc6da2.zip
FreeBSD-src-4509bceae4169ce8bd2114b470c5348b0bcc6da2.tar.gz
Use SYSDIR to reference to the top of the sys hierarchy. Define SYSDIR
relative to .CURDIR if not already defined. This makes the makefiles more readable but also more re-usable and adaptable. Obtained from: Juniper Networks, Inc.
-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 6b29be4..985b514 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 3034b46..e2d4968 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 6c40e62..fc0438c 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 b19cc3f..1c5208f 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 52f87d0..ea2c1f1 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 9725ad9..56099b6 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 d57e41e..b5d9494 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 50b5c58..45ff7bf 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 7c03d31..2305710 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 11b695a..8780dd8 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 daa5d2c..b0f59f5 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 cad750a..68d4c35 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 96605e1..b77299d 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 f495d55..88daa0b 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 ec72d0b..4c5da44 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 a2bfc81..b3eedee 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 a49462a..1620ab9 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
OpenPOWER on IntegriCloud