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.
13 .if (${MACHINE_ARCH} == unknown)
14 MACHINE_ARCH != /usr/bin/arch
16 .if !empty $(MACHINE_ARCH:M*64)
19 # RC_TARGET_CONFIG may not be set, so default to MacOSX (which is good enough
20 # for installsrc to autopatch all files).
21 .ifndef RC_TARGET_CONFIG
22 RC_TARGET_CONFIG = MacOSX
27 GCC_VERSION != cc -dumpversion | sed -e 's/^\([^.]*\.[^.]*\).*/\1/'
28 GCC_42 != perl -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
31 INCLUDEDIR = ${ALTLIBCHEADERS}
32 LIBCFLAGS += -I${INCLUDEDIR}
33 .else # !ALTLIBCHEADERS
34 INCLUDEDIR = ${SDKROOT}/usr/include
35 .endif # ALTLIBCHEADERS
36 FRAMEWORKS = ${OBJROOT}/Frameworks
37 PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
38 PRIVINC = -I${PRIVATEHEADERS}
39 LIBCFLAGS += ${PRIVINC}
41 SYMROOTINC = ${SYMROOT}/include
42 CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -Wmost
43 CFLAGS += -D__LIBC__ -D__DARWIN_UNIX03=1 -D__DARWIN_64_BIT_INO_T=1 -D__DARWIN_NON_CANCELABLE=1 -D__DARWIN_VERS_1050=1
44 CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR}
45 CFLAGS += -I${.OBJDIR} -I${SYMROOTINC} -I${.CURDIR}/include
46 AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS}
47 AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC}
48 .if $(MACHINE_ARCH) != arm
49 CFLAGS += -force_cpusubtype_ALL
50 AINC += -force_cpusubtype_ALL
53 CFLAGS += -isysroot '${SDKROOT}'
54 AINC += -isysroot '${SDKROOT}'
58 CFLAGS += -no-cpp-precomp
59 AINC += -no-cpp-precomp
62 INSTALL_PIC_ARCHIVE= yes
65 # workaround for 3649783
66 AINC += -fdollars-in-identifiers
68 # If these aren't set give it expected defaults
73 SYMROOT = ${.CURDIR}/SYMROOT
74 _x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT}
77 MAKEOBJDIR ?= ${OBJROOT}
80 SRCS += libc_version.c
82 ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@
84 .include "Makefile.features"
85 .include "${.CURDIR}/Makefile.inc"
86 .include "Makefile.xbs"
88 MANFILTER = unifdef -t ${UNIFDEFARGS}
89 .if exists(/usr/share/mk/bsd.init.mk)
90 .include <bsd.init.mk>