tools/llvm: Do not build with symbols
[minix3.git] / lib / libc / Makefile
blob32775fb03afa1bbaff4bcaa3e2287f8ac20edc8d
1 # $NetBSD: Makefile,v 1.160 2013/10/14 16:00:17 joerg Exp $
2 # @(#)Makefile 8.2 (Berkeley) 2/3/94
4 # All library objects contain sccsid strings by default; they may be
5 # excluded as a space-saving measure. To produce a library that does
6 # not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
7 # from CPPFLAGS below. To remove these strings from just the system call
8 # stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS.
10 # The NLS (message catalog) functions are always in libc. To choose that
11 # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
12 # functions, put -DNLS on the CPPFLAGS line below.
14 # The YP functions are always in libc. To choose that getpwent() and friends
15 # actually call the YP functions, put -DYP on the CPPFLAGS line below.
17 # The Hesiod functions are always in libc. To choose that getpwent() and friends
18 # actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
20 .include "Makefile.inc"
22 LIBC_MACHINE_ARCH?= ${MACHINE_ARCH} # for MKCOMPAT
24 LIB= c
25 CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}
27 LIBCDIR= ${.CURDIR}
29 .if exists (${ARCHDIR}/Makefile.inc)
30 .PATH: ${ARCHDIR}
31 .include "${ARCHDIR}/Makefile.inc"
32 .endif
34 .if exists (${ARCHDIR}/genassym.cf)
35 DPSRCS+= assym.h
36 CLEANFILES+= assym.h assym.h.tmp
38 assym.h: ${ARCHDIR}/genassym.cf
39 ${_MKTARGET_CREATE}
40 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS:N-Wa,--fatal-warnings} \
41 ${CPPFLAGS} ${CPPFLAGS.assym.h} ${PROF} \
42 < ${ARCHDIR}/genassym.cf > assym.h.tmp && \
43 mv -f assym.h.tmp assym.h
44 .endif
46 # The following controls how to build compatibility code for old NetBSD
47 # binaries. If BUILD_LEGACY is yes, then we build a separate library; otherwise
48 # we include the code in libc.
49 BUILD_LEGACY?= no
50 .if "${BUILD_LEGACY}" == "yes"
51 SUBDIR=compat
52 .include <bsd.subdir.mk>
53 .else
54 COMPATDIR=${.CURDIR}/compat
55 .include "${.CURDIR}/compat/Makefile.inc"
56 # Marker for compat code that can't be easily isolated
57 CPPFLAGS+= -D__BUILD_LEGACY
58 .endif
60 .if defined(__MINIX)
61 SUBDIR+= pkgconfig
62 .include <bsd.subdir.mk>
63 .endif # defined(__MINIX)
65 .include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
66 .include "${.CURDIR}/atomic/Makefile.inc"
67 .include "${.CURDIR}/cdb/Makefile.inc"
68 .include "${.CURDIR}/db/Makefile.inc"
69 .include "${.CURDIR}/citrus/Makefile.inc"
70 .include "${.CURDIR}/compat-43/Makefile.inc"
71 .if ${HAVE_LIBGCC} == "no"
72 .include "${.CURDIR}/compiler_rt/Makefile.inc"
73 .endif
74 .include "${.CURDIR}/dlfcn/Makefile.inc"
75 .include "${.CURDIR}/gdtoa/Makefile.inc"
76 .include "${.CURDIR}/gen/Makefile.inc"
77 .if defined(__MINIX)
78 # gmon needs profil()
79 .else
80 .include "${.CURDIR}/gmon/Makefile.inc"
81 .endif
82 .include "${.CURDIR}/hash/Makefile.inc"
83 .include "${.CURDIR}/iconv/Makefile.inc"
84 .include "${.CURDIR}/inet/Makefile.inc"
85 .include "${.CURDIR}/isc/Makefile.inc"
86 .include "${.CURDIR}/locale/Makefile.inc"
87 .include "${.CURDIR}/md/Makefile.inc"
88 .include "${.CURDIR}/misc/Makefile.inc"
89 .include "${.CURDIR}/net/Makefile.inc"
90 .include "${.CURDIR}/nameser/Makefile.inc"
91 .include "${.CURDIR}/nls/Makefile.inc"
92 .if (${MACHINE_ARCH} != "alpha") && (${ARCHSUBDIR} != "sparc64")
93 .include "${.CURDIR}/quad/Makefile.inc"
94 .endif
95 .if (${USE_LIBTRE} == "yes")
96 .include "${NETBSDSRCDIR}/external/bsd/tre/Makefile.inc"
97 .else
98 .include "${.CURDIR}/regex/Makefile.inc"
99 .endif
100 .include "${.CURDIR}/resolv/Makefile.inc"
101 .if defined(__MINIX)
102 # RPC needs pollts() and a reserved port allocator.
103 .else
104 .include "${.CURDIR}/rpc/Makefile.inc"
105 .endif
106 .include "${.CURDIR}/ssp/Makefile.inc"
107 .include "${.CURDIR}/stdio/Makefile.inc"
108 .include "${.CURDIR}/stdlib/Makefile.inc"
109 .include "${.CURDIR}/string/Makefile.inc"
110 .include "${.CURDIR}/termios/Makefile.inc"
111 .include "${.CURDIR}/thread-stub/Makefile.inc"
112 .include "${.CURDIR}/time/Makefile.inc"
113 .if defined(__MINIX)
114 .include "${NETBSDSRCDIR}/minix/lib/libc/sys/Makefile.inc"
115 .else
116 .include "${.CURDIR}/tls/Makefile.inc"
117 .endif
118 .include "${.CURDIR}/sys/Makefile.inc"
119 .if ${HAVE_LIBGCC} == "no"
120 .include "${NETBSDSRCDIR}/sys/lib/libunwind/Makefile.inc"
121 .endif
122 .include "${.CURDIR}/uuid/Makefile.inc"
123 .if (${MKYP} != "no")
124 .include "${.CURDIR}/yp/Makefile.inc"
125 .endif
127 # Remove from SRCS the .c files for any .S files added by the MD makefiles,
128 # also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
129 # Add the .c file for .S files (in both variables) to LSRCS so that the
130 # 'normal' .c file for assembly files is used for the lint librray.
132 # Usage:
133 # Add .S files to NO_SRSC when another .S file provides the entry points.
134 # Add .c files to NO_SRSC when another .c file provides the entry points.
135 # (lint is run on all .c files in SRCS)
137 .for check_file in ${SRCS:M*.S} ${NO_SRCS}
138 unwanted_file := ${SRCS:M${check_file:.S=.c}}
139 .if "${unwanted_file}" != ""
140 SRCS := ${SRCS:N${unwanted_file}}
141 .if "${unwanted_file}" != "${check_file}"
142 LSRCS := ${LSRCS} ${unwanted_file}
143 .endif
144 .endif
145 .endfor
147 NLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
148 no.msg pl.msg sk.msg sv.msg
150 .if defined(__MINIX)
151 realall:
152 .else
153 realall: tags
154 .endif
155 tags: ${SRCS}
156 ${_MKTARGET_CREATE}
157 -${TOOL_CTAGS} -w ${.ALLSRC:M*.c}
158 -egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \
159 sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
160 >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET}
162 .if !defined(__MINIX)
163 FILES= tags
164 FILESNAME= libc.tags
165 FILESDIR= /var/db
166 .endif
169 # workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
170 # multibyte for libc.so. the quirk should be removed when we support
171 # dlopen() from within statically linked binaries.
172 .if !defined(__MINIX)
173 CSHLIBFLAGS+= -D_I18N_DYNAMIC
174 .endif
176 .include <bsd.lib.mk>
178 # force the dynamic linker to initialize libc first
179 SHLIB_SHFLAGS+= -Wl,-z,initfirst
180 .if ${HAVE_LIBGCC} == "no"
181 SHLIB_SHFLAGS+= -Wl,-z,defs
182 .endif