priv: Use PRIV_NETINET_RAW
[dragonfly.git] / lib / libstand / Makefile
blob0cfdf2e47714288ec53af165a990c907b6ee5538
1 # $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
2 # $DragonFly: src/lib/libstand/Makefile,v 1.12 2008/10/28 16:54:09 swildner Exp $
4 # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
6 # Notes:
7 # - We don't use the libc strerror/sys_errlist because the string table is
8 # quite large.
11 LIB= stand
12 NOPROFILE= YES
13 NOPIC= YES
14 INCS= stand.h
15 MAN= libstand.3
16 WARNS?= 2
18 # Mostly OK, some of the libc imports are a bit noisy
19 CFLAGS+= -ffreestanding -std=c99
21 .if ${MACHINE_ARCH} == "amd64"
22 CFLAGS+= -m32 -mpreferred-stack-boundary=2
23 .endif
24 .if ${MACHINE_ARCH} == "i386"
25 CFLAGS+= -mpreferred-stack-boundary=2
26 .endif
29 # standalone components and stuff we have modified locally
30 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
31 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
32 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
34 # private (pruned) versions of libc string functions
35 SRCS+= strcasecmp.c
37 # string functions from libc
38 .PATH: ${.CURDIR}/../libc/string
39 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
40 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
41 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
42 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
43 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
44 .endif
45 .PATH: ${.CURDIR}/../libc/quad
46 .if ${MACHINE_ARCH} == "i386"
47 SRCS+= ucmpdi2.c
48 .endif
50 # _setjmp/_longjmp
51 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
52 .PATH: ${.CURDIR}/i386
53 .else
54 .endif
55 # really only required for i386
56 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
57 SRCS+= _setjmp.S
59 # decompression functionality from libbz2
60 BZ2DIR= ${.CURDIR}/../../contrib/bzip2-1.0
61 .PATH: ${BZ2DIR}
62 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
63 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
64 bzlib_private.h
66 # check your belt - ugly bzip2 stuff ahead
67 .for file in bzlib.c
68 CLEANFILES+= ${file}
70 ${file}: ${BZ2DIR}/${file} ${file}.diff
71 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
72 .endfor
74 .include "../libz/Makefile.stand"
76 # io routines
77 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
78 fstat.c close.c lseek.c open.c read.c write.c readdir.c
80 # network routines
81 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
83 # network info services:
84 SRCS+= bootp.c rarp.c bootparam.c
86 # boot filesystems
87 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
88 SRCS+= netif.c nfs.c
89 SRCS+= dosfs.c ext2fs.c
90 SRCS+= splitfs.c
91 SRCS+= hammerread.c
93 .include <bsd.lib.mk>
95 .if ${MACHINE_ARCH} == "amd64"
96 CFLAGS+= -I${.OBJDIR}
98 beforedepend ${OBJS}: machine cpu
100 machine::
101 mkdir -p machine
102 ${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/* machine
103 ${LN} -fs ${.CURDIR}/../../sys/platform/pc32/include/* machine
105 cpu::
106 ${LN} -hfs ${.CURDIR}/../../sys/cpu/i386/include cpu
108 CLEANDIRS+= machine cpu
109 .endif