]> git.saurik.com Git - apple/libc.git/blob - Makefile
Libc-498.1.5.tar.gz
[apple/libc.git] / Makefile
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 #
10 LIB=c
11 SHLIB_MAJOR= 1
12 SHLIB_MINOR= 0
13 .if (${MACHINE_ARCH} == unknown)
14 MACHINE_ARCH != /usr/bin/arch
15 .endif
16 .if !empty $(MACHINE_ARCH:M*64)
17 LP64 = 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
22 RC_TARGET_CONFIG = MacOSX
23 .endif
24
25 #use default compiler
26 #CC = gcc-4.0
27 GCC_VERSION != cc -dumpversion | sed -e 's/^\([^.]*\.[^.]*\).*/\1/'
28 GCC_42 != perl -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
29
30 .ifdef ALTLIBCHEADERS
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}
40
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
51 .endif
52 .ifdef SDKROOT
53 CFLAGS += -isysroot '${SDKROOT}'
54 AINC += -isysroot '${SDKROOT}'
55 .endif # SDKROOT
56
57 .if ${GCC_42} != YES
58 CFLAGS += -no-cpp-precomp
59 AINC += -no-cpp-precomp
60 .endif
61 CLEANFILES+=tags
62 INSTALL_PIC_ARCHIVE= yes
63 PRECIOUSLIB= yes
64
65 # workaround for 3649783
66 AINC += -fdollars-in-identifiers
67
68 # If these aren't set give it expected defaults
69 DSTROOT ?= /
70 OBJROOT ?= .
71 SRCROOT ?= ${.CURDIR}
72 .ifndef SYMROOT
73 SYMROOT = ${.CURDIR}/SYMROOT
74 _x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT}
75 .endif
76 DESTDIR ?= ${DSTROOT}
77 MAKEOBJDIR ?= ${OBJROOT}
78
79 # add version string
80 SRCS += libc_version.c
81 libc_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
88 MANFILTER = unifdef -t ${UNIFDEFARGS}
89 .if exists(/usr/share/mk/bsd.init.mk)
90 .include <bsd.init.mk>
91 .endif
92 .include <bsd.man.mk>