]> git.saurik.com Git - apple/libc.git/blame - Makefile
Libc-498.1.5.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
13.if (${MACHINE_ARCH} == unknown)
9385eb3d 14MACHINE_ARCH != /usr/bin/arch
5b2abdfb 15.endif
8e029c65
A
16.if !empty $(MACHINE_ARCH:M*64)
17LP64 = 1
18.endif
b5d655f7
A
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
22RC_TARGET_CONFIG = MacOSX
23.endif
24
25#use default compiler
26#CC = gcc-4.0
27GCC_VERSION != cc -dumpversion | sed -e 's/^\([^.]*\.[^.]*\).*/\1/'
28GCC_42 != perl -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
29
59e0d9fe 30.ifdef ALTLIBCHEADERS
3d9156a7 31INCLUDEDIR = ${ALTLIBCHEADERS}
224c7076 32LIBCFLAGS += -I${INCLUDEDIR}
b5d655f7
A
33.else # !ALTLIBCHEADERS
34INCLUDEDIR = ${SDKROOT}/usr/include
35.endif # ALTLIBCHEADERS
224c7076
A
36FRAMEWORKS = ${OBJROOT}/Frameworks
37PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
b5d655f7
A
38PRIVINC = -I${PRIVATEHEADERS}
39LIBCFLAGS += ${PRIVINC}
40
41SYMROOTINC = ${SYMROOT}/include
42CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -Wmost
43CFLAGS += -D__LIBC__ -D__DARWIN_UNIX03=1 -D__DARWIN_64_BIT_INO_T=1 -D__DARWIN_NON_CANCELABLE=1 -D__DARWIN_VERS_1050=1
44CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR}
45CFLAGS += -I${.OBJDIR} -I${SYMROOTINC} -I${.CURDIR}/include
46AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS}
47AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC}
48.if $(MACHINE_ARCH) != arm
49CFLAGS += -force_cpusubtype_ALL
50AINC += -force_cpusubtype_ALL
51.endif
52.ifdef SDKROOT
53CFLAGS += -isysroot '${SDKROOT}'
54AINC += -isysroot '${SDKROOT}'
55.endif # SDKROOT
56
57.if ${GCC_42} != YES
58CFLAGS += -no-cpp-precomp
59AINC += -no-cpp-precomp
60.endif
5b2abdfb
A
61CLEANFILES+=tags
62INSTALL_PIC_ARCHIVE= yes
63PRECIOUSLIB= yes
64
3d9156a7
A
65# workaround for 3649783
66AINC += -fdollars-in-identifiers
67
5b2abdfb
A
68# If these aren't set give it expected defaults
69DSTROOT ?= /
70OBJROOT ?= .
71SRCROOT ?= ${.CURDIR}
59e0d9fe
A
72.ifndef SYMROOT
73SYMROOT = ${.CURDIR}/SYMROOT
74_x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT}
75.endif
5b2abdfb
A
76DESTDIR ?= ${DSTROOT}
77MAKEOBJDIR ?= ${OBJROOT}
78
224c7076
A
79# add version string
80SRCS += libc_version.c
81libc_version.c:
b5d655f7 82 ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@
224c7076 83
b5d655f7 84.include "Makefile.features"
5b2abdfb
A
85.include "${.CURDIR}/Makefile.inc"
86.include "Makefile.xbs"
b5d655f7
A
87
88MANFILTER = unifdef -t ${UNIFDEFARGS}
3d9156a7
A
89.if exists(/usr/share/mk/bsd.init.mk)
90.include <bsd.init.mk>
91.endif
5b2abdfb 92.include <bsd.man.mk>