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