Makefile revision 59766
1193323Sed# $FreeBSD: head/lib/libstand/Makefile 59766 2000-04-29 20:47:10Z jlemon $
2193323Sed#
3193323Sed# Originally from	$NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4193323Sed#
5193323Sed# Notes:
6193323Sed# - We don't use the libc strerror/sys_errlist because the string table is
7193323Sed#   quite large.
8193323Sed#
9193323Sed
10193323SedLIB=		stand
11193323SedNOPROFILE=	YES
12193323SedNOPIC=		YES
13193323SedMAN3=		libstand.3
14193323Sed
15193323Sed# Mostly OK, some of the libc imports are a bit noisy
16193323SedCFLAGS+=	-Wall
17193323Sed
18193323Sed.if ${MACHINE_ARCH} == "alpha"
19193323SedCFLAGS+=	-mno-fp-regs
20193323Sed.endif
21193323Sed
22193323Sed# standalone components and stuff we have modified locally
23193323SedSRCS+=	__main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
24193323Sed	globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
25193323Sed	sbrk.c twiddle.c zalloc.c zalloc_malloc.c
26193323Sed
27193323Sed# private (pruned) versions of libc string functions
28193323SedSRCS+=	strcasecmp.c
29193323Sed
30193323Sed# string functions from libc
31193323Sed.PATH:	${.CURDIR}/../libc/string
32193323Sed.if ${MACHINE_ARCH} == "i386"
33193323SedSRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
34193323Sed        memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
35193323Sed        strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
36193323Sed	strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
37193323Sed.endif
38193323Sed.if ${MACHINE_ARCH} == "alpha"
39193323Sed.PATH: ${.CURDIR}/../libc/alpha/string
40193323SedSRCS+=	bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
41193323Sed	memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
42193323Sed	strcmp.c strcpy.c strcspn.c strlen.c \
43193323Sed	strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
44193323Sed	strspn.c strstr.c strtok.c swab.c
45193323Sed
46193323Sed.PATH: ${.CURDIR}/../libc/alpha/net
47193323SedSRCS+= htons.S ntohs.S htonl.S ntohl.S
48193323Sed
49193323SedSRCS+= __divqu.S __divq.S __divlu.S __divl.S
50193323SedSRCS+= __remqu.S __remq.S __remlu.S __reml.S
51193323Sed
52193323SedCLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
53193323SedCLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
54193323Sed
55193323Sed
56193323Sed__divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
57193323Sed	m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
58193323Sed		${.ALLSRC} > ${.TARGET}
59193323Sed
60193323Sed__divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
61193323Sed	m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
62193323Sed		${.ALLSRC} > ${.TARGET}
63193323Sed
64193323Sed__divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
65193323Sed	m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
66193323Sed		${.ALLSRC} > ${.TARGET}
67193323Sed
68193323Sed__divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
69193323Sed	m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
70193323Sed		${.ALLSRC} > ${.TARGET}
71193323Sed
72193323Sed__remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
73193323Sed	m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
74193323Sed		${.ALLSRC} > ${.TARGET}
75193323Sed
76193323Sed__remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
77193323Sed	m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
78193323Sed		${.ALLSRC} > ${.TARGET}
79193323Sed
80193323Sed__remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
81193323Sed	m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
82193323Sed		${.ALLSRC} > ${.TARGET}
83193323Sed
84193323Sed__reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
85193323Sed	m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
86193323Sed		${.ALLSRC} > ${.TARGET}
87193323Sed.endif
88193323Sed
89193323Sed# network support from libc
90193323Sed.PATH:	${.CURDIR}/../libc/net
91193323SedSRCS+=	inet_ntoa.c inet_addr.c
92193323Sed
93193323Sed# _setjmp/_longjmp
94193323Sed.PATH:	${.CURDIR}/${MACHINE_ARCH}
95193323SedSRCS+=	_setjmp.S
96193323Sed# really only required for i386
97193323SedCFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
98193323Sed
99193323Sed# decompression functionality from libz
100193323Sed.PATH:	${.CURDIR}/../libz
101193323SedCFLAGS+=-DHAVE_MEMCPY
102193323SedSRCS+=	adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
103193323Sed	inftrees.c infutil.c zutil.c 
104193323Sed
105193323Sed# io routines
106193323SedSRCS+=	closeall.c dev.c ioctl.c nullfs.c stat.c \
107193323Sed	fstat.c close.c lseek.c open.c read.c write.c readdir.c
108193323Sed
109193323Sed# network routines
110193323SedSRCS+=	arp.c ether.c in_cksum.c net.c udp.c netif.c rpc.c
111193323Sed
112193323Sed# network info services:
113193323SedSRCS+=	bootp.c rarp.c bootparam.c
114193323Sed
115193323Sed# boot filesystems
116193323SedSRCS+=	ufs.c nfs.c cd9660.c tftp.c zipfs.c
117193323SedSRCS+=	netif.c nfs.c
118193323SedSRCS+=	dosfs.c ext2fs.c
119193323Sed
120193323Sedbeforeinstall:
121193323Sed	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/stand.h \
122193323Sed		${DESTDIR}/usr/include
123193323Sed
124193323Sed.include <bsd.lib.mk>
125193323Sed