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