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