]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
This commit was generated by cvs2svn to compensate for changes in r94209,
[FreeBSD/FreeBSD.git] / lib / libstand / Makefile
1 # $FreeBSD$
2 #
3 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4 #
5 # Notes:
6 # - We don't use the libc strerror/sys_errlist because the string table is
7 #   quite large.
8 #
9
10 LIB=            stand
11 NOPROFILE=      YES
12 NOPIC=          YES
13 MAN=            libstand.3
14
15 # Mostly OK, some of the libc imports are a bit noisy
16 CFLAGS+=        -Wall
17
18 .if ${MACHINE_ARCH} == "alpha"
19 CFLAGS+=        -mno-fp-regs
20 .endif
21 .if ${MACHINE_ARCH} == "i386"
22 CFLAGS+=        -mpreferred-stack-boundary=2
23 .endif
24 .if ${MACHINE_ARCH} == "powerpc"
25 CFLAGS+=        -msoft-float
26 .endif
27
28 # standalone components and stuff we have modified locally
29 SRCS+=  __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
30         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
31         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
32
33 # private (pruned) versions of libc string functions
34 SRCS+=  strcasecmp.c
35
36 # byte order functions from libc
37 .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/net
38 SRCS+= htons.S ntohs.S htonl.S ntohl.S
39
40 # string functions from libc
41 .PATH:  ${.CURDIR}/../libc/string
42 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
43         ${MACHINE_ARCH} == "sparc64"
44 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
45         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
46         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
47         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
48 .endif
49 .if ${MACHINE_ARCH} == "alpha"
50 .PATH: ${.CURDIR}/../libc/alpha/string
51 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
52         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
53         strcmp.c strcpy.c strcspn.c strlen.c \
54         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
55         strspn.c strstr.c strtok.c swab.c
56
57 SRCS+= __divqu.S __divq.S __divlu.S __divl.S
58 SRCS+= __remqu.S __remq.S __remlu.S __reml.S
59
60 CLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
61 CLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
62
63
64 __divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
65         m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
66                 ${.ALLSRC} > ${.TARGET}
67
68 __divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
69         m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
70                 ${.ALLSRC} > ${.TARGET}
71
72 __divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
73         m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
74                 ${.ALLSRC} > ${.TARGET}
75
76 __divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
77         m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
78                 ${.ALLSRC} > ${.TARGET}
79
80 __remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
81         m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
82                 ${.ALLSRC} > ${.TARGET}
83
84 __remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
85         m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
86                 ${.ALLSRC} > ${.TARGET}
87
88 __remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
89         m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
90                 ${.ALLSRC} > ${.TARGET}
91
92 __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
93         m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
94                 ${.ALLSRC} > ${.TARGET}
95 .endif
96 .if ${MACHINE_ARCH} == "ia64"
97 .PATH: ${.CURDIR}/../libc/ia64/string
98 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
99         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
100         strcmp.c strcpy.c strcspn.c strlen.c \
101         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
102         strspn.c strstr.c strtok.c swab.c
103
104 .PATH: ${.CURDIR}/../libc/ia64/gen
105 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
106 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
107 # XXX should be global
108 CFLAGS+= -ffreestanding
109 .endif
110
111 .if ${MACHINE_ARCH} != "sparc64"
112 # _setjmp/_longjmp
113 .PATH:  ${.CURDIR}/${MACHINE_ARCH}
114 SRCS+=  _setjmp.S
115 .endif
116
117 # decompression functionality from libbz2
118 .PATH:  ${.CURDIR}/../../contrib/bzip2
119 CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS
120 SRCS+=  _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \
121         _bzlib_private.h
122
123 # check your belt - ugly bzip2 stuff ahead
124 .for file in bzlib.c bzlib.h bzlib_private.h
125 CLEANFILES+=   _${file} _${file}.orig
126
127 _${file}: ${file} ${file}.diff
128         patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
129 .endfor
130
131 .for file in crctable.c decompress.c huffman.c randtable.c
132 CLEANFILES+=    _${file}
133
134 _${file}: ${file}
135         sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
136 .endfor
137
138 # decompression functionality from libz
139 .PATH:  ${.CURDIR}/../libz
140 CFLAGS+=-DHAVE_MEMCPY
141 SRCS+=  adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
142         inftrees.c infutil.c zutil.c 
143
144 # io routines
145 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
146         fstat.c close.c lseek.c open.c read.c write.c readdir.c
147
148 # network routines
149 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
150
151 # network info services:
152 SRCS+=  bootp.c rarp.c bootparam.c
153
154 # boot filesystems
155 SRCS+=  ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c
156 SRCS+=  netif.c nfs.c
157 SRCS+=  dosfs.c ext2fs.c
158 SRCS+=  splitfs.c
159
160 beforeinstall:
161         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/stand.h \
162                 ${DESTDIR}/usr/include
163
164 .include <bsd.lib.mk>