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.
This commit is contained in:
Marcel Moolenaar 2014-03-06 01:59:13 +00:00
parent 6a3645bbb9
commit 50dd852b28
17 changed files with 129 additions and 95 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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