xref: /openbsd/lib/libc/Makefile.inc (revision 274d7c50)
1#	$OpenBSD: Makefile.inc,v 1.29 2016/05/07 19:05:21 guenther 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 -I${LIBCSRCDIR}/hidden -D__LIBC__ \
12	-Werror-implicit-function-declaration -include namespace.h
13
14.if ${COMPILER_VERSION:L} != "gcc3"
15CFLAGS+=-Werror=deprecated-declarations
16.endif
17
18# Include link-time warnings about unsafe API uses (ie. strcpy)
19CFLAGS+=-DAPIWARN
20
21.if (${YP:L} == "yes")
22CFLAGS+=-DYP -I${LIBCSRCDIR}/yp
23.endif
24
25LLIBS=
26AINC=   -I${LIBCSRCDIR}/arch/${MACHINE_CPU}
27.if defined(DESTDIR)
28AINC+=  -nostdinc -idirafter ${DESTDIR}/usr/include
29.endif
30
31.if exists (${LIBCSRCDIR}/arch/${MACHINE_CPU}/Makefile.inc)
32.PATH:	${LIBCSRCDIR}/arch/${MACHINE_CPU}
33.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/Makefile.inc"
34.endif
35
36.include "${LIBCSRCDIR}/db/Makefile.inc"
37.include "${LIBCSRCDIR}/dlfcn/Makefile.inc"
38.include "${LIBCSRCDIR}/citrus/Makefile.inc"
39.include "${LIBCSRCDIR}/compat-43/Makefile.inc"
40.include "${LIBCSRCDIR}/gen/Makefile.inc"
41.include "${LIBCSRCDIR}/crypt/Makefile.inc"
42.include "${LIBCSRCDIR}/gdtoa/Makefile.inc"
43.include "${LIBCSRCDIR}/gmon/Makefile.inc"
44.include "${LIBCSRCDIR}/hash/Makefile.inc"
45.include "${LIBCSRCDIR}/locale/Makefile.inc"
46.include "${LIBCSRCDIR}/asr/Makefile.inc"
47.include "${LIBCSRCDIR}/net/Makefile.inc"
48.include "${LIBCSRCDIR}/nls/Makefile.inc"
49
50# 32-bit systems need these
51.if (${MACHINE_CPU} == "i386") || (${MACHINE_CPU} == "powerpc") || \
52    (${MACHINE_CPU} == "hppa") || (${MACHINE_CPU} == "arm") || \
53    (${MACHINE_CPU} == "sparc") || (${MACHINE_CPU} == "sh") || \
54    (${MACHINE_CPU} == "m88k")
55.include "${LIBCSRCDIR}/quad/Makefile.inc"
56.endif
57
58.include "${LIBCSRCDIR}/regex/Makefile.inc"
59.include "${LIBCSRCDIR}/rpc/Makefile.inc"
60.include "${LIBCSRCDIR}/stdio/Makefile.inc"
61.include "${LIBCSRCDIR}/stdlib/Makefile.inc"
62.include "${LIBCSRCDIR}/string/Makefile.inc"
63.include "${LIBCSRCDIR}/termios/Makefile.inc"
64.include "${LIBCSRCDIR}/thread/Makefile.inc"
65.include "${LIBCSRCDIR}/time/Makefile.inc"
66.include "${LIBCSRCDIR}/uuid/Makefile.inc"
67.include "${LIBCSRCDIR}/sys/Makefile.inc"
68.if (${YP:L} == "yes")
69.include "${LIBCSRCDIR}/yp/Makefile.inc"
70.endif
71
72${OBJS} ${GOBJS} ${POBJS} ${SOBJS} ${DOBJS}: ${LIBCSRCDIR}/include/namespace.h
73