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