1 # $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
2 # $DragonFly: src/lib/libstand/Makefile,v 1.3 2003/11/10 06:14:44 dillon Exp $
4 # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
7 # - We don't use the libc strerror/sys_errlist because the string table is
17 # Mostly OK, some of the libc imports are a bit noisy
20 .if ${MACHINE_ARCH} == "alpha"
23 .if ${MACHINE_ARCH} == "i386"
24 CFLAGS+= -mpreferred-stack-boundary=2
28 # standalone components and stuff we have modified locally
29 SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
30 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
31 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
33 # private (pruned) versions of libc string functions
36 # string functions from libc
37 .PATH: ${.CURDIR}/../libc/string
38 .if ${MACHINE_ARCH} == "i386"
39 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
40 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
41 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
42 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
44 .PATH: ${.CURDIR}/../libc/quad
45 .if ${MACHINE_ARCH} == "i386"
48 .if ${MACHINE_ARCH} == "alpha"
49 .PATH: ${.CURDIR}/../libc/alpha/string
50 SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
51 memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
52 strcmp.c strcpy.c strcspn.c strlen.c \
53 strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
54 strspn.c strstr.c strtok.c swab.c
56 .PATH: ${.CURDIR}/../libc/alpha/net
57 SRCS+= htons.S ntohs.S htonl.S ntohl.S
59 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
60 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
62 CLEANFILES+= __divqu.S __divq.S __divlu.S __divl.S
63 CLEANFILES+= __remqu.S __remq.S __remlu.S __reml.S
66 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
67 m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
68 ${.ALLSRC} > ${.TARGET}
70 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
71 m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
72 ${.ALLSRC} > ${.TARGET}
74 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
75 m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
76 ${.ALLSRC} > ${.TARGET}
78 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
79 m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
80 ${.ALLSRC} > ${.TARGET}
82 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
83 m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
84 ${.ALLSRC} > ${.TARGET}
86 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
87 m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
88 ${.ALLSRC} > ${.TARGET}
90 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
91 m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
92 ${.ALLSRC} > ${.TARGET}
94 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
95 m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
96 ${.ALLSRC} > ${.TARGET}
100 .PATH: ${.CURDIR}/${MACHINE_ARCH}
102 # really only required for i386
103 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
105 # decompression functionality from libbz2
106 .PATH: ${.CURDIR}/../../contrib/bzip2
107 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
108 SRCS+= _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
111 # check your belt - ugly bzip2 stuff ahead
112 .for file in bzlib.c bzlib.h bzlib_private.h
113 CLEANFILES+= _${file} _${file}.orig
115 _${file}: ${file} ${file}.diff
116 patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
119 .for file in crctable.c decompress.c huffman.c randtable.c
120 CLEANFILES+= _${file}
123 sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
126 # decompression functionality from libz
127 .PATH: ${.CURDIR}/../libz
128 CFLAGS+=-DHAVE_MEMCPY
129 SRCS+= adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
130 inftrees.c infutil.c zutil.c
133 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
134 fstat.c close.c lseek.c open.c read.c write.c readdir.c
137 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
139 # network info services:
140 SRCS+= bootp.c rarp.c bootparam.c
143 SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
145 SRCS+= dosfs.c ext2fs.c
148 .include <bsd.lib.mk>