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