Makefile revision 1.80
1#	$NetBSD: Makefile,v 1.80 2014/01/12 15:19:57 tsutsui 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 errno.c exit.c files.c \
27	getfile.c gets.c globals.c \
28	panic.c printf.c qsort.c snprintf.c sprintf.c strerror.c \
29	subr_prf.c twiddle.c vsprintf.c checkpasswd.c
30
31# string routines
32.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"
33SRCS+=	memcmp.c memcpy.c memmove.c memset.c strchr.c
34.endif
35SRCS+=	bcopy.c bzero.c	# Remove me eventually.
36
37# io routines
38SRCS+=	closeall.c dev.c disklabel.c dkcksum.c ioctl.c nullfs.c stat.c fstat.c
39SRCS+=	close.c lseek.c open.c read.c write.c
40.if (${SA_USE_CREAD} == "yes")
41CPPFLAGS+= -D__INTERNAL_LIBSA_CREAD
42SRCS+=	cread.c
43.endif
44.if (${SA_ENABLE_LS_OP} == "yes")
45SRCS+= ls.c
46.endif
47
48.if (${SA_USE_LOADFILE} == "yes")
49SRCS+=	loadfile.c loadfile_ecoff.c loadfile_elf32.c lookup_elf32.c \
50	loadfile_elf64.c lookup_elf64.c
51.if (${MACHINE_CPU} != "mips")
52SRCS+=	loadfile_aout.c
53.endif
54.endif
55
56.if (${SA_INCLUDE_NET} == "yes")
57# network routines
58SRCS+=	arp.c ether.c ether_sprintf.c ip_cksum.c net.c netif.c rpc.c udp.c ip.c
59
60# network info services:
61SRCS+=	bootp.c rarp.c bootparam.c
62
63# boot filesystems
64SRCS+=	nfs.c tftp.c
65.endif
66
67SRCS+=	ffsv1.c ffsv2.c
68SRCS+=	lfsv1.c lfsv2.c
69SRCS+=	cd9660.c
70SRCS+=	ustarfs.c
71SRCS+=	dosfs.c
72SRCS+=	ext2fs.c
73SRCS+=	minixfs3.c
74SRCS+=	fnmatch.c
75# for historic compatibility ufs == ffsv1
76SRCS+=	ufs.c
77
78.include <bsd.lib.mk>
79
80lib${LIB}.o:: ${OBJS}
81	@echo building standard ${LIB} library
82	@rm -f lib${LIB}.o
83	@${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort`
84
85CPPFLAGS+=	-Wno-pointer-sign
86
87.if defined(HAVE_GCC) && ${HAVE_GCC} >= 45 && ${MACHINE_ARCH} == "vax"
88COPTS.bootp.c+=	-O0
89.endif
90