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