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