]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libstand/Makefile
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 -mno-sse3 -msoft-float
26 .endif
27 .if ${MACHINE} == "pc98"
28 CFLAGS+=        -Os
29 .endif
30 .if ${MACHINE_CPUARCH} == "powerpc"
31 CFLAGS+=        -msoft-float -D_STANDALONE -DNETIF_DEBUG
32 .endif
33 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
34 CFLAGS+=        -m32 -I.
35 .endif
36 .if ${MACHINE_CPUARCH} == "arm"
37 CFLAGS+=        -msoft-float -D_STANDALONE
38 .endif
39
40 # standalone components and stuff we have modified locally
41 SRCS+=  gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
42         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
43         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
44
45 # private (pruned) versions of libc string functions
46 SRCS+=  strcasecmp.c
47
48 .PATH: ${.CURDIR}/../libc/net
49
50 SRCS+= ntoh.c
51
52 # string functions from libc
53 .PATH: ${.CURDIR}/../libc/string
54 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \
55         ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \
56         ${MACHINE_CPUARCH} == "arm"
57 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
58         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
59         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
60         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
61 .endif
62 .if ${MACHINE_CPUARCH} == "arm"
63 .PATH: ${.CURDIR}/../libc/arm/gen
64 SRCS+= divsi3.S
65 .endif
66 .if ${MACHINE_CPUARCH} == "ia64"
67 .PATH: ${.CURDIR}/../libc/ia64/string
68 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
69         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
70         strcmp.c strcpy.c strcspn.c strlen.c \
71         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
72         strspn.c strstr.c strtok.c swab.c
73
74 .PATH: ${.CURDIR}/../libc/ia64/gen
75 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
76 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
77 .endif
78 .if ${MACHINE_CPUARCH} == "powerpc"
79 .PATH: ${.CURDIR}/../libc/quad
80 SRCS+=  ashldi3.c ashrdi3.c
81 .PATH: ${.CURDIR}/../libc/powerpc/gen
82 SRCS+=  syncicache.c
83 .endif
84
85 # uuid functions from libc
86 .PATH: ${.CURDIR}/../libc/uuid
87 SRCS+= uuid_equal.c uuid_is_nil.c
88
89 # _setjmp/_longjmp
90 .if ${MACHINE_CPUARCH} == "amd64"
91 .PATH: ${.CURDIR}/i386
92 .elif ${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
161 .include <bsd.lib.mk>
162
163 .if ${MACHINE_CPUARCH} == "amd64"
164 beforedepend ${OBJS}: machine
165 cleandepend: cleanmachine
166 cleanmachine:
167         rm -f machine
168
169 machine:
170         ln -s ${.CURDIR}/../../sys/i386/include machine
171 .endif