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