]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
This commit was generated by cvs2svn to compensate for changes in r133936,
[FreeBSD/FreeBSD.git] / lib / libstand / Makefile
1 # $FreeBSD$
2 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
3 #
4 # Notes:
5 # - We don't use the libc strerror/sys_errlist because the string table is
6 #   quite large.
7 #
8
9 LIB=            stand
10 NOPROFILE=      YES
11 NOPIC=          YES
12 INCS=           stand.h
13 MAN=            libstand.3
14
15 CFLAGS+= -ffreestanding -Wformat
16 CFLAGS+= -I${.CURDIR}
17
18 .if ${MACHINE_ARCH} == "alpha"
19 CFLAGS+=        -mno-fp-regs
20 .endif
21 .if ${MACHINE_ARCH} == "i386"
22 CFLAGS+=        -mpreferred-stack-boundary=2
23 .endif
24 .if ${MACHINE_ARCH} == "powerpc"
25 CFLAGS+=        -msoft-float -D_STANDALONE
26 .endif
27 .if ${MACHINE_ARCH} == "amd64"
28 CFLAGS+=        -m32
29 .endif
30
31 # standalone components and stuff we have modified locally
32 SRCS+=  zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
33         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
34         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
35
36 # private (pruned) versions of libc string functions
37 SRCS+=  strcasecmp.c
38
39 # byte order functions from libc
40 .if ${MACHINE_ARCH} != "amd64"
41 .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/net
42 .else
43 .PATH: ${.CURDIR}/../libc/i386/net
44 .endif
45 SRCS+= htons.S ntohs.S htonl.S ntohl.S
46
47 # string functions from libc
48 .PATH:  ${.CURDIR}/../libc/string
49 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
50         ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "amd64"
51 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
52         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
53         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
54         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
55 .endif
56 .if ${MACHINE_ARCH} == "alpha"
57 .PATH: ${.CURDIR}/../libc/alpha/string
58 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
59         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
60         strcmp.c strcpy.c strcspn.c strlen.c \
61         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
62         strspn.c strstr.c strtok.c swab.c
63
64 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
65 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
66
67 CLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
68 CLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
69
70
71 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
72         m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
73                 ${.ALLSRC} > ${.TARGET}
74
75 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
76         m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
77                 ${.ALLSRC} > ${.TARGET}
78
79 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
80         m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
81                 ${.ALLSRC} > ${.TARGET}
82
83 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
84         m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
85                 ${.ALLSRC} > ${.TARGET}
86
87 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
88         m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
89                 ${.ALLSRC} > ${.TARGET}
90
91 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
92         m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
93                 ${.ALLSRC} > ${.TARGET}
94
95 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
96         m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
97                 ${.ALLSRC} > ${.TARGET}
98
99 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
100         m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
101                 ${.ALLSRC} > ${.TARGET}
102 .endif
103 .if ${MACHINE_ARCH} == "ia64"
104 .PATH: ${.CURDIR}/../libc/ia64/string
105 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
106         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
107         strcmp.c strcpy.c strcspn.c strlen.c \
108         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
109         strspn.c strstr.c strtok.c swab.c
110
111 .PATH: ${.CURDIR}/../libc/ia64/gen
112 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
113 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
114 .endif
115 .if ${MACHINE_ARCH} == "powerpc"
116 .PATH: ${.CURDIR}/../libc/quad
117 SRCS+=  ashldi3.c ashrdi3.c
118 .PATH: ${.CURDIR}/../libc/powerpc/gen
119 SRCS+=  syncicache.c
120 .endif
121
122 # _setjmp/_longjmp
123 .if ${MACHINE_ARCH} == "amd64"
124 .PATH:  ${.CURDIR}/i386
125 .else
126 .PATH:  ${.CURDIR}/${MACHINE_ARCH}
127 .endif
128 SRCS+=  _setjmp.S
129
130 # decompression functionality from libbz2
131 .PATH:  ${.CURDIR}/../../contrib/bzip2
132 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
133 SRCS+=  _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
134         _bzlib_private.h
135
136 # check your belt - ugly bzip2 stuff ahead
137 .for file in bzlib.c bzlib.h bzlib_private.h
138 CLEANFILES+=   _${file} _${file}.orig
139
140 _${file}: ${file} ${file}.diff
141         patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
142 .endfor
143
144 .for file in crctable.c decompress.c huffman.c randtable.c
145 CLEANFILES+=    _${file}
146
147 _${file}: ${file}
148         sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
149 .endfor
150
151 # decompression functionality from libz
152 .PATH:  ${.CURDIR}/../libz
153 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
154 SRCS+=  adler32.c crc32.c _infback.c _inffast.c _inflate.c \
155         _inftrees.c _zutil.c _zutil.h
156
157 # aargh
158 .for file in zutil.h
159 CLEANFILES+=    _${file} _${file}.orig
160
161 _${file}: ${file} ${file}.diff
162         patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
163 .endfor
164
165 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
166 CLEANFILES+=    _${file}
167
168 _${file}: ${file}
169         sed "s|zutil\.h|_zutil.h|" ${.ALLSRC} > ${.TARGET}
170 .endfor
171
172 # io routines
173 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
174         fstat.c close.c lseek.c open.c read.c write.c readdir.c
175
176 # network routines
177 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
178
179 # network info services:
180 SRCS+=  bootp.c rarp.c bootparam.c
181
182 # boot filesystems
183 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
184 SRCS+=  dosfs.c ext2fs.c
185 SRCS+=  splitfs.c
186
187 .include <bsd.lib.mk>
188
189 .if ${MACHINE_ARCH} == "amd64"
190 ${SRCS:M*.c:R:S/$/.o/g}:        machine
191
192 beforedepend:   machine
193
194 machine:
195         ln -s ${.CURDIR}/../../sys/i386/include machine
196 .endif