Home | History | Annotate | Line # | Download | only in crash
Makefile revision 1.27
      1 #	$NetBSD: Makefile,v 1.27 2014/03/30 07:29:22 skrll Exp $
      2 
      3 PROG=		crash
      4 MAN=		crash.8
      5 RUMPKERNEL=	yes	# XXX: Avoid -mcmodel=kernel
      6 
      7 CWARNFLAGS.clang+=	-Wno-format
      8 
      9 LDADD+=	-lutil -lkvm -ledit -lterminfo
     10 DPADD+=	${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"
     22 SRCS+=	db_trace.c
     23 .if ${MACHINE_ARCH} != "m68k"
     24 SRCS+=	db_machdep.c
     25 .endif
     26 REALCRASH=yes
     27 .else
     28 REALCRASH=no
     29 .endif
     30 
     31 .if ${REALCRASH} != "no"	# {
     32 
     33 S=		${.CURDIR}/../../sys
     34 
     35 CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
     36 CPPFLAGS+=	-DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
     37 CPPFLAGS+=	-UDB_MACHINE_COMMANDS
     38 
     39 # ddb files from kernel
     40 .PATH:	$S/ddb
     41 SRCS+=	db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
     42 SRCS+=	db_access.c db_elf.c db_examine.c
     43 SRCS+=	db_expr.c db_lex.c db_output.c db_print.c
     44 SRCS+=	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}
     48 SRCS+=	db_disasm.c
     49 
     50 CPPFLAGS+=	-I${S}/arch
     51 
     52 . if    ${MACHINE} == "amd64" \
     53      || ${MACHINE} == "i386"
     54 MACHINE_FAMILY = x86
     55 . elif    ${MACHINE} == "sparc64" \
     56      || ${MACHINE} == "sparc64"
     57 MACHINE_FAMILY = sparc
     58 . else
     59 MACHINE_FAMILY = ${MACHINE_CPU}
     60 . endif
     61 
     62 .if ${MACHINE_CPU} == "arm"
     63 .PATH:	${S}/arch/arm/arm32
     64 SRCS+=disassem.c cpufunc_asm.S
     65 .endif
     66 
     67 .PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
     68 
     69 # crash main source
     70 SRCS+=	crash.c
     71 
     72 # arch.c
     73 .PATH:	${.CURDIR}/arch
     74 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
     75 SRCS+=	${MACHINE_FAMILY}.c
     76 . else
     77 SRCS+=	generic.c
     78 . endif
     79 
     80 COPTS.db_output.c += -Wno-format-nonliteral
     81 
     82 # vers.c
     83 SRCS+=	vers.c
     84 vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
     85 	${HOST_SH} ${S}/conf/newvers.sh -r -n
     86 CLEANFILES+=	vers.c version
     87 
     88 .else				# } {
     89 
     90 SRCS+=	unsupported.c
     91 
     92 .endif				# }
     93 
     94 .include <bsd.prog.mk>
     95 .include <bsd.klinks.mk>
     96