1 # $NetBSD: Makefile,v 1.39 2018/03/04 07:15:37 mlelstv 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" \ 22 || ${MACHINE_ARCH} == "m68k" 23 SRCS+= db_trace.c 24 .if ${MACHINE_ARCH} != "m68k" 25 SRCS+= db_machdep.c 26 .endif 27 REALCRASH=yes 28 .else 29 REALCRASH=no 30 .endif 31 32 .if ${REALCRASH} != "no" # { 33 34 S= ${.CURDIR}/../../sys 35 36 CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing 37 CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER 38 CPPFLAGS+= -UDB_MACHINE_COMMANDS 39 40 # ddb files from kernel 41 .PATH: $S/ddb 42 SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c 43 SRCS+= db_autoconf.c 44 SRCS+= db_access.c db_elf.c db_examine.c 45 SRCS+= db_expr.c db_lex.c db_output.c db_print.c 46 SRCS+= db_sym.c db_variables.c db_write_cmd.c 47 48 .PATH: ${S}/arch/${MACHINE}/${MACHINE} 49 .PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} 50 SRCS+= db_disasm.c 51 52 .PATH: $S/kern 53 SRCS+= kern_timeout.c 54 CPPFLAGS.kern_timeout.c += -DCRASH -DDDB 55 56 CPPFLAGS+= -I${S}/arch 57 58 . if ${MACHINE} == "amd64" \ 59 || ${MACHINE} == "i386" 60 MACHINE_FAMILY = x86 61 . elif ${MACHINE} == "sparc64" 62 MACHINE_FAMILY = sparc 63 . else 64 MACHINE_FAMILY = ${MACHINE_CPU} 65 . endif 66 67 .if ${MACHINE_CPU} == "arm" 68 .PATH: ${S}/arch/arm/arm32 69 SRCS+=disassem.c cpufunc_asm.S 70 .endif 71 72 .PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY} 73 74 # crash main source 75 SRCS+= crash.c 76 77 # arch.c 78 .PATH: ${.CURDIR}/arch 79 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c)) 80 SRCS+= ${MACHINE_FAMILY}.c 81 . else 82 SRCS+= generic.c 83 . endif 84 85 COPTS.db_output.c += -Wno-format-nonliteral 86 87 # vers.c 88 SRCS+= vers.c 89 vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS} 90 ${HOST_SH} ${S}/conf/newvers.sh -r -n 91 CLEANFILES+= vers.c version 92 93 .else # } { 94 95 SRCS+= unsupported.c 96 97 .endif # } 98 99 .if ${MACHINE} == "sparc" \ 100 || ${MACHINE} == "sparc64" 101 COPTS.kern_timeout.c += -Wno-stack-protector 102 .endif 103 104 .include "../../compat/exec.mk" 105 106 .include <bsd.prog.mk> 107 .include <bsd.klinks.mk> 108