]>
Commit | Line | Data |
---|---|---|
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 |
10 | LIB=c |
11 | SHLIB_MAJOR= 1 | |
12 | SHLIB_MINOR= 0 | |
13 | .if (${MACHINE_ARCH} == unknown) | |
9385eb3d | 14 | MACHINE_ARCH != /usr/bin/arch |
5b2abdfb | 15 | .endif |
8e029c65 A |
16 | .if !empty $(MACHINE_ARCH:M*64) |
17 | LP64 = 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 | |
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 | ||
59e0d9fe | 30 | .ifdef ALTLIBCHEADERS |
3d9156a7 | 31 | INCLUDEDIR = ${ALTLIBCHEADERS} |
224c7076 | 32 | LIBCFLAGS += -I${INCLUDEDIR} |
b5d655f7 A |
33 | .else # !ALTLIBCHEADERS |
34 | INCLUDEDIR = ${SDKROOT}/usr/include | |
35 | .endif # ALTLIBCHEADERS | |
224c7076 A |
36 | FRAMEWORKS = ${OBJROOT}/Frameworks |
37 | PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders | |
b5d655f7 A |
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 | |
5b2abdfb A |
61 | CLEANFILES+=tags |
62 | INSTALL_PIC_ARCHIVE= yes | |
63 | PRECIOUSLIB= yes | |
64 | ||
3d9156a7 A |
65 | # workaround for 3649783 |
66 | AINC += -fdollars-in-identifiers | |
67 | ||
5b2abdfb A |
68 | # If these aren't set give it expected defaults |
69 | DSTROOT ?= / | |
70 | OBJROOT ?= . | |
71 | SRCROOT ?= ${.CURDIR} | |
59e0d9fe A |
72 | .ifndef SYMROOT |
73 | SYMROOT = ${.CURDIR}/SYMROOT | |
74 | _x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT} | |
75 | .endif | |
5b2abdfb A |
76 | DESTDIR ?= ${DSTROOT} |
77 | MAKEOBJDIR ?= ${OBJROOT} | |
78 | ||
224c7076 A |
79 | # add version string |
80 | SRCS += libc_version.c | |
81 | libc_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 | |
88 | MANFILTER = 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> |