]> git.saurik.com Git - apple/libc.git/blame_incremental - Makefile
Libc-594.9.4.tar.gz
[apple/libc.git] / Makefile
... / ...
CommitLineData
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 $
3#
4# Yes, we build everything with -g, and strip it out later...
5#
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.
9#
10LIB=c
11SHLIB_MAJOR= 1
12SHLIB_MINOR= 0
13
14.include <CoreOS/Standard/Commands.mk>
15.include <CoreOS/Standard/Variables.mk>
16
17.if !empty(MACHINE_ARCH:M*64)
18LP64 = 1
19.endif
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
23RC_TARGET_CONFIG = MacOSX
24.endif
25
26# Use default compiler, so comment out OTHERCC
27#OTHERCC = gcc-4.0
28# HOSTCC is the compiler on the local host, so we need to unset any SDKROOT
29# to before calling PATH_OF_COMMAND
30.ifdef OTHERCC
31MYCC != ${PATH_OF_COMMAND} ${OTHERCC}
32HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} ${OTHERCC}
33.else
34MYCC = ${CC}
35HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} cc
36.endif
37GCC_VERSION != ${MYCC} -dumpversion | ${SED} -e 's/^\([^.]*\.[^.]*\).*/\1/'
38GCC_42 != ${PERL} -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
39
40.ifdef ALTLIBCHEADERS
41INCLUDEDIR = ${ALTLIBCHEADERS}
42LIBCFLAGS += -I${INCLUDEDIR}
43.else # !ALTLIBCHEADERS
44INCLUDEDIR = ${SDKROOT}/usr/include
45.endif # ALTLIBCHEADERS
46FRAMEWORKS = ${OBJROOT}/Frameworks
47PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
48PRIVINC = -I${PRIVATEHEADERS}
49LIBCFLAGS += ${PRIVINC}
50
51SYMROOTINC = ${SYMROOT}/include
52CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -fno-builtin -Wmost
53CFLAGS += -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
54CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR}
55CFLAGS += -I${.OBJDIR} -I${SYMROOTINC} -I${.CURDIR}/include
56AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS}
57AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC}
58.if $(MACHINE_ARCH) != arm
59CFLAGS += -force_cpusubtype_ALL
60AINC += -force_cpusubtype_ALL
61.endif
62.ifdef SDKROOT
63CFLAGS += -isysroot '${SDKROOT}'
64AINC += -isysroot '${SDKROOT}'
65.endif # SDKROOT
66
67.if ${GCC_42} != YES
68CFLAGS += -no-cpp-precomp
69AINC += -no-cpp-precomp
70.endif
71CLEANFILES+=tags
72INSTALL_PIC_ARCHIVE= yes
73PRECIOUSLIB= yes
74
75# workaround for 3649783
76AINC += -fdollars-in-identifiers
77
78# If these aren't set give it expected defaults
79DSTROOT ?= /
80OBJROOT ?= .
81SRCROOT ?= ${.CURDIR}
82.ifndef SYMROOT
83SYMROOT = ${.CURDIR}/SYMROOT
84_x_ != ${TEST} -d ${SYMROOT} || ${MKDIR} ${SYMROOT}
85.endif
86DESTDIR ?= ${DSTROOT}
87MAKEOBJDIR ?= ${OBJROOT}
88
89# add version string
90SRCS += libc_version.c
91libc_version.c:
92 ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@
93
94.include "Makefile.features"
95.include "${.CURDIR}/Makefile.inc"
96.include "Makefile.xbs"
97
98MANFILTER = ${UNIFDEF} -t ${UNIFDEFARGS}
99.include <bsd.init.mk>
100.include <bsd.man.mk>