1 # $NetBSD: Makefile,v 1.36 2017/04/10 12:05:52 christos Exp $ 2 3 PROG= crash 4 MAN= crash.8 5 RUMPKERNEL= yes # XXX: Avoid -mcmodel=kernel 6 7 CWARNFLAGS.clang+= -Wno-format 8 9 LDADD+= -lutil -lkvm -ledit -lterminfo 10 DPADD+= ${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO} 11 12 .include <bsd.own.mk> 13 14 # some ddb kernel components need limited modifications. for now, 15 # punt if not noted as implemented here. 16 .if ${MACHINE} == "amd64" \ 17 || ${MACHINE} == "hppa" \ 18 || ${MACHINE} == "i386" \ 19 || ${MACHINE} == "sparc" \ 20 || ${MACHINE} == "sparc64" \ 21 || (${MACHINE_CPU} == "arm" && ${MACHINE} != "acorn26") \ 22 || ${MACHINE_ARCH} == "m68k" 23 SRCS+= db_trace.c 24 .if ${MACHINE_ARCH} == "sparc" 25 SRCS+= db_interface.c 26 .elif ${MACHINE_ARCH} != "m68k" 27 SRCS+= db_machdep.c 28 .endif 29 REALCRASH=yes 30 .else 31 REALCRASH=no 32 .endif 33 34 .if ${REALCRASH} != "no" # { 35 36 S= ${.CURDIR}/../../sys 37 38 CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing 39 CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER 40 CPPFLAGS+= -UDB_MACHINE_COMMANDS 41 42 # ddb files from kernel 43 .PATH: $S/ddb 44 SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c 45 SRCS+= db_access.c db_elf.c db_examine.c 46 SRCS+= db_expr.c db_lex.c db_output.c db_print.c 47 SRCS+= db_sym.c db_variables.c db_write_cmd.c 48 49 .PATH: ${S}/arch/${MACHINE}/${MACHINE} 50 .PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} 51 SRCS+= db_disasm.c 52 53 .PATH: $S/kern 54 SRCS+= kern_timeout.c 55 CPPFLAGS.kern_timeout.c += -DCRASH -DDDB 56 57 CPPFLAGS+= -I${S}/arch 58 59 . if ${MACHINE} == "amd64" \ 60 || ${MACHINE} == "i386" 61 MACHINE_FAMILY = x86 62 . elif ${MACHINE} == "sparc64" 63 MACHINE_FAMILY = sparc 64 . else 65 MACHINE_FAMILY = ${MACHINE_CPU} 66 . endif 67 68 .if ${MACHINE_CPU} == "arm" 69 .PATH: ${S}/arch/arm/arm32 70 SRCS+=disassem.c cpufunc_asm.S 71 .endif 72 73 .PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY} 74 75 # crash main source 76 SRCS+= crash.c 77 78 # arch.c 79 .PATH: ${.CURDIR}/arch 80 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c)) 81 SRCS+= ${MACHINE_FAMILY}.c 82 . else 83 SRCS+= generic.c 84 . endif 85 86 COPTS.db_output.c += -Wno-format-nonliteral 87 88 # vers.c 89 SRCS+= vers.c 90 vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS} 91 ${HOST_SH} ${S}/conf/newvers.sh -r -n 92 CLEANFILES+= vers.c version 93 94 .else # } { 95 96 SRCS+= unsupported.c 97 98 .endif # } 99 100 .if ${MACHINE} == "sparc" \ 101 || ${MACHINE} == "sparc64" 102 COPTS.kern_timeout.c += -Wno-stack-protector 103 .endif 104 105 .include "../../compat/exec.mk" 106 107 .include <bsd.prog.mk> 108 .include <bsd.klinks.mk> 109