Makefile revision 1.40
11.40Schristos#	$NetBSD: Makefile,v 1.40 2018/05/20 03:09:02 christos Exp $
21.1Sad
31.7SchristosPROG=		crash
41.7SchristosMAN=		crash.8
51.3SchristosRUMPKERNEL=	yes	# XXX: Avoid -mcmodel=kernel
61.1Sad
71.12SjoergCWARNFLAGS.clang+=	-Wno-format
81.12Sjoerg
91.14SskrllLDADD+=	-lutil -lkvm -ledit -lterminfo
101.7SchristosDPADD+=	${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO}
111.1Sad
121.27Sskrll.include <bsd.own.mk>
131.27Sskrll
141.1Sad# some ddb kernel components need limited modifications.  for now,
151.1Sad# punt if not noted as implemented here.
161.10Smrg.if    ${MACHINE} == "amd64" \
171.25Sskrll    || ${MACHINE} == "hppa" \
181.10Smrg    || ${MACHINE} == "i386" \
191.32Smrg    || ${MACHINE} == "sparc" \
201.16Smlelstv    || ${MACHINE} == "sparc64" \
211.38Sskrll    || ${MACHINE_CPU} == "arm" \
221.16Smlelstv    || ${MACHINE_ARCH} == "m68k"
231.17SchristosSRCS+=	db_trace.c
241.37Snakayama.if ${MACHINE_ARCH} != "m68k"
251.17SchristosSRCS+=	db_machdep.c
261.21Schristos.endif
271.10SmrgREALCRASH=yes
281.1Sad.else
291.10SmrgREALCRASH=no
301.10Smrg.endif
311.10Smrg
321.10Smrg.if ${REALCRASH} != "no"	# {
331.1Sad
341.7SchristosS=		${.CURDIR}/../../sys
351.1Sad
361.1SadCPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
371.1SadCPPFLAGS+=	-DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
381.31SchristosCPPFLAGS+=	-UDB_MACHINE_COMMANDS
391.1Sad
401.1Sad# ddb files from kernel
411.1Sad.PATH:	$S/ddb
421.1SadSRCS+=	db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
431.39SmlelstvSRCS+=  db_autoconf.c
441.1SadSRCS+=	db_access.c db_elf.c db_examine.c
451.1SadSRCS+=	db_expr.c db_lex.c db_output.c db_print.c
461.1SadSRCS+=	db_sym.c db_variables.c db_write_cmd.c
471.1Sad
481.7Schristos.PATH:	${S}/arch/${MACHINE}/${MACHINE}
491.15Sskrll.PATH:	${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
501.10SmrgSRCS+=	db_disasm.c
511.7Schristos
521.28Schristos.PATH:  $S/kern
531.28SchristosSRCS+=	kern_timeout.c
541.29SchristosCPPFLAGS.kern_timeout.c += -DCRASH -DDDB
551.28Schristos
561.17SchristosCPPFLAGS+=	-I${S}/arch
571.17Schristos
581.10Smrg. if    ${MACHINE} == "amd64" \
591.10Smrg     || ${MACHINE} == "i386"
601.11SchristosMACHINE_FAMILY = x86
611.32Smrg. elif  ${MACHINE} == "sparc64"
621.24SchristosMACHINE_FAMILY = sparc
631.11Schristos. else
641.27SskrllMACHINE_FAMILY = ${MACHINE_CPU}
651.10Smrg. endif
661.10Smrg
671.27Sskrll.if ${MACHINE_CPU} == "arm"
681.17Schristos.PATH:	${S}/arch/arm/arm32
691.22SskrllSRCS+=disassem.c cpufunc_asm.S
701.17Schristos.endif
711.1Sad
721.17Schristos.PATH:	${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
731.16Smlelstv
741.1Sad# crash main source
751.1SadSRCS+=	crash.c
761.1Sad
771.1Sad# arch.c
781.1Sad.PATH:	${.CURDIR}/arch
791.11Schristos. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
801.11SchristosSRCS+=	${MACHINE_FAMILY}.c
811.7Schristos. else
821.1SadSRCS+=	generic.c
831.7Schristos. endif
841.1Sad
851.13SchristosCOPTS.db_output.c += -Wno-format-nonliteral
861.13Schristos
871.40Schristos.if ${MKREPRO} == "yes"
881.40Schristos.       if ${MKREPRO_TIMESTAMP:U0} != 0
891.40SchristosNVFLAGS+=-r ${MKREPRO_TIMESTAMP}
901.40Schristos.       else
911.40SchristosNVFLAGS+=-R
921.40Schristos.       endif
931.40Schristos.endif
941.40Schristos
951.1Sad# vers.c
961.1SadSRCS+=	vers.c
971.23Sapbvers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
981.40Schristos	${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
991.1SadCLEANFILES+=	vers.c version
1001.1Sad
1011.10Smrg.else				# } {
1021.10Smrg
1031.10SmrgSRCS+=	unsupported.c
1041.10Smrg
1051.10Smrg.endif				# }
1061.1Sad
1071.36Schristos.if  ${MACHINE} == "sparc" \
1081.36Schristos    || ${MACHINE} == "sparc64"
1091.34SchristosCOPTS.kern_timeout.c += -Wno-stack-protector
1101.36Schristos.endif
1111.34Schristos
1121.33Smrg.include "../../compat/exec.mk"
1131.33Smrg
1141.1Sad.include <bsd.prog.mk>
1151.1Sad.include <bsd.klinks.mk>
116