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