Home | History | Annotate | Line # | Download | only in crash
Makefile revision 1.41
      1 #	$NetBSD: Makefile,v 1.41 2018/09/15 19:47:48 jakllsch 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} == "sparc" \
     20     || ${MACHINE} == "sparc64" \
     21     || ${MACHINE_CPU} == "arm" \
     22     || ${MACHINE_CPU} == "aarch64" \
     23     || ${MACHINE_ARCH} == "m68k"
     24 SRCS+=	db_trace.c
     25 .if ${MACHINE_ARCH} != "m68k"
     26 SRCS+=	db_machdep.c
     27 .endif
     28 REALCRASH=yes
     29 .else
     30 REALCRASH=no
     31 .endif
     32 
     33 .if ${REALCRASH} != "no"	# {
     34 
     35 S=		${.CURDIR}/../../sys
     36 
     37 CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
     38 CPPFLAGS+=	-DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
     39 CPPFLAGS+=	-UDB_MACHINE_COMMANDS
     40 
     41 # ddb files from kernel
     42 .PATH:	$S/ddb
     43 SRCS+=	db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
     44 SRCS+=  db_autoconf.c
     45 SRCS+=	db_access.c db_elf.c db_examine.c
     46 SRCS+=	db_expr.c db_lex.c db_output.c db_print.c
     47 SRCS+=	db_sym.c db_variables.c db_write_cmd.c
     48 
     49 .PATH:	${S}/arch/${MACHINE}/${MACHINE}
     50 .PATH:	${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
     51 SRCS+=	db_disasm.c
     52 
     53 .PATH:  $S/kern
     54 SRCS+=	kern_timeout.c
     55 CPPFLAGS.kern_timeout.c += -DCRASH -DDDB
     56 
     57 CPPFLAGS+=	-I${S}/arch
     58 
     59 . if    ${MACHINE} == "amd64" \
     60      || ${MACHINE} == "i386"
     61 MACHINE_FAMILY = x86
     62 . elif  ${MACHINE} == "sparc64"
     63 MACHINE_FAMILY = sparc
     64 . else
     65 MACHINE_FAMILY = ${MACHINE_CPU}
     66 . endif
     67 
     68 .if ${MACHINE_CPU} == "arm"
     69 .PATH:	${S}/arch/arm/arm32
     70 SRCS+=disassem.c cpufunc_asm.S
     71 .endif
     72 .if ${MACHINE_CPU} == "aarch64"
     73 SRCS+=disasm.c
     74 .endif
     75 
     76 .PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
     77 
     78 # crash main source
     79 SRCS+=	crash.c
     80 
     81 # arch.c
     82 .PATH:	${.CURDIR}/arch
     83 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
     84 SRCS+=	${MACHINE_FAMILY}.c
     85 . else
     86 SRCS+=	generic.c
     87 . endif
     88 
     89 COPTS.db_output.c += -Wno-format-nonliteral
     90 
     91 .if ${MKREPRO} == "yes"
     92 .       if ${MKREPRO_TIMESTAMP:U0} != 0
     93 NVFLAGS+=-r ${MKREPRO_TIMESTAMP}
     94 .       else
     95 NVFLAGS+=-R
     96 .       endif
     97 .endif
     98 
     99 # vers.c
    100 SRCS+=	vers.c
    101 vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
    102 	${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
    103 CLEANFILES+=	vers.c version
    104 
    105 .else				# } {
    106 
    107 SRCS+=	unsupported.c
    108 
    109 .endif				# }
    110 
    111 .if  ${MACHINE} == "sparc" \
    112     || ${MACHINE} == "sparc64"
    113 COPTS.kern_timeout.c += -Wno-stack-protector
    114 .endif
    115 
    116 .include "../../compat/exec.mk"
    117 
    118 .include <bsd.prog.mk>
    119 .include <bsd.klinks.mk>
    120