1 # @(#)Makefile 8.2 (Berkeley) 2/3/94
2 # $FreeBSD: src/lib/libc/Makefile,v 1.31 2001/08/13 21:48:43 peter Exp $
4 # Yes, we build everything with -g, and strip it out later...
6 # -faltivec now disables inlining, so we can't use it globally. Fortunately,
7 # only two files need altivec support, so we use file-specific CFLAGS to add
8 # the option when needed.
14 .include <CoreOS/Standard/Commands.mk>
15 .include <CoreOS/Standard/Variables.mk>
17 .if !empty(MACHINE_ARCH:M*64)
20 # RC_TARGET_CONFIG may not be set, so default to MacOSX (which is good enough
21 # for installsrc to autopatch all files).
22 .ifndef RC_TARGET_CONFIG
23 RC_TARGET_CONFIG = MacOSX
26 # Use default compiler, so comment out OTHERCC
28 # HOSTCC is the compiler on the local host, so we need to unset any SDKROOT
29 # to before calling PATH_OF_COMMAND
31 MYCC != ${PATH_OF_COMMAND} ${OTHERCC}
32 HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} ${OTHERCC}
35 HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} cc
37 GCC_VERSION != ${MYCC} -dumpversion | ${SED} -e 's/^\([^.]*\.[^.]*\).*/\1/'
38 GCC_42 != ${PERL} -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
41 INCLUDEDIR = ${ALTLIBCHEADERS}
42 LIBCFLAGS += -I${INCLUDEDIR}
43 .else # !ALTLIBCHEADERS
44 INCLUDEDIR = ${SDKROOT}/usr/include
45 .endif # ALTLIBCHEADERS
46 FRAMEWORKS = ${OBJROOT}/Frameworks
47 PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
48 PRIVINC = -I${PRIVATEHEADERS}
49 LIBCFLAGS += ${PRIVINC}
51 SYMROOTINC = ${SYMROOT}/include
52 CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -fno-builtin -Wmost
53 CFLAGS += -D__LIBC__ -D__DARWIN_UNIX03=1 -D__DARWIN_64_BIT_INO_T=1 -D__DARWIN_NON_CANCELABLE=1 -D__DARWIN_VERS_1050=1 -D_FORTIFY_SOURCE=0
54 CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR}
55 CFLAGS += -I${.OBJDIR} -I${SYMROOTINC} -I${.CURDIR}/include
56 AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS}
57 AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC}
58 .if $(MACHINE_ARCH) != arm
59 CFLAGS += -force_cpusubtype_ALL
60 AINC += -force_cpusubtype_ALL
63 CFLAGS += -isysroot '${SDKROOT}'
64 AINC += -isysroot '${SDKROOT}'
68 CFLAGS += -no-cpp-precomp
69 AINC += -no-cpp-precomp
72 INSTALL_PIC_ARCHIVE= yes
75 # workaround for 3649783
76 AINC += -fdollars-in-identifiers
78 # If these aren't set give it expected defaults
83 SYMROOT = ${.CURDIR}/SYMROOT
84 _x_ != ${TEST} -d ${SYMROOT} || ${MKDIR} ${SYMROOT}
87 MAKEOBJDIR ?= ${OBJROOT}
90 SRCS += libc_version.c
92 ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@
94 .include "Makefile.features"
95 .include "${.CURDIR}/Makefile.inc"
96 .include "Makefile.xbs"
98 MANFILTER = ${UNIFDEF} -t ${UNIFDEFARGS}
99 .include <bsd.init.mk>
100 .include <bsd.man.mk>