]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/Makefile
Disable all warnings when building gdtoa. This allows building libc with
[FreeBSD/FreeBSD.git] / lib / libc / Makefile
1 #       @(#)Makefile    8.2 (Berkeley) 2/3/94
2 # $FreeBSD$
3
4 SHLIBDIR?= /lib
5
6 .include <bsd.own.mk>
7
8 # All library objects contain FreeBSD revision strings by default; they may be
9 # excluded as a space-saving measure.  To produce a library that does
10 # not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11 # below.  Note: there are no IDs for syscall stubs whose sources are generated.
12 # To include legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
13 # to CFLAGS below.  -DSYSLIBC_SCCS affects just the system call stubs.
14 LIB=c
15 SHLIB_MAJOR= 7
16 WARNS?= 2
17 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
18 CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
19 CFLAGS+=-DNLS
20 CLEANFILES+=tags
21 INSTALL_PIC_ARCHIVE=
22 PRECIOUSLIB=
23
24 #
25 # Only link with static libgcc.a (no libgcc_eh.a).
26 #
27 DPADD+= ${LIBGCC}
28 LDFLAGS+= -nodefaultlibs
29 LDADD+= -lgcc -lssp_nonshared
30
31 # Define (empty) variables so that make doesn't give substitution
32 # errors if the included makefiles don't change these:
33 MDSRCS=
34 MISRCS=
35 MDASM=
36 MIASM=
37 NOASM=
38
39 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
40 .include "${.CURDIR}/db/Makefile.inc"
41 .include "${.CURDIR}/compat-43/Makefile.inc"
42 .include "${.CURDIR}/gdtoa/Makefile.inc"
43 .include "${.CURDIR}/gen/Makefile.inc"
44 .include "${.CURDIR}/gmon/Makefile.inc"
45 .include "${.CURDIR}/inet/Makefile.inc"
46 .include "${.CURDIR}/isc/Makefile.inc"
47 .include "${.CURDIR}/locale/Makefile.inc"
48 .include "${.CURDIR}/nameser/Makefile.inc"
49 .include "${.CURDIR}/net/Makefile.inc"
50 .include "${.CURDIR}/nls/Makefile.inc"
51 .include "${.CURDIR}/posix1e/Makefile.inc"
52 .if ${MACHINE_ARCH} != "amd64" && \
53     ${MACHINE_ARCH} != "ia64" && \
54     ${MACHINE_ARCH} != "powerpc64" && \
55     ${MACHINE_ARCH} != "sparc64" && \
56     ${MACHINE_ARCH} != "mips"
57 .include "${.CURDIR}/quad/Makefile.inc"
58 .endif
59 .if ${MACHINE_ARCH} == "mips" && \
60     (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32")
61 .include "${.CURDIR}/quad/Makefile.inc"
62 .endif
63 .include "${.CURDIR}/regex/Makefile.inc"
64 .include "${.CURDIR}/resolv/Makefile.inc"
65 .include "${.CURDIR}/stdio/Makefile.inc"
66 .include "${.CURDIR}/stdlib/Makefile.inc"
67 .include "${.CURDIR}/stdtime/Makefile.inc"
68 .include "${.CURDIR}/string/Makefile.inc"
69 .include "${.CURDIR}/sys/Makefile.inc"
70 .include "${.CURDIR}/rpc/Makefile.inc"
71 .include "${.CURDIR}/uuid/Makefile.inc"
72 .include "${.CURDIR}/xdr/Makefile.inc"
73 .if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
74 .include "${.CURDIR}/softfloat/Makefile.inc"
75 .endif
76 .if ${MK_NIS} != "no"
77 CFLAGS+= -DYP
78 .include "${.CURDIR}/yp/Makefile.inc"
79 .endif
80 .if ${MK_HESIOD} != "no"
81 CFLAGS+= -DHESIOD
82 .endif
83 .if ${MK_FP_LIBC} == "no"
84 CFLAGS+= -DNO_FLOATING_POINT
85 .endif
86 .if ${MK_NS_CACHING} != "no"
87 CFLAGS+= -DNS_CACHING
88 .endif
89 .if defined(_FREEFALL_CONFIG)
90 CFLAGS+=-D_FREEFALL_CONFIG
91 .endif
92
93 VERSION_DEF=${.CURDIR}/Versions.def
94 SYMBOL_MAPS=${SYM_MAPS}
95 CFLAGS+= -DSYMBOL_VERSIONING
96
97 # If there are no machine dependent sources, append all the
98 # machine-independent sources:
99 .if empty(MDSRCS)
100 SRCS+=  ${MISRCS}
101 .else
102 # Append machine-dependent sources, then append machine-independent sources
103 # for which there is no machine-dependent variant.
104 SRCS+=  ${MDSRCS}
105 .for _src in ${MISRCS}
106 .if ${MDSRCS:R:M${_src:R}} == ""
107 SRCS+=  ${_src}
108 .endif
109 .endfor
110 .endif
111
112 KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
113         lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
114         subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
115 KSRCS=  bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
116         strcat.c strcmp.c strcpy.c strlen.c strncpy.c
117
118 libkern: libkern.gen libkern.${MACHINE_ARCH}
119
120 libkern.gen: ${KQSRCS} ${KSRCS}
121         cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
122
123 libkern.${MACHINE_ARCH}:: ${KMSRCS}
124 .if defined(KMSRCS) && !empty(KMSRCS)
125         cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
126 .endif
127         
128 .include <bsd.lib.mk>
129
130 # Disable warnings in contributed sources.
131 CWARNFLAGS:=    ${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/:C/^$/-w/}
132 # XXX For now, we don't allow libc to be compiled with
133 # -fstack-protector-all because it breaks rtld.  We may want to make a librtld
134 # in the future to circumvent this.
135 SSP_CFLAGS:=    ${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/}
136 # Disable stack protection for SSP symbols.
137 SSP_CFLAGS:=    ${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/}