NetBSD/usr.sbin/crash/Makefile

107 lines
2.3 KiB
Makefile
Raw Normal View History

2018-01-24 12:04:40 +03:00
# $NetBSD: Makefile,v 1.38 2018/01/24 09:04:46 skrll Exp $
PROG= crash
MAN= crash.8
RUMPKERNEL= yes # XXX: Avoid -mcmodel=kernel
CWARNFLAGS.clang+= -Wno-format
2012-01-17 22:44:24 +04:00
LDADD+= -lutil -lkvm -ledit -lterminfo
DPADD+= ${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO}
2014-03-30 11:29:22 +04:00
.include <bsd.own.mk>
# some ddb kernel components need limited modifications. for now,
# punt if not noted as implemented here.
.if ${MACHINE} == "amd64" \
|| ${MACHINE} == "hppa" \
|| ${MACHINE} == "i386" \
|| ${MACHINE} == "sparc" \
|| ${MACHINE} == "sparc64" \
2018-01-24 12:04:40 +03:00
|| ${MACHINE_CPU} == "arm" \
|| ${MACHINE_ARCH} == "m68k"
SRCS+= db_trace.c
2017-07-21 23:58:44 +03:00
.if ${MACHINE_ARCH} != "m68k"
SRCS+= db_machdep.c
.endif
REALCRASH=yes
.else
REALCRASH=no
.endif
.if ${REALCRASH} != "no" # {
S= ${.CURDIR}/../../sys
CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
CPPFLAGS+= -UDB_MACHINE_COMMANDS
# ddb files from kernel
.PATH: $S/ddb
SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
SRCS+= db_access.c db_elf.c db_examine.c
SRCS+= db_expr.c db_lex.c db_output.c db_print.c
SRCS+= db_sym.c db_variables.c db_write_cmd.c
.PATH: ${S}/arch/${MACHINE}/${MACHINE}
2012-01-18 13:35:48 +04:00
.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
SRCS+= db_disasm.c
2015-02-08 22:42:12 +03:00
.PATH: $S/kern
SRCS+= kern_timeout.c
CPPFLAGS.kern_timeout.c += -DCRASH -DDDB
2015-02-08 22:42:12 +03:00
CPPFLAGS+= -I${S}/arch
. if ${MACHINE} == "amd64" \
|| ${MACHINE} == "i386"
MACHINE_FAMILY = x86
. elif ${MACHINE} == "sparc64"
2013-03-05 00:10:50 +04:00
MACHINE_FAMILY = sparc
. else
2014-03-30 11:29:22 +04:00
MACHINE_FAMILY = ${MACHINE_CPU}
. endif
2014-03-30 11:29:22 +04:00
.if ${MACHINE_CPU} == "arm"
.PATH: ${S}/arch/arm/arm32
SRCS+=disassem.c cpufunc_asm.S
.endif
.PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
# crash main source
SRCS+= crash.c
# arch.c
.PATH: ${.CURDIR}/arch
. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
SRCS+= ${MACHINE_FAMILY}.c
. else
SRCS+= generic.c
. endif
2011-08-16 12:04:17 +04:00
COPTS.db_output.c += -Wno-format-nonliteral
# vers.c
SRCS+= vers.c
vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
${HOST_SH} ${S}/conf/newvers.sh -r -n
CLEANFILES+= vers.c version
.else # } {
SRCS+= unsupported.c
.endif # }
2017-04-10 15:05:52 +03:00
.if ${MACHINE} == "sparc" \
|| ${MACHINE} == "sparc64"
2017-04-09 23:34:00 +03:00
COPTS.kern_timeout.c += -Wno-stack-protector
2017-04-10 15:05:52 +03:00
.endif
2017-04-09 23:34:00 +03:00
.include "../../compat/exec.mk"
.include <bsd.prog.mk>
.include <bsd.klinks.mk>