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