Makefile revision 1.48
1#	$NetBSD: Makefile,v 1.48 1999/02/24 16:22:42 chs Exp $
2
3LIB=	kern
4MKPIC=	no
5
6M=	${.CURDIR}/arch/${MACHINE_ARCH}
7
8CPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
9
10.if exists ($M/Makefile.inc)
11.PATH:	$M
12.include "$M/Makefile.inc"
13.endif
14
15.if (${MACHINE_ARCH} != "alpha")
16# Quad support
17SRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
18	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
19	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
20.endif
21
22# Other stuff
23SRCS+=	md5c.c sha1.c pmatch.c
24
25# Files to clean up
26CLEANFILES+= lib${LIB}.o lib${LIB}.po
27
28#
29# Special rules for certain objects
30#
31
32# mcount cannot be compiled with profiling
33mcount.po: mcount.o
34	cp mcount.o mcount.po
35
36# XXX these stub builds should be cleaned up even further.
37
38# if no machine specific memcpy(3), build one out of bcopy(3) based stub.
39.if empty(SRCS:Mmemcpy.S)
40SRCS+=	memcpy.c
41.endif
42
43# if no machine specific memmove(3), build one out of bcopy(3) based stub.
44.if empty(SRCS:Mmemmove.S)
45SRCS+=	memmove.c
46.endif
47
48# if no machine specific strchr(3), build one out of index(3) based stub.
49.if empty(SRCS:Mstrchr.S)
50SRCS+=	strchr.c
51.endif
52
53# if no machine specific strrchr(3), build one out of rindex(3) based stub.
54.if empty(SRCS:Mstrrchr.S)
55SRCS+=	strrchr.c
56.endif
57
58POBJS+=	mcount.po
59
60# only needed during build
61libinstall::
62
63.include <bsd.lib.mk>
64
65lib${LIB}.o:: ${OBJS}
66	@echo building standard ${LIB} library
67	@rm -f lib${LIB}.o
68	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
69
70lib${LIB}.po:: ${POBJS}
71	@echo building profiled ${LIB} library
72	@rm -f lib${LIB}.po
73	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
74