Makefile revision 1.87
1# $NetBSD: Makefile,v 1.87 2008/01/31 02:36:09 matt Exp $ 2 3LIB= kern 4NOPIC= # defined 5LLIBS= # defined 6 7.include <bsd.own.mk> 8 9.if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 10 exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 11ARCHSUBDIR= ${LIBKERN_ARCH} 12.elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \ 13 exists(${KERNDIR}/arch/${MACHINE_ARCH}) 14ARCHSUBDIR= ${MACHINE_ARCH} 15.elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \ 16 exists(${KERNDIR}/arch/${MACHINE_CPU}) 17ARCHSUBDIR= ${MACHINE_CPU} 18.else 19.BEGIN: 20 @echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU} 21 @false 22.endif 23 24M= ${KERNDIR}/arch/${ARCHSUBDIR} 25 26CPPFLAGS= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 27 28.include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 29.include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc" 30 31CPPFLAGS+= -I${KERNDIR}/../../../common/include 32 33.PATH.c: ${KERNDIR} 34.if exists ($M/Makefile.inc) 35.PATH.c: $M 36.PATH.S: $M 37.include "$M/Makefile.inc" 38.endif 39 40.if (${MACHINE_ARCH} != "alpha") 41# Quad support 42SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 43 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 44 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 45.endif 46 47# Other stuff 48SRCS+= __cmsg_alignbytes.c inet_addr.c intoa.c 49SRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c 50SRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c 51 52SRCS+= strsep.c strstr.c strlcpy.c strlcat.c 53 54SRCS+= strtoll.c strtoull.c strtoumax.c 55 56SRCS+= xlat_mbr_fstype.c 57 58SRCS+= rb.c 59COPTS.rb.c+= -Wno-missing-field-initializers 60 61# Files to clean up 62CLEANFILES+= lib${LIB}.o lib${LIB}.po 63 64# XXX these stub builds should be cleaned up even further. 65 66# if no machine specific memcpy(3), build one out of bcopy(3) based stub. 67.if empty(SRCS:Mmemcpy.S) 68SRCS+= memcpy.c 69.endif 70 71# if no machine specific memmove(3), build one out of bcopy(3) based stub. 72.if empty(SRCS:Mmemmove.S) 73SRCS+= memmove.c 74.endif 75 76# if no machine specific strchr(3), build one out of index(3) based stub. 77.if empty(SRCS:Mstrchr.S) 78SRCS+= strchr.c 79.endif 80 81# if no machine specific strrchr(3), build one out of rindex(3) based stub. 82.if empty(SRCS:Mstrrchr.S) 83SRCS+= strrchr.c 84.endif 85 86# only needed during build 87libinstall:: 88 89.undef DESTDIR 90.include <bsd.lib.mk> 91 92lib${LIB}.o:: ${OBJS} 93 @echo building standard ${LIB} library 94 @rm -f lib${LIB}.o 95 @${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}` 96 97lib${LIB}.po:: ${POBJS} 98 @echo building profiled ${LIB} library 99 @rm -f lib${LIB}.po 100 @${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}` 101 102showsources: ${SRCS} 103 @echo ${.ALLSRC} 104