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