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