Ignore machine-check MSRs
[freebsd-src/fkvm-freebsd.git] / lib / libstand / Makefile
blob18f4add9553245ae2dbda6d37fb9b0c5e3689978
1 # $FreeBSD$
2 # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4 # Notes:
5 # - We don't use the libc strerror/sys_errlist because the string table is
6 # quite large.
9 LIB= stand
10 NO_PROFILE=
11 NO_PIC=
12 INCS= stand.h
13 MAN= libstand.3
15 WITHOUT_SSP=
16 CFLAGS+= -ffreestanding -Wformat
17 CFLAGS+= -I${.CURDIR}
19 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
20 CFLAGS+= -mpreferred-stack-boundary=2
21 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
22 .endif
23 .if ${MACHINE_ARCH} == "i386"
24 CFLAGS+= -mno-sse3
25 .endif
26 .if ${MACHINE} == "pc98"
27 CFLAGS+= -Os
28 .endif
29 .if ${MACHINE_ARCH} == "powerpc"
30 CFLAGS+= -msoft-float -D_STANDALONE
31 .endif
32 .if ${MACHINE_ARCH} == "amd64"
33 CFLAGS+= -m32 -I.
34 .endif
36 # standalone components and stuff we have modified locally
37 SRCS+= zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
38 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
39 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
41 # private (pruned) versions of libc string functions
42 SRCS+= strcasecmp.c
44 .PATH: ${.CURDIR}/../libc/net
46 SRCS+= ntoh.c
48 # string functions from libc
49 .PATH: ${.CURDIR}/../libc/string
50 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
51 ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "amd64"
52 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
53 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
54 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
55 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
56 .endif
57 .if ${MACHINE_ARCH} == "ia64"
58 .PATH: ${.CURDIR}/../libc/ia64/string
59 SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
60 memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
61 strcmp.c strcpy.c strcspn.c strlen.c \
62 strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
63 strspn.c strstr.c strtok.c swab.c
65 .PATH: ${.CURDIR}/../libc/ia64/gen
66 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
67 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
68 .endif
69 .if ${MACHINE_ARCH} == "powerpc"
70 .PATH: ${.CURDIR}/../libc/quad
71 SRCS+= ashldi3.c ashrdi3.c
72 .PATH: ${.CURDIR}/../libc/powerpc/gen
73 SRCS+= syncicache.c
74 .endif
76 # uuid functions from libc
77 .PATH: ${.CURDIR}/../libc/uuid
78 SRCS+= uuid_equal.c uuid_is_nil.c
80 # _setjmp/_longjmp
81 .if ${MACHINE_ARCH} == "amd64"
82 .PATH: ${.CURDIR}/i386
83 .else
84 .PATH: ${.CURDIR}/${MACHINE_ARCH}
85 .endif
86 SRCS+= _setjmp.S
88 # decompression functionality from libbz2
89 # NOTE: to actually test this functionality after libbz2 upgrade compile
90 # loader(8) with LOADER_BZIP2_SUPPORT defined
91 .PATH: ${.CURDIR}/../../contrib/bzip2
92 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
93 SRCS+= libstand_bzlib_private.h
95 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
96 SRCS+= _${file}
97 CLEANFILES+= _${file}
99 _${file}: ${file}
100 sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
101 .endfor
103 CLEANFILES+= libstand_bzlib_private.h
104 libstand_bzlib_private.h: bzlib_private.h
105 sed -e 's|<stdlib.h>|"stand.h"|' \
106 ${.ALLSRC} > ${.TARGET}
108 # decompression functionality from libz
109 .PATH: ${.CURDIR}/../libz
110 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
111 SRCS+= adler32.c crc32.c libstand_zutil.h
113 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
114 SRCS+= _${file}
115 CLEANFILES+= _${file}
117 _${file}: ${file}
118 sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
119 .endfor
121 # depend on stand.h being able to be included multiple times
122 CLEANFILES+= libstand_zutil.h
123 libstand_zutil.h: zutil.h
124 sed -e 's|<stddef.h>|"stand.h"|' \
125 -e 's|<string.h>|"stand.h"|' \
126 -e 's|<stdlib.h>|"stand.h"|' \
127 ${.ALLSRC} > ${.TARGET}
129 # io routines
130 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
131 fstat.c close.c lseek.c open.c read.c write.c readdir.c
133 # network routines
134 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
136 # network info services:
137 SRCS+= bootp.c rarp.c bootparam.c
139 # boot filesystems
140 SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
141 SRCS+= dosfs.c ext2fs.c
142 SRCS+= splitfs.c
144 .include <bsd.lib.mk>
146 .if ${MACHINE_ARCH} == "amd64"
147 beforedepend ${OBJS}: machine
148 cleandepend: cleanmachine
149 cleanmachine:
150 rm -f machine
152 machine:
153 ln -s ${.CURDIR}/../../sys/i386/include machine
154 .endif