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"
22 CFLAGS+= -mpreferred-stack-boundary=2
26 .if ${MACHINE_ARCH} == "x86_64"
30 # standalone components and stuff we have modified locally
31 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
32 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
33 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
35 # private (pruned) versions of libc string functions
38 # string functions from libc
39 .PATH: ${.CURDIR}/../libc/string
40 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
41 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
42 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
43 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
44 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
46 .PATH: ${.CURDIR}/../libc/quad
47 .if ${MACHINE_ARCH} == "i386"
51 .PATH: ${.CURDIR}/../../sys/libkern
55 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
56 .PATH: ${.CURDIR}/i386
59 # really only required for i386
60 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
63 # decompression functionality from libbz2
64 BZ2DIR= ${.CURDIR}/../../contrib/bzip2
66 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
67 SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
70 # check your belt - ugly bzip2 stuff ahead
74 ${file}: ${BZ2DIR}/${file} ${file}.diff
75 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
78 .include "../libz/Makefile.stand"
81 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
82 fstat.c close.c lseek.c open.c read.c write.c readdir.c
85 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
87 # network info services:
88 SRCS+= bootp.c rarp.c bootparam.c
91 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
93 SRCS+= dosfs.c ext2fs.c
100 .if ${MACHINE_ARCH} == "x86_64"
101 CFLAGS+= -I${.OBJDIR}
103 beforedepend ${OBJS}: machine cpu
107 ${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/* machine
108 ${LN} -fs ${.CURDIR}/../../sys/platform/pc32/include/* machine
111 ${LN} -hfs ${.CURDIR}/../../sys/cpu/i386/include cpu
113 CLEANDIRS+= machine cpu