]> git.saurik.com Git - apple/libc.git/blame_incremental - Makefile
Libc-498.1.5.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.if (${MACHINE_ARCH} == unknown)
14MACHINE_ARCH != /usr/bin/arch
15.endif
16.if !empty $(MACHINE_ARCH:M*64)
17LP64 = 1
18.endif
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
30.ifdef ALTLIBCHEADERS
31INCLUDEDIR = ${ALTLIBCHEADERS}
32LIBCFLAGS += -I${INCLUDEDIR}
33.else # !ALTLIBCHEADERS
34INCLUDEDIR = ${SDKROOT}/usr/include
35.endif # ALTLIBCHEADERS
36FRAMEWORKS = ${OBJROOT}/Frameworks
37PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
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
61CLEANFILES+=tags
62INSTALL_PIC_ARCHIVE= yes
63PRECIOUSLIB= yes
64
65# workaround for 3649783
66AINC += -fdollars-in-identifiers
67
68# If these aren't set give it expected defaults
69DSTROOT ?= /
70OBJROOT ?= .
71SRCROOT ?= ${.CURDIR}
72.ifndef SYMROOT
73SYMROOT = ${.CURDIR}/SYMROOT
74_x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT}
75.endif
76DESTDIR ?= ${DSTROOT}
77MAKEOBJDIR ?= ${OBJROOT}
78
79# add version string
80SRCS += libc_version.c
81libc_version.c:
82 ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@
83
84.include "Makefile.features"
85.include "${.CURDIR}/Makefile.inc"
86.include "Makefile.xbs"
87
88MANFILTER = unifdef -t ${UNIFDEFARGS}
89.if exists(/usr/share/mk/bsd.init.mk)
90.include <bsd.init.mk>
91.endif
92.include <bsd.man.mk>