xref: /openbsd/lib/libc/Makefile.inc (revision 17df1aa7)
1#	$OpenBSD: Makefile.inc,v 1.14 2010/02/03 20:49:00 miod Exp $
2#
3# This file contains make rules used to build libc
4#
5
6.ifndef LIBCSRCDIR
7all:
8	@echo "need to define LIBCSRCDIR" >&2; exit 1
9.endif
10
11CFLAGS+=	-I${LIBCSRCDIR}/include
12
13# Include link-time warnings about unsafe API uses (ie. strcpy)
14CFLAGS+=-DAPIWARN
15
16.if (${YP:L} == "yes")
17CFLAGS+=-DYP -I${LIBCSRCDIR}/yp
18.endif
19
20LLIBS=
21AINC=   -I${LIBCSRCDIR}/arch/${MACHINE_CPU}
22.if defined(DESTDIR)
23AINC+=  -nostdinc -idirafter ${DESTDIR}/usr/include
24.endif
25
26.if exists (${LIBCSRCDIR}/arch/${MACHINE_CPU}/Makefile.inc)
27.PATH:	${LIBCSRCDIR}/arch/${MACHINE_CPU}
28.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/Makefile.inc"
29.endif
30
31.include "${LIBCSRCDIR}/db/Makefile.inc"
32.include "${LIBCSRCDIR}/dlfcn/Makefile.inc"
33.include "${LIBCSRCDIR}/compat-43/Makefile.inc"
34.include "${LIBCSRCDIR}/gen/Makefile.inc"
35.include "${LIBCSRCDIR}/crypt/Makefile.inc"
36.include "${LIBCSRCDIR}/gdtoa/Makefile.inc"
37.include "${LIBCSRCDIR}/gmon/Makefile.inc"
38.include "${LIBCSRCDIR}/hash/Makefile.inc"
39.include "${LIBCSRCDIR}/locale/Makefile.inc"
40.include "${LIBCSRCDIR}/net/Makefile.inc"
41.include "${LIBCSRCDIR}/nls/Makefile.inc"
42.include "${LIBCSRCDIR}/ohash/Makefile.inc"
43.if (${MACHINE_CPU} != "alpha")
44.include "${LIBCSRCDIR}/quad/Makefile.inc"
45.endif
46.include "${LIBCSRCDIR}/regex/Makefile.inc"
47.include "${LIBCSRCDIR}/rpc/Makefile.inc"
48.include "${LIBCSRCDIR}/stdio/Makefile.inc"
49.include "${LIBCSRCDIR}/stdlib/Makefile.inc"
50.include "${LIBCSRCDIR}/string/Makefile.inc"
51.include "${LIBCSRCDIR}/termios/Makefile.inc"
52.include "${LIBCSRCDIR}/thread/Makefile.inc"
53.include "${LIBCSRCDIR}/time/Makefile.inc"
54.include "${LIBCSRCDIR}/sys/Makefile.inc"
55.if (${YP:L} == "yes")
56.include "${LIBCSRCDIR}/yp/Makefile.inc"
57.endif
58
59CFLAGS+=-DNLS
60
61LIBKERN=	${LIBCSRCDIR}/../../sys/lib/libkern
62
63KSRCS=	bcmp.c bzero.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c \
64	strncpy.c htonl.c htons.c ntohl.c ntohs.c
65.if (${MACHINE_CPU} != "alpha")
66KSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
67	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
68	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
69KINCLUDES+=	quad/quad.h
70.endif
71
72