Makefile revision 1.31
1#	$NetBSD: Makefile,v 1.31 2015/06/16 23:48:20 christos 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.include <bsd.own.mk>
13
14# some ddb kernel components need limited modifications.  for now,
15# punt if not noted as implemented here.
16.if    ${MACHINE} == "amd64" \
17    || ${MACHINE} == "hppa" \
18    || ${MACHINE} == "i386" \
19    || ${MACHINE} == "sparc64" \
20    || (${MACHINE_CPU} == "arm" && ${MACHINE} != "acorn26") \
21    || ${MACHINE_ARCH} == "m68k"
22SRCS+=	db_trace.c
23.if ${MACHINE_ARCH} != "m68k"
24SRCS+=	db_machdep.c
25.endif
26REALCRASH=yes
27.else
28REALCRASH=no
29.endif
30
31.if ${REALCRASH} != "no"	# {
32
33S=		${.CURDIR}/../../sys
34
35CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
36CPPFLAGS+=	-DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
37CPPFLAGS+=	-UDB_MACHINE_COMMANDS
38
39# ddb files from kernel
40.PATH:	$S/ddb
41SRCS+=	db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
42SRCS+=	db_access.c db_elf.c db_examine.c
43SRCS+=	db_expr.c db_lex.c db_output.c db_print.c
44SRCS+=	db_sym.c db_variables.c db_write_cmd.c
45
46.PATH:	${S}/arch/${MACHINE}/${MACHINE}
47.PATH:	${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
48SRCS+=	db_disasm.c
49
50.PATH:  $S/kern
51SRCS+=	kern_timeout.c
52CPPFLAGS.kern_timeout.c += -DCRASH -DDDB
53
54CPPFLAGS+=	-I${S}/arch
55
56. if    ${MACHINE} == "amd64" \
57     || ${MACHINE} == "i386"
58MACHINE_FAMILY = x86
59. elif    ${MACHINE} == "sparc64" \
60     || ${MACHINE} == "sparc64"
61MACHINE_FAMILY = sparc
62. else
63MACHINE_FAMILY = ${MACHINE_CPU}
64. endif
65
66.if ${MACHINE_CPU} == "arm"
67.PATH:	${S}/arch/arm/arm32
68SRCS+=disassem.c cpufunc_asm.S
69.endif
70
71.PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
72
73# crash main source
74SRCS+=	crash.c
75
76# arch.c
77.PATH:	${.CURDIR}/arch
78. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
79SRCS+=	${MACHINE_FAMILY}.c
80. else
81SRCS+=	generic.c
82. endif
83
84COPTS.db_output.c += -Wno-format-nonliteral
85
86# vers.c
87SRCS+=	vers.c
88vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
89	${HOST_SH} ${S}/conf/newvers.sh -r -n
90CLEANFILES+=	vers.c version
91
92.else				# } {
93
94SRCS+=	unsupported.c
95
96.endif				# }
97
98.include <bsd.prog.mk>
99.include <bsd.klinks.mk>
100