1 # $NetBSD: Makefile,v 1.1 2013/08/20 17:35:41 matt Exp $ 2 3 WITHOUT_MAN=true # defined 4 5 .include <bsd.obj.mk> # Pull in OBJDIR name rules. 6 .include <bsd.own.mk> 7 8 LIB= kern 9 DBG= -Os 10 11 MKDEBUGLIB:= no 12 MKLINT:= no 13 MKPICINSTALL:= no 14 MKPIC:= no 15 MKPROFILE:= no 16 17 S= ${NETBSDSRCDIR}/sys 18 CPPFLAGS+= -nostdinc -I${.OBJDIR} -I${S} -I${S}/arch 19 20 CPPFLAGS+= -D_STANDALONE 21 22 COPTS+= -ffreestanding 23 COPTS+= -fno-stack-protector 24 COPTS+= -fno-unwind-tables 25 CWARNFLAGS+= -Werror 26 CWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 27 28 .if !make(obj) && !make(clean) && !make(cleandir) 29 .NOPATH: machine 30 .endif 31 32 realdepend realall: machine 33 CLEANFILES+= ${MACHINE_CPU} machine 34 35 machine:: 36 -rm -f ${MACHINE_CPU} machine 37 ln -s ${S}/arch/${MACHINE}/include machine 38 ln -s ${S}/arch/${MACHINE_CPU}/include ${MACHINE_CPU} 39 40 ${OBJS}: machine 41 42 ### find out what to use for libkern 43 KERN_AS= library 44 KERNDIR= ${S}/lib/libkern 45 46 .include "${S}/lib/libkern/Makefile.libkern" 47 .ifndef ARCHSUBDIR 48 .BEGIN: 49 @echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU} 50 @false 51 .endif 52 53 cleandir distclean: .WAIT cleanlibdir 54 55 cleanlibdir: 56 -rm -rf lib 57 58 .include <bsd.lib.mk> 59 60 lib${LIB}.o:: ${OBJS} 61 @echo building standard ${LIB} library 62 @rm -f lib${LIB}.o 63 @${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}` 64 65 lib${LIB}.po:: ${POBJS} 66 @echo building profiled ${LIB} library 67 @rm -f lib${LIB}.po 68 @${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}` 69 70 showsources: ${SRCS} 71 @echo ${.ALLSRC} 72