Makefile revision 1.11
1#	$NetBSD: Makefile,v 1.11 2011/04/30 16:57:58 christos Exp $
2
3PROG=		crash
4MAN=		crash.8
5RUMPKERNEL=	yes	# XXX: Avoid -mcmodel=kernel
6
7LDADD+=	-lutil -lkvm -ledit -lterminfo -T${.CURDIR}/ldscript.crash
8DPADD+=	${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO}
9
10# some ddb kernel components need limited modifications.  for now,
11# punt if not noted as implemented here.
12.if    ${MACHINE} == "amd64" \
13    || ${MACHINE} == "i386" \
14    || ${MACHINE} == "sparc64"
15REALCRASH=yes
16.else
17REALCRASH=no
18.endif
19
20.if ${REALCRASH} != "no"	# {
21
22S=		${.CURDIR}/../../sys
23
24CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
25CPPFLAGS+=	-DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
26CPPFLAGS+=	-UDB_MACHINE_COMMANDS
27
28# ddb files from kernel
29.PATH:	$S/ddb
30SRCS+=	db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
31SRCS+=	db_access.c db_elf.c db_examine.c
32SRCS+=	db_expr.c db_lex.c db_output.c db_print.c
33SRCS+=	db_sym.c db_variables.c db_write_cmd.c
34
35.PATH:	${S}/arch/${MACHINE}/${MACHINE}
36SRCS+=	db_disasm.c
37
38. if    ${MACHINE} == "amd64" \
39     || ${MACHINE} == "i386"
40MACHINE_FAMILY = x86
41.PATH:	${S}/arch/x86/x86
42SRCS+=	db_trace.c
43SRCS+=	db_machdep.c
44. else
45MACHINE_FAMILY = ${MACHINE}
46. endif
47
48. if ${MACHINE} == "sparc64"
49SRCS+=	db_trace.c db_interface.c
50. endif
51
52# crash main source
53SRCS+=	crash.c
54
55# arch.c
56.PATH:	${.CURDIR}/arch
57. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
58SRCS+=	${MACHINE_FAMILY}.c
59. else
60SRCS+=	generic.c
61. endif
62
63# vers.c
64SRCS+=	vers.c
65vers.c:	${S}/conf/newvers.sh
66	${HOST_SH} ${S}/conf/newvers.sh -r
67CLEANFILES+=	vers.c version
68
69.else				# } {
70
71SRCS+=	unsupported.c
72
73.endif				# }
74
75.include <bsd.prog.mk>
76.include <bsd.klinks.mk>
77