1# $NetBSD: Makefile,v 1.86 2015/09/07 03:44:19 uebayasi Exp $ 2 3LIB= sa 4LIBISPRIVATE?= yes 5 6SA_USE_CREAD?= no # Read compressed kernels 7SA_INCLUDE_NET?= yes # Netboot via TFTP, NFS 8SA_USE_LOADFILE?= no # Generic executable loading support 9SA_ENABLE_LS_OP?= no # Filesystems ls operation 10 11#DEBUGCPPFLAGS= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG -DRPC_DEBUG -DRARP_DEBUG -DARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID 12CPPFLAGS= -I${SADIR} ${SACPPFLAGS} ${SAMISCCPPFLAGS} \ 13 -DCOMPAT_UFS ${DEBUGCPPFLAGS} 14 15#COPTS+= -ansi -pedantic -Wall 16 17.if defined(SA_EXTRADIR) 18.-include "${SA_EXTRADIR}/Makefile.inc" 19.endif 20 21.include <bsd.own.mk> 22 23.PATH.c: ${SADIR} ${.PARSEDIR}/../../../common/lib/libc/string 24 25# stand routines 26SRCS+= alloc.c atoi.c errno.c exit.c files.c \ 27 getfile.c gets.c globals.c \ 28 panic.c printf.c qsort.c snprintf.c strerror.c \ 29 subr_prf.c twiddle.c checkpasswd.c 30 31SRCS+= bootcfg.c 32 33# string routines 34.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64" 35SRCS+= memcmp.c memcpy.c memmove.c memset.c strchr.c 36.endif 37.if !defined(__MINIX) 38SRCS+= bcopy.c bzero.c # Remove me eventually. 39.endif # !defined(__MINIX) 40 41# io routines 42SRCS+= closeall.c dev.c disklabel.c dkcksum.c ioctl.c nullfs.c stat.c fstat.c 43SRCS+= close.c lseek.c open.c read.c write.c 44.if (${SA_USE_CREAD} == "yes") 45CPPFLAGS+= -D__INTERNAL_LIBSA_CREAD 46SRCS+= cread.c 47.endif 48.if (${SA_ENABLE_LS_OP} == "yes") 49SRCS+= ls.c 50.endif 51 52.if (${SA_USE_LOADFILE} == "yes") 53.if !defined(__MINIX) 54SRCS+= loadfile.c loadfile_ecoff.c loadfile_elf32.c lookup_elf32.c \ 55 loadfile_elf64.c lookup_elf64.c 56.if (${MACHINE_CPU} != "mips") 57SRCS+= loadfile_aout.c 58.endif 59.else 60SRCS+= loadfile.c loadfile_elf32.c loadfile_elf64.c 61.endif # !defined(__MINIX) 62.endif 63 64.if (${SA_INCLUDE_NET} == "yes") 65# network routines 66SRCS+= arp.c ether.c ether_sprintf.c ip_cksum.c net.c netif.c rpc.c udp.c ip.c 67 68# network info services: 69SRCS+= bootp.c rarp.c bootparam.c 70 71# boot filesystems 72SRCS+= nfs.c tftp.c 73.endif 74 75SRCS+= ffsv1.c ffsv2.c 76SRCS+= lfsv1.c lfsv2.c 77SRCS+= cd9660.c 78SRCS+= ustarfs.c 79SRCS+= dosfs.c 80SRCS+= ext2fs.c 81SRCS+= minixfs3.c 82SRCS+= fnmatch.c 83# for historic compatibility ufs == ffsv1 84SRCS+= ufs.c 85 86.if defined(__MINIX) 87# NetBSD has it in libkern, MINIX lacks it 88SRCS+= xlat_mbr_fstype.c 89.PATH.c: ${NETBSDSRCDIR}/sys/lib/libkern 90 91# NetBSD has it in libkern, MINIX has it in libc but not libminc... 92SRCS+= md5c.c 93.PATH.c: ${NETBSDSRCDIR}/common/lib/libc/md 94.endif # defined(__MINIX) 95 96.include <bsd.lib.mk> 97 98lib${LIB}.o:: ${OBJS:O} 99 @echo building standard ${LIB} library 100 @rm -f lib${LIB}.o 101 @${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort` 102 @echo done 103 104CPPFLAGS+= -Wno-pointer-sign 105 106.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax" 107COPTS.bootp.c+= -O0 108.endif 109