X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..7ba935f9833da45a0dbcb06329e3015acee97223:/Makefile?ds=sidebyside diff --git a/Makefile b/Makefile index 0647549..d2a3e7c 100644 --- a/Makefile +++ b/Makefile @@ -1,47 +1,100 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # $FreeBSD: src/lib/libc/Makefile,v 1.31 2001/08/13 21:48:43 peter Exp $ # -# All library objects contain rcsid strings by default; they may be -# excluded as a space-saving measure. To produce a library that does -# not contain these strings, delete -DLIBC_RCS and -DSYSLIBC_RCS -# from CFLAGS below. To remove these strings from just the system call -# stubs, remove just -DSYSLIBC_RCS from CFLAGS. -# # Yes, we build everything with -g, and strip it out later... # +# -faltivec now disables inlining, so we can't use it globally. Fortunately, +# only two files need altivec support, so we use file-specific CFLAGS to add +# the option when needed. +# LIB=c SHLIB_MAJOR= 1 SHLIB_MINOR= 0 -CC_3_3_OR_GREATER != ${.CURDIR}/cc-3.3-or-greater -.if (${CC_3_3_OR_GREATER} != YES) -CC = gcc-3.3 + +.include +.include + +.if !empty(MACHINE_ARCH:M*64) +LP64 = 1 .endif -.if (${MACHINE_ARCH} == unknown) -MACHINE_ARCH != /usr/bin/arch -.endif -.if (${MACHINE_ARCH} == ppc) -CFLAGS += -faltivec -DALTIVEC +# RC_TARGET_CONFIG may not be set, so default to MacOSX (which is good enough +# for installsrc to autopatch all files). +.ifndef RC_TARGET_CONFIG +RC_TARGET_CONFIG = MacOSX +.endif + +# Use default compiler, so comment out OTHERCC +#OTHERCC = gcc-4.0 +# HOSTCC is the compiler on the local host, so we need to unset any SDKROOT +# to before calling PATH_OF_COMMAND +.ifdef OTHERCC +MYCC != ${PATH_OF_COMMAND} ${OTHERCC} +HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} ${OTHERCC} +.else +MYCC = ${CC} +HOSTCC != export -n SDKROOT && ${PATH_OF_COMMAND} cc +.endif +GCC_VERSION != ${MYCC} -dumpversion | ${SED} -e 's/^\([^.]*\.[^.]*\).*/\1/' +GCC_42 != ${PERL} -e "print ($(GCC_VERSION) >= 4.2 ? 'YES' : 'NO')" + +.ifdef ALTLIBCHEADERS +INCLUDEDIR = ${ALTLIBCHEADERS} +LIBCFLAGS += -I${INCLUDEDIR} +.else # !ALTLIBCHEADERS +INCLUDEDIR = ${SDKROOT}/usr/include +.endif # ALTLIBCHEADERS +FRAMEWORKS = ${OBJROOT}/Frameworks +PRIVATEHEADERS = ${FRAMEWORKS}/System.framework/PrivateHeaders +PRIVINC = -I${PRIVATEHEADERS} +LIBCFLAGS += ${PRIVINC} + +SYMROOTINC = ${SYMROOT}/include +CFLAGS = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} -std=gnu99 -fno-common -fno-builtin -Wmost +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 +CFLAGS += -DNOID -DLIBC_MAJOR=${SHLIB_MAJOR} +CFLAGS += -I${.OBJDIR} -I${SYMROOTINC} -I${.CURDIR}/include +AINC = -g -arch ${CCARCH} ${RC_NONARCH_CFLAGS} +AINC += -I${.CURDIR}/${MACHINE_ARCH} ${PRIVINC} +.if $(MACHINE_ARCH) != arm +CFLAGS += -force_cpusubtype_ALL +AINC += -force_cpusubtype_ALL +.endif +.ifdef SDKROOT +CFLAGS += -isysroot '${SDKROOT}' +AINC += -isysroot '${SDKROOT}' +.endif # SDKROOT + +.if ${GCC_42} != YES +CFLAGS += -no-cpp-precomp +AINC += -no-cpp-precomp .endif -CFLAGS += -DNOID -I${.CURDIR}/include -I${.CURDIR}/include/objc -PRIVINC = ${NEXT_ROOT}/System/Library/Frameworks/System.framework/PrivateHeaders -CFLAGS += -I${PRIVINC} -CFLAGS += -DLIBC_MAJOR=${SHLIB_MAJOR} -no-cpp-precomp -force_cpusubtype_ALL -CFLAGS += -arch ${MACHINE_ARCH} -fno-common -pipe -Wmost -g -CFLAGS += -finline-limit=5000 -D__FBSDID=__RCSID -Wno-long-double -CFLAGS += -D__APPLE_PR3275149_HACK__ -AINC= -I${.CURDIR}/${MACHINE_ARCH} -no-cpp-precomp -force_cpusubtype_ALL -AINC+=-arch ${MACHINE_ARCH} -g CLEANFILES+=tags INSTALL_PIC_ARCHIVE= yes PRECIOUSLIB= yes +# workaround for 3649783 +AINC += -fdollars-in-identifiers + # If these aren't set give it expected defaults DSTROOT ?= / OBJROOT ?= . SRCROOT ?= ${.CURDIR} +.ifndef SYMROOT +SYMROOT = ${.CURDIR}/SYMROOT +_x_ != ${TEST} -d ${SYMROOT} || ${MKDIR} ${SYMROOT} +.endif DESTDIR ?= ${DSTROOT} MAKEOBJDIR ?= ${OBJROOT} +# add version string +SRCS += libc_version.c +libc_version.c: + ${SDKROOT}/Developer/Makefiles/bin/version.pl Libc > $@ + +.include "Makefile.features" .include "${.CURDIR}/Makefile.inc" .include "Makefile.xbs" + +MANFILTER = ${UNIFDEF} -t ${UNIFDEFARGS} +.include .include