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
16 # Mostly OK, some of the libc imports are a bit noisy
19 .if ${MACHINE_ARCH} == "alpha"
22 .if ${MACHINE_ARCH} == "i386"
23 CFLAGS+= -mpreferred-stack-boundary=2
27 # standalone components and stuff we have modified locally
28 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
29 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
30 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
32 # private (pruned) versions of libc string functions
35 # string functions from libc
36 .PATH: ${.CURDIR}/../libc/string
37 .if ${MACHINE_ARCH} == "i386"
38 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
39 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
40 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
41 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
43 .if ${MACHINE_ARCH} == "alpha"
44 .PATH: ${.CURDIR}/../libc/alpha/string
45 SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
46 memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
47 strcmp.c strcpy.c strcspn.c strlen.c \
48 strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
49 strspn.c strstr.c strtok.c swab.c
51 .PATH: ${.CURDIR}/../libc/alpha/net
52 SRCS+= htons.S ntohs.S htonl.S ntohl.S
54 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
55 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
57 CLEANFILES+= __divqu.S __divq.S __divlu.S __divl.S
58 CLEANFILES+= __remqu.S __remq.S __remlu.S __reml.S
61 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
62 m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
63 ${.ALLSRC} > ${.TARGET}
65 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
66 m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
67 ${.ALLSRC} > ${.TARGET}
69 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
70 m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
71 ${.ALLSRC} > ${.TARGET}
73 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
74 m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
75 ${.ALLSRC} > ${.TARGET}
77 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
78 m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
79 ${.ALLSRC} > ${.TARGET}
81 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
82 m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
83 ${.ALLSRC} > ${.TARGET}
85 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
86 m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
87 ${.ALLSRC} > ${.TARGET}
89 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
90 m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
91 ${.ALLSRC} > ${.TARGET}
95 .PATH: ${.CURDIR}/${MACHINE_ARCH}
97 # really only required for i386
98 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
100 # decompression functionality from libbz2
101 .PATH: ${.CURDIR}/../../contrib/bzip2
102 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
103 SRCS+= _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
106 # check your belt - ugly bzip2 stuff ahead
107 .for file in bzlib.c bzlib.h bzlib_private.h
108 CLEANFILES+= _${file} _${file}.orig
110 _${file}: ${file} ${file}.diff
111 patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
114 .for file in crctable.c decompress.c huffman.c randtable.c
115 CLEANFILES+= _${file}
118 sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
121 # decompression functionality from libz
122 .PATH: ${.CURDIR}/../libz
123 CFLAGS+=-DHAVE_MEMCPY
124 SRCS+= adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
125 inftrees.c infutil.c zutil.c
128 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
129 fstat.c close.c lseek.c open.c read.c write.c readdir.c
132 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
134 # network info services:
135 SRCS+= bootp.c rarp.c bootparam.c
138 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c
140 SRCS+= dosfs.c ext2fs.c
143 .include <bsd.lib.mk>