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