+.if !empty $(MACHINE_ARCH:M*64)
+LP64 = 1
+.endif
+# 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
+#CC = gcc-4.0
+GCC_VERSION != cc -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 -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
+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