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