# # File: Makefile.core.iPhoneOS # Author: Mike Frandsen # Date: Mon Dec 17, 2012 # # Description: # Common compilation options and variable definitions # for iOS to be built on a Mac. Started from macosx Makefile. # # Use ?= to allow user to customize XCODE_DEVELOPER path externally XCODE_DEVELOPER ?= /Applications/Xcode.app/Contents/Developer # LOCAL_PLATFORM_NAME and XCODE_SDK_VERSION to be set by Makefile that includes this one DEVROOT = $(XCODE_DEVELOPER)/Platforms/$(LOCAL_PLATFORM_NAME).platform/Developer SDKROOT = ${DEVROOT}/SDKs/$(LOCAL_PLATFORM_NAME)$(XCODE_SDK_VERSION).sdk ifeq ($(strip $(wildcard ${SDKROOT})),) $(error "Check XCODE_SDK_VERSION=${XCODE_SDK_VERSION}; Can't find SDKROOT ${SDKROOT}") endif # No TCL Libraries by default TCL_INCLUDE = TCL_LIBRARY = NO_TCL = X # Use the GNU C compiler. GCC_FLAGS = -Wreturn-type -Wimplicit # Using XCODE_DEVELOPER path not DEVROOT since tools not always available CC = ${XCODE_DEVELOPER}/usr/bin/gcc $(GCC_FLAGS) -Wimplicit-int CXX = ${XCODE_DEVELOPER}/usr/bin/g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES # Can set for C++ 11 and force libc++ (may be useful if targeting before iOS 7.0). #CXX += -std=c++11 -stdlib=libc++ # NOTE: Not adding ${DEVROOT} below since tools not always available ARCHIVE = /usr/bin/ar cru RANLIB = /usr/bin/ranlib -s # Optional compilation flags. #OPTIMIZE_FLAGS = -g -O2 -fno-common OPTIMIZE_FLAGS = -O2 -fno-common -DNDEBUG DEBUG_FLAGS = -g -DDEBUG PROFILE_FLAGS = -pg -g -O2 # Optional linking flags. EXPORT_LDFLAGS = # Shared compilation flags. # Introduced variable below for shared flags but is only used locally to this Makefile # NOTE: 5.1 is intended for compatibility. 7.0 onward uses libc++ instead of libstdc++. LOCAL_COMMON_FLAGS = $(INCLUDES) -DHAVE_ZOPEN -DNO_ICONV "-miphoneos-version-min=7.0" -arch $(LOCAL_TARGET_ARCH) -pipe -no-cpp-precomp -isysroot ${SDKROOT} -fPIC CFLAGS = $(ADDITIONAL_CFLAGS) $(LOCAL_COMMON_FLAGS) CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(LOCAL_COMMON_FLAGS) # Shared linking flags. # MWF: Added "-e _main" to avoid errors about missing "start" symbol LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR) -e _main # Other useful compilation flags. ADDITIONAL_CFLAGS = ADDITIONAL_CXXFLAGS = # Other useful include directories. ADDITIONAL_INCLUDES = # Other useful linking flags; include this and set if necessary #ADDITIONAL_LDFLAGS = # Other useful libraries. ADDITIONAL_LIBRARIES = # Generate dependencies from source files. GEN_DEP = $(CC) $(CFLAGS) -MM GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM # Run lint. LINT = lint LINT_FLAGS = -DDEBUG $(CFLAGS) # Location of gawk binary varies, let's assume it's in the PATH GAWK = $(shell which gawk) # Override to nothing MATHERR_LINK =