Makefile revision 38452
1# $Id$
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
10LIB=		stand
11NOPROFILE=	YES
12NOPIC=		YES
13
14# Mostly OK, some of the libc imports are a bit noisy
15CFLAGS+=	-Wall
16
17# i386 apps are loaded by an a.out only loader
18.if ${MACHINE_ARCH} == "i386"
19OBJFORMAT=	aout
20.endif
21
22.if ${MACHINE_ARCH} == "alpha"
23CFLAGS+=	-mno-fp-regs
24.endif
25
26# standalone components and stuff we have modified locally
27SRCS+=	__main.c alloc.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	twiddle.c
30
31# string functions from libc
32.PATH:	${.CURDIR}/../libc/string
33.if ${MACHINE_ARCH} == "i386"
34SRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
35        memcpy.c memmove.c memset.c rindex.c strcasecmp.c strcat.c strchr.c \
36        strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
37	strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
38.endif
39.if ${MACHINE_ARCH} == "alpha"
40.PATH: ${.CURDIR}/../libc/alpha/string
41SRCS+=	bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
42	memcpy.S memmove.S memset.c rindex.c strcasecmp.c strcat.c strchr.c \
43	strcmp.c strcpy.c strcspn.c strlen.c \
44	strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
45	strspn.c strstr.c strtok.c swab.c
46
47.PATH: ${.CURDIR}/../libc/alpha/net
48SRCS+= htons.S ntohs.S htonl.S ntohl.S
49
50SRCS+= __divqu.S __divq.S __divlu.S __divl.S
51SRCS+= __remqu.S __remq.S __remlu.S __reml.S
52
53CLEANFILES+=   __divqu.S __divq.S __divlu.S __divl.S
54CLEANFILES+=   __remqu.S __remq.S __remlu.S __reml.S
55
56
57__divqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
58	m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
59		${.ALLSRC} > ${.TARGET}
60
61__divq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
62	m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
63		${.ALLSRC} > ${.TARGET}
64
65__divlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
66	m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
67		${.ALLSRC} > ${.TARGET}
68
69__divl.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
70	m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
71		${.ALLSRC} > ${.TARGET}
72
73__remqu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
74	m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
75		${.ALLSRC} > ${.TARGET}
76
77__remq.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
78	m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
79		${.ALLSRC} > ${.TARGET}
80
81__remlu.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
82	m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
83		${.ALLSRC} > ${.TARGET}
84
85__reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
86	m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
87		${.ALLSRC} > ${.TARGET}
88.endif
89
90# network support from libc
91.PATH:	${.CURDIR}/../libc/net
92SRCS+=	inet_ntoa.c inet_addr.c
93
94# decompression functionality from libz
95.PATH:	${.CURDIR}/../libz
96CFLAGS+=-DHAVE_MEMCPY
97SRCS+=	adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
98	inftrees.c infutil.c zutil.c 
99
100# io routines
101SRCS+=	closeall.c dev.c ioctl.c nullfs.c stat.c \
102	fstat.c close.c lseek.c open.c read.c write.c
103
104# network routines
105SRCS+=	arp.c ether.c in_cksum.c net.c netif.c rpc.c
106
107# network info services:
108SRCS+=	bootp.c rarp.c bootparam.c
109
110# boot filesystems
111SRCS+=	ufs.c nfs.c cd9660.c tftp.c zipfs.c
112SRCS+=	netif.c nfs.c
113# needs "open directory" support
114#SRCS+=	dosfs.c
115
116.include <bsd.lib.mk>
117