]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
Improve the Xen para-virtualized device infrastructure of FreeBSD:
[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_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
24 CFLAGS+=        -mpreferred-stack-boundary=2
25 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2
26 .endif
27 .if ${MACHINE_CPUARCH} == "i386"
28 CFLAGS+=        -mno-sse3
29 .endif
30 .if ${MACHINE} == "pc98"
31 CFLAGS+=        -Os
32 .endif
33 .if ${MACHINE_CPUARCH} == "powerpc"
34 CFLAGS+=        -msoft-float -D_STANDALONE -DNETIF_DEBUG
35 .endif
36 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
37 CFLAGS+=        -m32 -I.
38 .endif
39 .if ${MACHINE_CPUARCH} == "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_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \
58         ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \
59         ${MACHINE_CPUARCH} == "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_CPUARCH} == "arm"
66 .PATH: ${.CURDIR}/../libc/arm/gen
67 SRCS+= divsi3.S
68 .endif
69 .if ${MACHINE_CPUARCH} == "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_CPUARCH} == "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_CPUARCH} == "amd64"
94 .PATH: ${.CURDIR}/i386
95 .elif ${MACHINE_ARCH} == "powerpc64"
96 .PATH: ${.CURDIR}/powerpc
97 .else
98 .PATH: ${.CURDIR}/${MACHINE_CPUARCH}
99 .endif
100 SRCS+=  _setjmp.S
101
102 # decompression functionality from libbz2
103 # NOTE: to actually test this functionality after libbz2 upgrade compile
104 # loader(8) with LOADER_BZIP2_SUPPORT defined
105 .PATH: ${.CURDIR}/../../contrib/bzip2
106 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
107 SRCS+=  libstand_bzlib_private.h
108
109 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
110 SRCS+=  _${file}
111 CLEANFILES+=    _${file}
112
113 _${file}: ${file}
114         sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
115 .endfor
116
117 CLEANFILES+= libstand_bzlib_private.h
118 libstand_bzlib_private.h: bzlib_private.h
119         sed -e 's|<stdlib.h>|"stand.h"|' \
120                 ${.ALLSRC} > ${.TARGET}
121
122 # decompression functionality from libz
123 .PATH: ${.CURDIR}/../libz
124 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
125 SRCS+=  adler32.c crc32.c libstand_zutil.h
126
127 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
128 SRCS+=  _${file}
129 CLEANFILES+=    _${file}
130
131 _${file}: ${file}
132         sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
133 .endfor
134
135 # depend on stand.h being able to be included multiple times
136 CLEANFILES+= libstand_zutil.h
137 libstand_zutil.h: zutil.h
138         sed -e 's|<stddef.h>|"stand.h"|' \
139             -e 's|<string.h>|"stand.h"|' \
140             -e 's|<stdlib.h>|"stand.h"|' \
141             ${.ALLSRC} > ${.TARGET}
142
143 # io routines
144 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
145         fstat.c close.c lseek.c open.c read.c write.c readdir.c
146
147 # network routines
148 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
149
150 # network info services:
151 SRCS+=  bootp.c rarp.c bootparam.c
152
153 # boot filesystems
154 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
155 SRCS+=  dosfs.c ext2fs.c
156 SRCS+=  splitfs.c
157
158 .include <bsd.lib.mk>
159
160 .if ${MACHINE_CPUARCH} == "amd64"
161 beforedepend ${OBJS}: machine
162 cleandepend: cleanmachine
163 cleanmachine:
164         rm -f machine
165
166 machine:
167         ln -s ${.CURDIR}/../../sys/i386/include machine
168 .endif