1 # $NetBSD: Makefile,v 1.14 2012/01/17 18:44:24 skrll 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 # some ddb kernel components need limited modifications. for now, 13 # punt if not noted as implemented here. 14 .if ${MACHINE} == "amd64" \ 15 || ${MACHINE} == "i386" \ 16 || ${MACHINE} == "sparc64" 17 REALCRASH=yes 18 .else 19 REALCRASH=no 20 .endif 21 22 .if ${REALCRASH} != "no" # { 23 24 S= ${.CURDIR}/../../sys 25 26 CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing 27 CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER 28 CPPFLAGS+= -UDB_MACHINE_COMMANDS 29 30 # ddb files from kernel 31 .PATH: $S/ddb 32 SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c 33 SRCS+= db_access.c db_elf.c db_examine.c 34 SRCS+= db_expr.c db_lex.c db_output.c db_print.c 35 SRCS+= db_sym.c db_variables.c db_write_cmd.c 36 37 .PATH: ${S}/arch/${MACHINE}/${MACHINE} 38 SRCS+= db_disasm.c 39 40 . if ${MACHINE} == "amd64" \ 41 || ${MACHINE} == "i386" 42 MACHINE_FAMILY = x86 43 .PATH: ${S}/arch/x86/x86 44 SRCS+= db_trace.c 45 SRCS+= db_machdep.c 46 . else 47 MACHINE_FAMILY = ${MACHINE} 48 . endif 49 50 . if ${MACHINE} == "sparc64" 51 SRCS+= db_trace.c db_interface.c 52 . endif 53 54 # crash main source 55 SRCS+= crash.c 56 57 # arch.c 58 .PATH: ${.CURDIR}/arch 59 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c)) 60 SRCS+= ${MACHINE_FAMILY}.c 61 . else 62 SRCS+= generic.c 63 . endif 64 65 COPTS.db_output.c += -Wno-format-nonliteral 66 67 # vers.c 68 SRCS+= vers.c 69 vers.c: ${S}/conf/newvers.sh 70 ${HOST_SH} ${S}/conf/newvers.sh -r 71 CLEANFILES+= vers.c version 72 73 .else # } { 74 75 SRCS+= unsupported.c 76 77 .endif # } 78 79 .include <bsd.prog.mk> 80 .include <bsd.klinks.mk> 81