Fully synchronize sys/boot from FreeBSD-5.x, but add / to the module path
[dragonfly.git] / lib / libstand / Makefile
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 $
3 #
4 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
5 #
6 # Notes:
7 # - We don't use the libc strerror/sys_errlist because the string table is
8 #   quite large.
9 #
10
11 LIB=            stand
12 NOPROFILE=      YES
13 NOPIC=          YES
14 INCS=           stand.h
15 MAN=            libstand.3
16
17 # Mostly OK, some of the libc imports are a bit noisy
18 CFLAGS+=        -Wall
19
20 .if ${MACHINE_ARCH} == "alpha"
21 CFLAGS+=        -mno-fp-regs
22 .endif
23 .if ${MACHINE_ARCH} == "i386"
24 CFLAGS+=        -mpreferred-stack-boundary=2
25 .endif
26
27
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
32
33 # private (pruned) versions of libc string functions
34 SRCS+=  strcasecmp.c
35
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
43 .endif
44 .PATH:  ${.CURDIR}/../libc/quad
45 .if ${MACHINE_ARCH} == "i386"
46 SRCS+=  ucmpdi2.c
47 .endif
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
55
56 .PATH: ${.CURDIR}/../libc/alpha/net
57 SRCS+= htons.S ntohs.S htonl.S ntohl.S
58
59 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
60 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
61
62 CLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
63 CLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
64
65
66 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
67         m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
68                 ${.ALLSRC} > ${.TARGET}
69
70 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
71         m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
72                 ${.ALLSRC} > ${.TARGET}
73
74 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
75         m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
76                 ${.ALLSRC} > ${.TARGET}
77
78 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
79         m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
80                 ${.ALLSRC} > ${.TARGET}
81
82 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
83         m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
84                 ${.ALLSRC} > ${.TARGET}
85
86 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
87         m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
88                 ${.ALLSRC} > ${.TARGET}
89
90 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
91         m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
92                 ${.ALLSRC} > ${.TARGET}
93
94 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
95         m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
96                 ${.ALLSRC} > ${.TARGET}
97 .endif
98
99 # _setjmp/_longjmp
100 .PATH:  ${.CURDIR}/${MACHINE_ARCH}
101 SRCS+=  _setjmp.S
102 # really only required for i386
103 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
104
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 \
109         _bzlib_private.h
110
111 # check your belt - ugly bzip2 stuff ahead
112 .for file in bzlib.c bzlib.h bzlib_private.h
113 CLEANFILES+=   _${file} _${file}.orig
114
115 _${file}: ${file} ${file}.diff
116         patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
117 .endfor
118
119 .for file in crctable.c decompress.c huffman.c randtable.c
120 CLEANFILES+=    _${file}
121
122 _${file}: ${file}
123         sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
124 .endfor
125
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 
131
132 # io routines
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
135
136 # network routines
137 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
138
139 # network info services:
140 SRCS+=  bootp.c rarp.c bootparam.c
141
142 # boot filesystems
143 SRCS+=  ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
144 SRCS+=  netif.c nfs.c
145 SRCS+=  dosfs.c ext2fs.c
146 SRCS+=  splitfs.c
147
148 .include <bsd.lib.mk>