Merge branch 'vendor/OPENSSL'
[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 #
3 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4 #
5 # Notes:
6 # - We don't use the libc strerror/sys_errlist because the string table is
7 #   quite large.
8 #
9
10 LIB=            stand
11 NOPROFILE=      YES
12 NOPIC=          YES
13 INCS=           stand.h
14 MAN=            libstand.3
15 CSTD?=          c99
16 WARNS?=         2
17
18 # Mostly OK, some of the libc imports are a bit noisy
19 CFLAGS+=        -ffreestanding
20
21 .if ${MACHINE_ARCH} == "x86_64"
22 .if ${CCVER:Mgcc*}
23 CFLAGS+=        -mpreferred-stack-boundary=2
24 .endif
25 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
26 FORCE_CPUTYPE=  i386
27 .endif
28
29 .if ${MACHINE_ARCH} == "x86_64"
30 CFLAGS+=        -m32
31 .endif
32
33 # standalone components and stuff we have modified locally
34 SRCS+=  __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
35         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
36         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
37
38 # private (pruned) versions of libc string functions
39 SRCS+=  strcasecmp.c
40
41 # string functions from libc
42 .PATH:  ${.CURDIR}/../libc/string
43 .if ${MACHINE_ARCH} == "x86_64"
44 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
45         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
46         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
47         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
48 .endif
49 .PATH:  ${.CURDIR}/../../sys/libkern
50 SRCS+=  icrc32.c
51
52 # _setjmp/_longjmp
53 .if ${MACHINE_ARCH} == "x86_64"
54 .PATH:  ${.CURDIR}/i386
55 .else
56 .endif
57 # really only required for i386
58 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
59 SRCS+=  _setjmp.S
60
61 # decompression functionality from libbz2
62 BZ2DIR= ${.CURDIR}/../../contrib/bzip2
63 .PATH:  ${BZ2DIR}
64 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
65 SRCS+=  bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
66         bzlib_private.h
67
68 # check your belt - ugly bzip2 stuff ahead
69 .for file in bzlib.c
70 CLEANFILES+=   ${file}
71
72 ${file}: ${BZ2DIR}/${file} ${file}.diff
73         patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
74 .endfor
75
76 .include "../libz/Makefile.stand"
77
78 # io routines
79 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
80         fstat.c close.c lseek.c open.c read.c write.c readdir.c
81
82 # network routines
83 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
84
85 # network info services:
86 SRCS+=  bootp.c rarp.c bootparam.c
87
88 # boot filesystems
89 SRCS+=  ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
90 SRCS+=  netif.c nfs.c
91 SRCS+=  dosfs.c ext2fs.c
92 SRCS+=  splitfs.c
93 SRCS+=  hammer1.c
94 SRCS+=  hammer2.c
95
96 .include <bsd.lib.mk>
97
98 .if ${MACHINE_ARCH} == "x86_64"
99 CFLAGS+= -I${.CURDIR}
100 .endif