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