]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
Vendor import of gdtoa 20081205.
[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 WITHOUT_SSP=
16 CFLAGS+= -ffreestanding -Wformat
17 CFLAGS+= -I${.CURDIR}
18
19 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
20 CFLAGS+=        -mpreferred-stack-boundary=2
21 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2
22 .endif
23 .if ${MACHINE_ARCH} == "i386"
24 CFLAGS+=        -mno-sse3
25 .endif
26 .if ${MACHINE} == "pc98"
27 CFLAGS+=        -Os
28 .endif
29 .if ${MACHINE_ARCH} == "powerpc"
30 CFLAGS+=        -msoft-float -D_STANDALONE
31 .endif
32 .if ${MACHINE_ARCH} == "amd64"
33 CFLAGS+=        -m32 -I.
34 .endif
35 .if ${MACHINE_ARCH} == "arm"
36 CFLAGS+=        -msoft-float -DSOFTFLOAT -D_STANDALONE
37 .endif
38
39 # standalone components and stuff we have modified locally
40 SRCS+=  zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
41         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
42         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
43
44 # private (pruned) versions of libc string functions
45 SRCS+=  strcasecmp.c
46
47 .PATH: ${.CURDIR}/../libc/net
48
49 SRCS+= ntoh.c
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         ${MACHINE_ARCH} == "arm"
56 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
57         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
58         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
59         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
60 .endif
61 .if ${MACHINE_ARCH} == "arm"
62 .PATH: ${.CURDIR}/../libc/arm/gen
63 SRCS+= divsi3.S
64 .endif
65 .if ${MACHINE_ARCH} == "ia64"
66 .PATH: ${.CURDIR}/../libc/ia64/string
67 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
68         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
69         strcmp.c strcpy.c strcspn.c strlen.c \
70         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
71         strspn.c strstr.c strtok.c swab.c
72
73 .PATH: ${.CURDIR}/../libc/ia64/gen
74 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
75 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
76 .endif
77 .if ${MACHINE_ARCH} == "powerpc"
78 .PATH: ${.CURDIR}/../libc/quad
79 SRCS+=  ashldi3.c ashrdi3.c
80 .PATH: ${.CURDIR}/../libc/powerpc/gen
81 SRCS+=  syncicache.c
82 .endif
83
84 # uuid functions from libc
85 .PATH: ${.CURDIR}/../libc/uuid
86 SRCS+= uuid_equal.c uuid_is_nil.c
87
88 # _setjmp/_longjmp
89 .if ${MACHINE_ARCH} == "amd64"
90 .PATH: ${.CURDIR}/i386
91 .else
92 .PATH: ${.CURDIR}/${MACHINE_ARCH}
93 .endif
94 SRCS+=  _setjmp.S
95
96 # decompression functionality from libbz2
97 # NOTE: to actually test this functionality after libbz2 upgrade compile
98 # loader(8) with LOADER_BZIP2_SUPPORT defined
99 .PATH: ${.CURDIR}/../../contrib/bzip2
100 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
101 SRCS+=  libstand_bzlib_private.h
102
103 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
104 SRCS+=  _${file}
105 CLEANFILES+=    _${file}
106
107 _${file}: ${file}
108         sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
109 .endfor
110
111 CLEANFILES+= libstand_bzlib_private.h
112 libstand_bzlib_private.h: bzlib_private.h
113         sed -e 's|<stdlib.h>|"stand.h"|' \
114                 ${.ALLSRC} > ${.TARGET}
115
116 # decompression functionality from libz
117 .PATH: ${.CURDIR}/../libz
118 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
119 SRCS+=  adler32.c crc32.c libstand_zutil.h
120
121 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
122 SRCS+=  _${file}
123 CLEANFILES+=    _${file}
124
125 _${file}: ${file}
126         sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
127 .endfor
128
129 # depend on stand.h being able to be included multiple times
130 CLEANFILES+= libstand_zutil.h
131 libstand_zutil.h: zutil.h
132         sed -e 's|<stddef.h>|"stand.h"|' \
133             -e 's|<string.h>|"stand.h"|' \
134             -e 's|<stdlib.h>|"stand.h"|' \
135             ${.ALLSRC} > ${.TARGET}
136
137 # io routines
138 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
139         fstat.c close.c lseek.c open.c read.c write.c readdir.c
140
141 # network routines
142 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
143
144 # network info services:
145 SRCS+=  bootp.c rarp.c bootparam.c
146
147 # boot filesystems
148 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
149 SRCS+=  dosfs.c ext2fs.c
150 SRCS+=  splitfs.c
151
152 .include <bsd.lib.mk>
153
154 .if ${MACHINE_ARCH} == "amd64"
155 beforedepend ${OBJS}: machine
156 cleandepend: cleanmachine
157 cleanmachine:
158         rm -f machine
159
160 machine:
161         ln -s ${.CURDIR}/../../sys/i386/include machine
162 .endif