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 $
6 # - We don't use the libc strerror/sys_errlist because the string table is
18 LIBSTAND_SRC?= ${.CURDIR}
19 LIBSTAND_ARCH?= ${MACHINE_ARCH}
21 # Mostly OK, some of the libc imports are a bit noisy
22 CFLAGS+= -ffreestanding
24 .if ${LIBSTAND_ARCH} == "x86_64"
25 CFLAGS+= -mno-red-zone -fPIC
28 .if ${LIBSTAND_ARCH} == "i386"
30 CFLAGS+= -mpreferred-stack-boundary=2
36 .if ${LIBSTAND_ARCH} == "i386" || ${LIBSTAND_ARCH} == "x86_64"
37 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
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
45 # private (pruned) versions of libc string functions
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
56 .PATH: ${LIBSTAND_SRC}/../../sys/libkern
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}
67 # decompression functionality from libbz2
68 BZ2DIR= ${LIBSTAND_SRC}/../../contrib/bzip2
70 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
71 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
74 # check your belt - ugly bzip2 stuff ahead
78 ${file}: ${BZ2DIR}/${file} ${file}.diff
79 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
82 .include "../libz/Makefile.stand"
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
89 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
91 # network info services:
92 SRCS+= bootp.c rarp.c bootparam.c
95 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
97 SRCS+= dosfs.c ext2fs.c
102 .include <bsd.lib.mk>