Add snprintf and vsnprintf.
[dragonfly.git] / lib / libstand / Makefile
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.8 2005/04/06 03:36:27 dillon Exp $
3 #
4 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
5 #
6 # Notes:
7 # - We don't use the libc strerror/sys_errlist because the string table is
8 #   quite large.
9 #
10
11 LIB=            stand
12 NOPROFILE=      YES
13 NOPIC=          YES
14 INCS=           stand.h
15 MAN=            libstand.3
16
17 # Mostly OK, some of the libc imports are a bit noisy
18 CFLAGS+=        -fno-stack-protector
19 CFLAGS+=        -Wall -ffreestanding
20
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
27
28
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
33
34 # private (pruned) versions of libc string functions
35 SRCS+=  strcasecmp.c
36
37 # string functions from libc
38 .PATH:  ${.CURDIR}/../libc/string
39 .if ${MACHINE_ARCH} == "i386"
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
49
50 .if ${MACHINE_ARCH} == "i386"
51 # _setjmp/_longjmp
52 .PATH:  ${.CURDIR}/${MACHINE_ARCH}
53 SRCS+=  _setjmp.S
54 # really only required for i386
55 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
56 .endif
57
58 # decompression functionality from libbz2
59 .PATH:  ${.CURDIR}/../../contrib/bzip2
60 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
61 SRCS+=  _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
62         _bzlib_private.h
63
64 # check your belt - ugly bzip2 stuff ahead
65 .for file in bzlib.c bzlib.h bzlib_private.h
66 CLEANFILES+=   _${file} _${file}.orig
67
68 _${file}: ${file} ${file}.diff
69         patch -s --suffix=.orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
70 .endfor
71
72 .for file in crctable.c decompress.c huffman.c randtable.c
73 CLEANFILES+=    _${file}
74
75 _${file}: ${file}
76         sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
77 .endfor
78
79 .include "../libz/Makefile.stand"
80
81 # io routines
82 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
83         fstat.c close.c lseek.c open.c read.c write.c readdir.c
84
85 # network routines
86 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
87
88 # network info services:
89 SRCS+=  bootp.c rarp.c bootparam.c
90
91 # boot filesystems
92 SRCS+=  ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
93 SRCS+=  netif.c nfs.c
94 SRCS+=  dosfs.c ext2fs.c
95 SRCS+=  splitfs.c
96
97 .include <bsd.lib.mk>