]> git.saurik.com Git - apple/libc.git/blob - Makefile
c86cdf5c0e623ca47107ecf456e96e0bf063255c
[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
14 .include <CoreOS/Standard/Commands.mk>
15 .include <CoreOS/Standard/Variables.mk>
16
17 .if !empty(MACHINE_ARCH:M*64)
18 LP64 = 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
23 RC_TARGET_CONFIG = MacOSX
24 .endif
25
26 .ifndef RC_ProjectName
27 RC_ProjectName = Libc
28 .endif
29
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
35 MYCC != ${PATH_OF_COMMAND} ${OTHERCC}
36 HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} ${OTHERCC}
37 .else
38 MYCC = ${CC}
39 HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} cc
40 .endif
41 GCC_VERSION != ${MYCC} -dumpversion | ${SED} -e 's/^\([^.]*\.[^.]*\).*/\1/'
42 GCC_42 != ${PERL} -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')"
43
44 .ifdef ALTLIBCHEADERS
45 INCLUDEDIR = ${ALTLIBCHEADERS}
46 LIBCFLAGS += -I${INCLUDEDIR}
47 .else # !ALTLIBCHEADERS
48 INCLUDEDIR = ${SDKROOT}/usr/include
49 .endif # ALTLIBCHEADERS
50 FRAMEWORKS = ${OBJROOT}/Frameworks
51 PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders
52 PRIVINC = -I${PRIVATEHEADERS}
53 LIBCFLAGS += ${PRIVINC}
54
55 SYMROOTINC = ${SYMROOT}/include
56 CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -fno-builtin -Wmost
57 CFLAGS += -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
58 CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR}
59 CFLAGS += -I${.OBJDIR} ${VARIANTINC} -I${SYMROOTINC} -I${.CURDIR}/include
60 AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS}
61 AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC}
62 .if $(MACHINE_ARCH) != arm
63 CFLAGS += -force_cpusubtype_ALL
64 AINC += -force_cpusubtype_ALL
65 .endif
66 .ifdef SDKROOT
67 CFLAGS += -isysroot '${SDKROOT}'
68 AINC += -isysroot '${SDKROOT}'
69 .endif # SDKROOT
70
71 CLEANFILES+=tags
72 INSTALL_PIC_ARCHIVE= yes
73 PRECIOUSLIB= yes
74
75 # workaround for 3649783
76 AINC += -fdollars-in-identifiers
77
78 # If these aren't set give it expected defaults
79 DSTROOT ?= /
80 OBJROOT ?= .
81 SRCROOT ?= ${.CURDIR}
82 .ifndef SYMROOT
83 SYMROOT = ${.CURDIR}/SYMROOT
84 _x_ != ${TEST} -d ${SYMROOT} || ${MKDIR} ${SYMROOT}
85 .endif
86 DESTDIR ?= ${DSTROOT}
87 MAKEOBJDIR ?= ${OBJROOT}
88 PLATROOT != xcodebuild -version -sdk $(SDKROOT) PlatformPath | tr -d '\n'
89
90 # add version string
91 SRCS += libc_version.c
92 libc_version.c:
93 ${PLATROOT}/Developer/Makefiles/bin/version.pl Libc > $@
94
95 .include "Makefile.features"
96 .include "${.CURDIR}/Makefile.inc"
97 .include "Makefile.xbs"
98
99 MANFILTER = ${UNIFDEF} -t ${UNIFDEFARGS}
100 .include <bsd.init.mk>
101 .include <bsd.man.mk>