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 # Mostly OK, some of the libc imports are a bit noisy
19 CFLAGS+= -ffreestanding
21 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
23 CFLAGS+= -mpreferred-stack-boundary=2
25 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
29 .if ${MACHINE_ARCH} == "x86_64"
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
38 # private (pruned) versions of libc string functions
41 # string functions from libc
42 .PATH: ${.CURDIR}/../libc/string
43 .if ${MACHINE_ARCH} == "i386" || ${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
49 .PATH: ${.CURDIR}/../libc/quad
50 .if ${MACHINE_ARCH} == "i386"
54 .PATH: ${.CURDIR}/../../sys/libkern
58 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
59 .PATH: ${.CURDIR}/i386
62 # really only required for i386
63 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
66 # decompression functionality from libbz2
67 BZ2DIR= ${.CURDIR}/../../contrib/bzip2
69 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
70 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
73 # check your belt - ugly bzip2 stuff ahead
77 ${file}: ${BZ2DIR}/${file} ${file}.diff
78 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
81 .include "../libz/Makefile.stand"
84 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
85 fstat.c close.c lseek.c open.c read.c write.c readdir.c
88 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
90 # network info services:
91 SRCS+= bootp.c rarp.c bootparam.c
94 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
96 SRCS+= dosfs.c ext2fs.c
101 .include <bsd.lib.mk>
103 .if ${MACHINE_ARCH} == "x86_64"
104 CFLAGS+= -I${.OBJDIR}
106 beforedepend ${OBJS}: machine cpu
110 ${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/* machine
111 ${LN} -fs ${.CURDIR}/../../sys/platform/pc32/include/* machine
114 ${LN} -hfs ${.CURDIR}/../../sys/cpu/i386/include cpu
116 CLEANDIRS+= machine cpu