Makefile revision 40005
140005Smsmith# $Id: Makefile,v 1.5 1998/10/04 08:10:29 msmith Exp $
238451Smsmith#
338451Smsmith# Originally from	$NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
438451Smsmith#
538451Smsmith# Notes:
638451Smsmith# - We don't use the libc strerror/sys_errlist because the string table is
738451Smsmith#   quite large.
838451Smsmith#
938451Smsmith
1038451SmsmithLIB=		stand
1138451SmsmithNOPROFILE=	YES
1238451SmsmithNOPIC=		YES
1338453SmsmithMAN3=		libstand.3
1438451Smsmith
1538451Smsmith# Mostly OK, some of the libc imports are a bit noisy
1639942SmsmithCFLAGS+=	-Wall #-g
1738451Smsmith
1838451Smsmith.if ${MACHINE_ARCH} == "alpha"
1938451SmsmithCFLAGS+=	-mno-fp-regs
2038451Smsmith.endif
2138451Smsmith
2238451Smsmith# standalone components and stuff we have modified locally
2339665SmsmithSRCS+=	__main.c bcd.c bswap.c environment.c getopt.c gets.c globals.c \
2439665Smsmith	pager.c printf.c strdup.c strerror.c strtol.c random.c sbrk.c \
2539665Smsmith	twiddle.c zalloc.c zalloc_malloc.c
2638451Smsmith
2740005Smsmith# private (pruned) versions of libc string functions
2840005SmsmithSRCS+=	strcasecmp.c
2939665Smsmith
3038451Smsmith# string functions from libc
3138451Smsmith.PATH:	${.CURDIR}/../libc/string
3238451Smsmith.if ${MACHINE_ARCH} == "i386"
3338451SmsmithSRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
3440005Smsmith        memcpy.c memmove.c memset.c rindex.c strcat.c strchr.c \
3538451Smsmith        strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
3638451Smsmith	strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
3738451Smsmith.endif
3838451Smsmith.if ${MACHINE_ARCH} == "alpha"
3938451Smsmith.PATH: ${.CURDIR}/../libc/alpha/string
4038451SmsmithSRCS+=	bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
4140005Smsmith	memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
4238451Smsmith	strcmp.c strcpy.c strcspn.c strlen.c \
4338451Smsmith	strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
4438451Smsmith	strspn.c strstr.c strtok.c swab.c
4538451Smsmith
4638451Smsmith.PATH: ${.CURDIR}/../libc/alpha/net
4738451SmsmithSRCS+= htons.S ntohs.S htonl.S ntohl.S
4838451Smsmith
4938451SmsmithSRCS+= __divqu.S __divq.S __divlu.S __divl.S
5038451SmsmithSRCS+= __remqu.S __remq.S __remlu.S __reml.S
5138451Smsmith
5238451SmsmithCLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
5338451SmsmithCLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
5438451Smsmith
5538451Smsmith
5638451Smsmith__divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
5738451Smsmith	m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
5838451Smsmith		${.ALLSRC} > ${.TARGET}
5938451Smsmith
6038451Smsmith__divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
6138451Smsmith	m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
6238451Smsmith		${.ALLSRC} > ${.TARGET}
6338451Smsmith
6438451Smsmith__divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
6538451Smsmith	m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
6638451Smsmith		${.ALLSRC} > ${.TARGET}
6738451Smsmith
6838451Smsmith__divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
6938451Smsmith	m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
7038451Smsmith		${.ALLSRC} > ${.TARGET}
7138451Smsmith
7238451Smsmith__remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
7338451Smsmith	m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
7438451Smsmith		${.ALLSRC} > ${.TARGET}
7538451Smsmith
7638451Smsmith__remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
7738451Smsmith	m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
7838451Smsmith		${.ALLSRC} > ${.TARGET}
7938451Smsmith
8038451Smsmith__remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
8138451Smsmith	m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
8238451Smsmith		${.ALLSRC} > ${.TARGET}
8338451Smsmith
8438451Smsmith__reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
8538451Smsmith	m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
8638451Smsmith		${.ALLSRC} > ${.TARGET}
8738451Smsmith.endif
8838451Smsmith
8938451Smsmith# network support from libc
9038451Smsmith.PATH:	${.CURDIR}/../libc/net
9138451SmsmithSRCS+=	inet_ntoa.c inet_addr.c
9238451Smsmith
9338451Smsmith# decompression functionality from libz
9438451Smsmith.PATH:	${.CURDIR}/../libz
9538451SmsmithCFLAGS+=-DHAVE_MEMCPY
9638451SmsmithSRCS+=	adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
9738451Smsmith	inftrees.c infutil.c zutil.c 
9838451Smsmith
9938451Smsmith# io routines
10038451SmsmithSRCS+=	closeall.c dev.c ioctl.c nullfs.c stat.c \
10138451Smsmith	fstat.c close.c lseek.c open.c read.c write.c
10238451Smsmith
10338451Smsmith# network routines
10438451SmsmithSRCS+=	arp.c ether.c in_cksum.c net.c netif.c rpc.c
10538451Smsmith
10638451Smsmith# network info services:
10738451SmsmithSRCS+=	bootp.c rarp.c bootparam.c
10838451Smsmith
10938451Smsmith# boot filesystems
11038451SmsmithSRCS+=	ufs.c nfs.c cd9660.c tftp.c zipfs.c
11138451SmsmithSRCS+=	netif.c nfs.c
11240005SmsmithSRCS+=	dosfs.c
11338451Smsmith
11438453Smsmithbeforeinstall:
11538453Smsmith	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/stand.h \
11638453Smsmith		${DESTDIR}/usr/include
11738453Smsmith
11838451Smsmith.include <bsd.lib.mk>
119