Makefile revision 1.42
11.42Smrg# $NetBSD: Makefile,v 1.42 2019/10/13 07:28:18 mrg 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.41Sjakllsch || ${MACHINE_CPU} == "aarch64" \ 231.16Smlelstv || ${MACHINE_ARCH} == "m68k" 241.17SchristosSRCS+= db_trace.c 251.37Snakayama.if ${MACHINE_ARCH} != "m68k" 261.17SchristosSRCS+= db_machdep.c 271.21Schristos.endif 281.10SmrgREALCRASH=yes 291.1Sad.else 301.10SmrgREALCRASH=no 311.10Smrg.endif 321.10Smrg 331.10Smrg.if ${REALCRASH} != "no" # { 341.1Sad 351.7SchristosS= ${.CURDIR}/../../sys 361.1Sad 371.1SadCPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing 381.1SadCPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER 391.31SchristosCPPFLAGS+= -UDB_MACHINE_COMMANDS 401.1Sad 411.1Sad# ddb files from kernel 421.1Sad.PATH: $S/ddb 431.1SadSRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c 441.39SmlelstvSRCS+= db_autoconf.c 451.1SadSRCS+= db_access.c db_elf.c db_examine.c 461.1SadSRCS+= db_expr.c db_lex.c db_output.c db_print.c 471.1SadSRCS+= db_sym.c db_variables.c db_write_cmd.c 481.1Sad 491.7Schristos.PATH: ${S}/arch/${MACHINE}/${MACHINE} 501.15Sskrll.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} 511.10SmrgSRCS+= db_disasm.c 521.7Schristos 531.28Schristos.PATH: $S/kern 541.28SchristosSRCS+= kern_timeout.c 551.29SchristosCPPFLAGS.kern_timeout.c += -DCRASH -DDDB 561.28Schristos 571.17SchristosCPPFLAGS+= -I${S}/arch 581.17Schristos 591.10Smrg. if ${MACHINE} == "amd64" \ 601.10Smrg || ${MACHINE} == "i386" 611.11SchristosMACHINE_FAMILY = x86 621.32Smrg. elif ${MACHINE} == "sparc64" 631.24SchristosMACHINE_FAMILY = sparc 641.11Schristos. else 651.27SskrllMACHINE_FAMILY = ${MACHINE_CPU} 661.10Smrg. endif 671.10Smrg 681.27Sskrll.if ${MACHINE_CPU} == "arm" 691.17Schristos.PATH: ${S}/arch/arm/arm32 701.22SskrllSRCS+=disassem.c cpufunc_asm.S 711.17Schristos.endif 721.41Sjakllsch.if ${MACHINE_CPU} == "aarch64" 731.41SjakllschSRCS+=disasm.c 741.41Sjakllsch.endif 751.1Sad 761.17Schristos.PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY} 771.16Smlelstv 781.1Sad# crash main source 791.1SadSRCS+= crash.c 801.1Sad 811.1Sad# arch.c 821.1Sad.PATH: ${.CURDIR}/arch 831.11Schristos. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c)) 841.11SchristosSRCS+= ${MACHINE_FAMILY}.c 851.7Schristos. else 861.1SadSRCS+= generic.c 871.7Schristos. endif 881.1Sad 891.13SchristosCOPTS.db_output.c += -Wno-format-nonliteral 901.13Schristos 911.40Schristos.if ${MKREPRO} == "yes" 921.40Schristos. if ${MKREPRO_TIMESTAMP:U0} != 0 931.40SchristosNVFLAGS+=-r ${MKREPRO_TIMESTAMP} 941.40Schristos. else 951.40SchristosNVFLAGS+=-R 961.40Schristos. endif 971.40Schristos.endif 981.40Schristos 991.1Sad# vers.c 1001.1SadSRCS+= vers.c 1011.23Sapbvers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS} 1021.40Schristos ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH 1031.1SadCLEANFILES+= vers.c version 1041.1Sad 1051.10Smrg.else # } { 1061.10Smrg 1071.10SmrgSRCS+= unsupported.c 1081.10Smrg 1091.10Smrg.endif # } 1101.1Sad 1111.36Schristos.if ${MACHINE} == "sparc" \ 1121.36Schristos || ${MACHINE} == "sparc64" 1131.34SchristosCOPTS.kern_timeout.c += -Wno-stack-protector 1141.36Schristos.endif 1151.34Schristos 1161.33Smrg.include "../../compat/exec.mk" 1171.33Smrg 1181.42SmrgCOPTS.db_command.c+= ${GCC_NO_CAST_FUNCTION_TYPE} 1191.42Smrg 1201.1Sad.include <bsd.prog.mk> 1211.1Sad.include <bsd.klinks.mk> 122