Home | History | Annotate | Line # | Download | only in crash
Makefile revision 1.44
      1 #	$NetBSD: Makefile,v 1.44 2020/03/09 05:10:19 rin 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 +=-DLOCKDEBUG
     58 SRCS += subr_lockdebug.c
     59 CPPFLAGS.subr_lockdebug.c += -DCRASH -DDDB
     60 
     61 CPPFLAGS+=	-I${S}/arch
     62 
     63 . if    ${MACHINE} == "amd64" \
     64      || ${MACHINE} == "i386"
     65 MACHINE_FAMILY = x86
     66 . elif  ${MACHINE} == "sparc64"
     67 MACHINE_FAMILY = sparc
     68 . else
     69 MACHINE_FAMILY = ${MACHINE_CPU}
     70 . endif
     71 
     72 .if ${MACHINE_CPU} == "arm"
     73 .PATH:	${S}/arch/arm/arm32
     74 SRCS+=disassem.c cpufunc_asm.S
     75 .endif
     76 .if ${MACHINE_CPU} == "aarch64"
     77 SRCS+=disasm.c
     78 .endif
     79 
     80 .PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
     81 
     82 # crash main source
     83 SRCS+=	crash.c
     84 
     85 # arch.c
     86 .PATH:	${.CURDIR}/arch
     87 . if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
     88 SRCS+=	${MACHINE_FAMILY}.c
     89 . else
     90 SRCS+=	generic.c
     91 . endif
     92 
     93 COPTS.db_output.c += -Wno-format-nonliteral
     94 
     95 .if ${MKREPRO} == "yes"
     96 .       if ${MKREPRO_TIMESTAMP:U0} != 0
     97 NVFLAGS+=-r ${MKREPRO_TIMESTAMP}
     98 .       else
     99 NVFLAGS+=-R
    100 .       endif
    101 .endif
    102 
    103 # vers.c
    104 SRCS+=	vers.c
    105 vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
    106 	${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
    107 CLEANFILES+=	vers.c version
    108 
    109 .else				# } {
    110 
    111 SRCS+=	unsupported.c
    112 
    113 .endif				# }
    114 
    115 .if  ${MACHINE} == "sparc" \
    116     || ${MACHINE} == "sparc64"
    117 COPTS.kern_timeout.c += -Wno-stack-protector
    118 .endif
    119 
    120 .include "../../compat/exec.mk"
    121 
    122 COPTS.db_command.c+=	${GCC_NO_CAST_FUNCTION_TYPE}
    123 
    124 .include <bsd.prog.mk>
    125 .include <bsd.klinks.mk>
    126