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