Makefile revision 1.27
1#	$NetBSD: Makefile,v 1.27 2014/03/30 07:29:22 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.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
50CPPFLAGS+=	-I${S}/arch
51
52. if    ${MACHINE} == "amd64" \
53     || ${MACHINE} == "i386"
54MACHINE_FAMILY = x86
55. elif    ${MACHINE} == "sparc64" \
56     || ${MACHINE} == "sparc64"
57MACHINE_FAMILY = sparc
58. else
59MACHINE_FAMILY = ${MACHINE_CPU}
60. endif
61
62.if ${MACHINE_CPU} == "arm"
63.PATH:	${S}/arch/arm/arm32
64SRCS+=disassem.c cpufunc_asm.S
65.endif
66
67.PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
68
69# crash main source
70SRCS+=	crash.c
71
72# arch.c
73.PATH:	${.CURDIR}/arch
74. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
75SRCS+=	${MACHINE_FAMILY}.c
76. else
77SRCS+=	generic.c
78. endif
79
80COPTS.db_output.c += -Wno-format-nonliteral
81
82# vers.c
83SRCS+=	vers.c
84vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
85	${HOST_SH} ${S}/conf/newvers.sh -r -n
86CLEANFILES+=	vers.c version
87
88.else				# } {
89
90SRCS+=	unsupported.c
91
92.endif				# }
93
94.include <bsd.prog.mk>
95.include <bsd.klinks.mk>
96