1# $NetBSD: Makefile,v 1.54 2023/08/03 14:56:36 rin Exp $ 2# from: @(#)Makefile 8.1 (Berkeley) 6/4/93 3 4WARNS= 3 5 6USE_FORT?= yes # used primarily by setgid programs 7 8USE_SHLIBDIR= yes 9 10LIB= kvm 11CPPFLAGS+=-DLIBC_SCCS -I${NETBSDSRCDIR}/sys -D_KMEMUSER 12 13SRCS= kvm.c kvm_file.c kvm_getloadavg.c kvm_proc.c 14 15# This library should compile to the same thing on all variants of 16# ${MACHINE} with the same ${MACHINE_ARCH} so shared /usr works. 17# If it is necessary to run different code based on ${MACHINE} then 18# the dispatch on ${MACHINE} should be done at run time (see m68k). 19 20.include <bsd.own.mk> 21.if exists(kvm_${KVM_MACHINE_ARCH}.c) 22SRCS+= kvm_${KVM_MACHINE_ARCH}.c 23.elif exists(kvm_${KVM_MACHINE_CPU}.c) 24SRCS+= kvm_${KVM_MACHINE_CPU}.c 25.elif exists(kvm_${MACHINE_ARCH}.c) 26SRCS+= kvm_${MACHINE_ARCH}.c 27.elif exists(kvm_${MACHINE_CPU}.c) 28SRCS+= kvm_${MACHINE_CPU}.c 29.else 30.BEGIN: 31 @echo no kvm_xx.c for ${MACHINE_ARCH} nor ${MACHINE_CPU} 32 @false 33.endif 34 35.if ${MACHINE_ARCH} == "i386" 36LINTFLAGS+=-w 37LINTFLAGS+= -X 351 # 'extern' declaration outside header 38LINTFLAGS+= -X 352 # 'extern' declaration in function body 39SRCS+= kvm_i386pae.c # Hook PAE support in the i386 build 40.endif 41 42# Additional modules needed for m68k 43.if (${MACHINE_ARCH} == "m68k" || ${MACHINE_CPU} == "m68k") 44SRCS+= kvm_m68k_cmn.c kvm_sun2.c kvm_sun3.c kvm_sun3x.c 45.endif 46 47MAN= kvm.3 kvm_dump.3 kvm_geterr.3 kvm_getfiles.3 kvm_getloadavg.3 \ 48 kvm_getkernelname.3 \ 49 kvm_getprocs.3 kvm_nlist.3 kvm_open.3 kvm_read.3 kvm_getlwps.3 50 51MLINKS+=kvm_getprocs.3 kvm_getargv.3 kvm_getprocs.3 kvm_getenvv.3 52MLINKS+=kvm_getprocs.3 kvm_getproc2.3 53MLINKS+=kvm_getprocs.3 kvm_getargv2.3 kvm_getprocs.3 kvm_getenvv2.3 54MLINKS+=kvm_open.3 kvm_openfiles.3 kvm_open.3 kvm_close.3 55MLINKS+=kvm_read.3 kvm_write.3 56MLINKS+=kvm_dump.3 kvm_dump_mkheader.3 kvm_dump.3 kvm_dump_wrtheader.3 57MLINKS+=kvm_dump.3 kvm_dump_inval.3 58 59# This fixes building with MACHINE==sparc64, MACHINE_ARCH==sparc 60# XXX: this is a hack, but until the sparc MD headers are separated 61# out from the sparc AD headers, it's the easiest solution. 62# 63.if (${MACHINE_ARCH} == "sparc") # { 64.if !make(obj) && !make(clean) && !make(cleandir) 65.BEGIN: 66 @([ -h machine ] || \ 67 ln -fs ${NETBSDSRCDIR}/sys/arch/sparc/include machine) 68 @([ -h sparc ] || ln -fs ${NETBSDSRCDIR}/sys/arch/sparc/include sparc) 69.NOPATH: machine sparc 70.endif 71CLEANFILES+= machine sparc 72CPPFLAGS+= -I. 73.endif # } 74 75.if (${MACHINE_ARCH} == "mips") 76CPPFLAGS+= -D_KMEMUSER 77.endif 78 79 80.include <bsd.lib.mk> 81