inet6: require RTF_ANNOUNCE to proxy NS
[dragonfly.git] / stand / lib / Makefile
blob26a650f66b367c9637824c87e723d35705f12008
1 # $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
3 # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
5 # Notes:
6 # - We don't use the libc strerror/sys_errlist because the string table is
7 # quite large.
10 LIB?= stand
11 INTERNALLIB=
12 NOPIC= YES
13 MAN?= libstand.3
14 CSTD?= c99
15 WARNS?= 2
16 NO_STRICT_ALIASING=
18 LIBSTAND_SRC?= ${.CURDIR}
19 LIBSTAND_ARCH?= ${MACHINE_ARCH}
20 LIBC_SRC= ${LIBSTAND_SRC}/../../lib/libc
22 CFLAGS+= -D_STANDALONE
24 # Mostly OK, some of the libc imports are a bit noisy
25 CFLAGS+= -ffreestanding
27 # Disable stack protector
28 CFLAGS+= -fno-stack-protector
30 .if (${CFLAGS:M-flto} && ${CCVER:Mgcc*})
31 CFLAGS+= -fno-builtin # LTO exposes too much stuff
32 .endif
34 .if ${LIBSTAND_ARCH} == "x86_64"
35 CFLAGS+= -mno-red-zone -fPIC
36 .endif
38 .if ${LIBSTAND_ARCH} == "i386"
39 .if ${CCVER:Mgcc*}
40 CFLAGS+= -mpreferred-stack-boundary=2
41 .endif
42 FORCE_CPUTYPE= i386
43 CFLAGS+= -m32
44 .endif
46 .if ${LIBSTAND_ARCH} == "i386" || ${LIBSTAND_ARCH} == "x86_64"
47 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
48 .endif
50 # standalone components and stuff we have modified locally
51 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
52 globals.c pager.c printf.c random.c \
53 strdup.c strerror.c strtol.c strtoul.c sbrk.c \
54 twiddle.c zalloc.c zalloc_malloc.c
56 # private (pruned) versions of libc string functions
57 SRCS+= strcasecmp.c
59 # string functions from libc
60 .PATH: ${LIBSTAND_SRC}/../../lib/libc/string
61 .if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
62 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
63 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
64 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
65 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
67 # math stuff, thus no -flto!
68 qdivrem.o: qdivrem.c
69 ${CC} ${CFLAGS:N-flto} -c -o ${.TARGET} ${.IMPSRC}
70 .endif
72 # _setjmp/_longjmp
73 .PATH: ${LIBSTAND_SRC}/${LIBSTAND_ARCH}
74 .if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
75 # really only required for i386
76 CFLAGS+=-I${LIBSTAND_SRC}/../../lib/libc/${MACHINE_ARCH}
77 .endif
78 SRCS+= _setjmp.S
80 # decompression functionality from libz
81 # NOTE: crc32.c is used from libz and not libkern
82 .include "../../lib/libz/Makefile.stand"
84 # iscsi_crc32() for hammer2
85 .PATH: ${LIBSTAND_SRC}/../../sys/libkern
86 SRCS+= icrc32.c
88 # decompression functionality from libbz2
89 BZ2DIR= ${LIBSTAND_SRC}/../../contrib/bzip2
90 .PATH: ${BZ2DIR}
91 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
92 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c
94 # io routines
95 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
96 fstat.c close.c lseek.c open.c read.c write.c readdir.c
98 # uuid routines
99 SRCS+= uuid_from_string.c uuid_to_string.c
101 # uuid routines from libc
102 .PATH: ${LIBC_SRC}/uuid
103 SRCS+= uuid_create_nil.c
105 # network routines
106 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
108 # network info services:
109 SRCS+= bootp.c rarp.c bootparam.c
111 # boot filesystems
112 SRCS+= ufs.c nfs.c cd9660.c tftp.c bzipfs.c gzipfs.c
113 SRCS+= netif.c nfs.c
114 SRCS+= dosfs.c ext2fs.c
115 SRCS+= splitfs.c
116 SRCS+= hammer1.c
117 SRCS+= hammer2.c
119 .include <bsd.lib.mk>