xref: /netbsd-src/sys/lib/libsa/Makefile (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1#	$NetBSD: Makefile,v 1.87 2016/03/22 08:25:23 mrg 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
37SRCS+=	bcopy.c bzero.c	# Remove me eventually.
38
39# io routines
40SRCS+=	closeall.c dev.c disklabel.c dkcksum.c ioctl.c nullfs.c stat.c fstat.c
41SRCS+=	close.c lseek.c open.c read.c write.c
42.if (${SA_USE_CREAD} == "yes")
43CPPFLAGS+= -D__INTERNAL_LIBSA_CREAD
44SRCS+=	cread.c
45.endif
46.if (${SA_ENABLE_LS_OP} == "yes")
47SRCS+= ls.c
48.endif
49
50.if (${SA_USE_LOADFILE} == "yes")
51SRCS+=	loadfile.c loadfile_ecoff.c loadfile_elf32.c lookup_elf32.c \
52	loadfile_elf64.c lookup_elf64.c
53.if (${MACHINE_CPU} != "mips")
54SRCS+=	loadfile_aout.c
55.endif
56.endif
57
58.if (${SA_INCLUDE_NET} == "yes")
59# network routines
60SRCS+=	arp.c ether.c ether_sprintf.c ip_cksum.c net.c netif.c rpc.c udp.c ip.c
61
62# network info services:
63SRCS+=	bootp.c rarp.c bootparam.c
64
65# boot filesystems
66SRCS+=	nfs.c tftp.c
67.endif
68
69SRCS+=	ffsv1.c ffsv2.c
70SRCS+=	lfsv1.c lfsv2.c
71SRCS+=	cd9660.c
72SRCS+=	ustarfs.c
73SRCS+=	dosfs.c
74SRCS+=	ext2fs.c
75SRCS+=	minixfs3.c
76SRCS+=	fnmatch.c
77# for historic compatibility ufs == ffsv1
78SRCS+=	ufs.c
79
80.include <bsd.lib.mk>
81
82lib${LIB}.o:: ${OBJS:O}
83	@echo building standard ${LIB} library
84	@rm -f lib${LIB}.o
85	@${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort`
86
87CPPFLAGS+=	-Wno-pointer-sign
88
89.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
90COPTS.bootp.c+=	-O0
91.endif
92