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
19 LIBSTAND_SRC?= ${.CURDIR}
20 LIBSTAND_ARCH?= ${MACHINE_ARCH}
22 # Mostly OK, some of the libc imports are a bit noisy
23 CFLAGS+= -ffreestanding
25 .if ${LIBSTAND_ARCH} == "x86_64"
26 CFLAGS+= -mno-red-zone -fPIC
29 .if ${LIBSTAND_ARCH} == "i386"
31 CFLAGS+= -mpreferred-stack-boundary=2
37 .if ${LIBSTAND_ARCH} == "i386" || ${LIBSTAND_ARCH} == "x86_64"
38 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
41 # standalone components and stuff we have modified locally
42 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
43 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
44 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
46 # private (pruned) versions of libc string functions
49 # string functions from libc
50 .PATH: ${LIBSTAND_SRC}/../libc/string
51 .if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
52 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
53 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
54 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
55 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
57 .PATH: ${LIBSTAND_SRC}/../../sys/libkern
61 .PATH: ${LIBSTAND_SRC}/${LIBSTAND_ARCH}
62 .if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
63 # really only required for i386
64 CFLAGS+=-I${LIBSTAND_SRC}/../libc/${MACHINE_ARCH}
68 # decompression functionality from libbz2
69 BZ2DIR= ${LIBSTAND_SRC}/../../contrib/bzip2
71 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
72 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
75 # check your belt - ugly bzip2 stuff ahead
79 ${file}: ${BZ2DIR}/${file} ${file}.diff
80 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
83 .include "../libz/Makefile.stand"
86 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
87 fstat.c close.c lseek.c open.c read.c write.c readdir.c
90 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
92 # network info services:
93 SRCS+= bootp.c rarp.c bootparam.c
96 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
98 SRCS+= dosfs.c ext2fs.c
103 .include <bsd.lib.mk>