]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
This commit was generated by cvs2svn to compensate for changes in r98121,
[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 NOPROFILE=      YES
11 NOPIC=          YES
12 INCS=           stand.h
13 MAN=            libstand.3
14
15 CFLAGS+= -ffreestanding
16
17 .if ${MACHINE_ARCH} == "alpha"
18 CFLAGS+=        -mno-fp-regs
19 .endif
20 .if ${MACHINE_ARCH} == "i386"
21 CFLAGS+=        -mpreferred-stack-boundary=2
22 .endif
23 .if ${MACHINE_ARCH} == "powerpc"
24 CFLAGS+=        -msoft-float
25 .endif
26
27 # standalone components and stuff we have modified locally
28 SRCS+=  __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
29         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
30         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
31
32 # private (pruned) versions of libc string functions
33 SRCS+=  strcasecmp.c
34
35 # byte order functions from libc
36 .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/net
37 SRCS+= htons.S ntohs.S htonl.S ntohl.S
38
39 # string functions from libc
40 .PATH:  ${.CURDIR}/../libc/string
41 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
42         ${MACHINE_ARCH} == "sparc64"
43 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
44         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
45         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
46         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
47 .endif
48 .if ${MACHINE_ARCH} == "alpha"
49 .PATH: ${.CURDIR}/../libc/alpha/string
50 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
51         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
52         strcmp.c strcpy.c strcspn.c strlen.c \
53         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
54         strspn.c strstr.c strtok.c swab.c
55
56 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
57 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
58
59 CLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
60 CLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
61
62
63 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
64         m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
65                 ${.ALLSRC} > ${.TARGET}
66
67 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
68         m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
69                 ${.ALLSRC} > ${.TARGET}
70
71 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
72         m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
73                 ${.ALLSRC} > ${.TARGET}
74
75 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
76         m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
77                 ${.ALLSRC} > ${.TARGET}
78
79 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
80         m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
81                 ${.ALLSRC} > ${.TARGET}
82
83 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
84         m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
85                 ${.ALLSRC} > ${.TARGET}
86
87 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
88         m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
89                 ${.ALLSRC} > ${.TARGET}
90
91 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
92         m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
93                 ${.ALLSRC} > ${.TARGET}
94 .endif
95 .if ${MACHINE_ARCH} == "ia64"
96 .PATH: ${.CURDIR}/../libc/ia64/string
97 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
98         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
99         strcmp.c strcpy.c strcspn.c strlen.c \
100         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
101         strspn.c strstr.c strtok.c swab.c
102
103 .PATH: ${.CURDIR}/../libc/ia64/gen
104 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
105 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
106 .endif
107
108 # _setjmp/_longjmp
109 .PATH:  ${.CURDIR}/${MACHINE_ARCH}
110 SRCS+=  _setjmp.S
111
112 # decompression functionality from libbz2
113 .PATH:  ${.CURDIR}/../../contrib/bzip2
114 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
115 SRCS+=  _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
116         _bzlib_private.h
117
118 # check your belt - ugly bzip2 stuff ahead
119 .for file in bzlib.c bzlib.h bzlib_private.h
120 CLEANFILES+=   _${file} _${file}.orig
121
122 _${file}: ${file} ${file}.diff
123         patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
124 .endfor
125
126 .for file in crctable.c decompress.c huffman.c randtable.c
127 CLEANFILES+=    _${file}
128
129 _${file}: ${file}
130         sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
131 .endfor
132
133 # decompression functionality from libz
134 .PATH:  ${.CURDIR}/../libz
135 CFLAGS+=-DHAVE_MEMCPY
136 SRCS+=  adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
137         inftrees.c infutil.c zutil.c 
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 zipfs.c bzipfs.c
151 SRCS+=  netif.c nfs.c
152 SRCS+=  dosfs.c ext2fs.c
153 SRCS+=  splitfs.c
154
155 .include <bsd.lib.mk>