xref: /netbsd/sys/lib/libsa/Makefile (revision 782ab330)
1#	$NetBSD: Makefile,v 1.95 2021/05/27 06:54:44 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
10SA_ENABLE_BIENDIAN?= no		# Biendian support
11				# (currently only for loadfile_elf*)
12
13#DEBUGCPPFLAGS= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG -DRPC_DEBUG -DRARP_DEBUG -DARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
14CPPFLAGS=	-I${SADIR} ${SACPPFLAGS} ${SAMISCCPPFLAGS} \
15		-DCOMPAT_UFS ${DEBUGCPPFLAGS}
16
17#COPTS+= -ansi -pedantic -Wall
18
19# For testing
20#WARNS=6
21#NOSSP=yes
22#NOFORTIFY=yes
23#COPTS+=-ffreestanding -Wpointer-sign
24#CPPFLAGS+= -I${.CURDIR}/../../ -I${.CURDIR}
25
26.if defined(SA_EXTRADIR)
27.-include "${SA_EXTRADIR}/Makefile.inc"
28.endif
29
30.include <bsd.own.mk>
31
32.PATH.c: ${SADIR} ${.PARSEDIR}/../../../common/lib/libc/string
33
34# stand routines
35SRCS+=	alloc.c atoi.c errno.c exit.c files.c \
36	getfile.c gets.c globals.c \
37	panic.c printf.c qsort.c snprintf.c strerror.c \
38	subr_prf.c twiddle.c checkpasswd.c
39
40SRCS+=	bootcfg.c
41
42# string routines
43.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"
44SRCS+=	memcmp.c memcpy.c memmove.c memset.c strchr.c
45.endif
46SRCS+=	bcopy.c bzero.c	# Remove me eventually.
47
48# io routines
49SRCS+=	closeall.c dev.c disklabel.c ioctl.c nullfs.c stat.c fstat.c
50SRCS+=	close.c lseek.c open.c read.c write.c
51.if (${SA_USE_CREAD} == "yes")
52CPPFLAGS+= -D__INTERNAL_LIBSA_CREAD
53SRCS+=	cread.c
54.endif
55.if (${SA_ENABLE_LS_OP} == "yes")
56SRCS+= ls.c
57.endif
58
59.if (${SA_USE_LOADFILE} == "yes")
60SRCS+=	loadfile.c loadfile_ecoff.c loadfile_elf32.c lookup_elf32.c \
61	loadfile_elf64.c lookup_elf64.c
62.if (${MACHINE_CPU} != "mips")
63SRCS+=	loadfile_aout.c
64.endif
65.endif
66
67.if (${SA_INCLUDE_NET} == "yes")
68# network routines
69SRCS+=	arp.c ether.c ether_sprintf.c ip_cksum.c net.c netif.c rpc.c udp.c ip.c
70
71# network info services:
72SRCS+=	bootp.c rarp.c bootparam.c
73
74# boot filesystems
75SRCS+=	nfs.c tftp.c
76.endif
77
78.if (${SA_ENABLE_BIENDIAN} == "yes")
79CPPFLAGS+=	-DLIBSA_BIENDIAN_SUPPORT
80SRCS+=		byteorder.c
81.endif
82
83SRCS+=	ffsv1.c ffsv2.c ffs_bswap.c
84SRCS+=	lfsv1.c lfsv2.c
85SRCS+=	cd9660.c
86SRCS+=	ustarfs.c
87SRCS+=	dosfs.c
88SRCS+=	ext2fs.c
89SRCS+=	minixfs3.c
90SRCS+=	fnmatch.c
91# for historic compatibility ufs == ffsv1
92SRCS+=	ufs.c
93
94.include <bsd.lib.mk>
95
96lib${LIB}.o:: ${OBJS:O} __buildstdlib
97
98CPPFLAGS+=	-Wno-pointer-sign
99
100.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
101COPTS.bootp.c+=	-O0
102.endif
103