~ chicken-core (chicken-5) /Makefile.ios
Trap1# Makefile.ios - configuration for Apple iOS -*- Makefile -*-2#3# Copyright (c) 2013, The CHICKEN Team4# All rights reserved.5#6# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following7# conditions are met:8#9# Redistributions of source code must retain the above copyright notice, this list of conditions and the following10# disclaimer.11# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following12# disclaimer in the documentation and/or other materials provided with the distribution.13# Neither the name of the author nor the names of its contributors may be used to endorse or promote14# products derived from this software without specific prior written permission.15#16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS17# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY18# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR19# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY22# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR23# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24# POSSIBILITY OF SUCH DAMAGE.2526SRCDIR ?= ./2728# platform configuration2930# for simulator: ARCH ?= i38631ARCH ?= armv732XCODE_PATH ?= /Applications/Xcode.app33XCODE_DEVELOPER ?= $(XCODE_PATH)/Contents/Developer34# for Xcode 4: XCODE_TOOLPATH ?= $(XCODE_DEVELOPER)/Toolchains/XCodeDefault.xctoolchain/usr/bin35XCODE_TOOLPATH ?= $(XCODE_DEVELOPER)/usr/bin36# for simulator: XCODE_SDK ?= $(XCODE_DEVELOPER)/Platforms/iPhoneSimulator.platform/Developer/SDKs/ipHoneSimulator7.0.sdk37XCODE_SDK ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk38STATICBUILD = 13940# options4142# for Xcode 4: C_COMPILER ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/iPhoneOS.platform/Developer/usr/bin43C_COMPILER ?= $(XCODE_TOOLPATH)/gcc44LIBRARIAN ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/Developer/usr/bin/ar45C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H -mno-thumb -isysroot $(XCODE_SDK) -arch $(ARCH)46ifdef DEBUGBUILD47C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused48else49ifdef OPTIMIZE_FOR_SPEED50C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3 -fomit-frame-pointer51else52C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer53endif54endif55LIBRARIAN_OPTIONS = scru56ASSEMBLER_OPTIONS =57LINKER_OPTIONS = -isysroot $(XCODE_SDK) -arch $(ARCH)5859# special files6061CHICKEN_CONFIG_H = chicken-config.h6263# select default and internal settings6465include $(SRCDIR)/defaults.make6667chicken-config.h: chicken-defaults.h68 echo "/* GENERATED */" >$@.tmp69 echo "#define STATICBUILD 1" >>$@.tmp70 echo "#define HAVE_DIRENT_H 1" >>$@.tmp71 echo "#define HAVE_INTTYPES_H 1" >>$@.tmp72 echo "#define HAVE_LIMITS_H 1" >>$@.tmp73 echo "#define HAVE_LONG_LONG 1" >>$@.tmp74 echo "#define HAVE_MEMMOVE 1" >>$@.tmp75 echo "#define HAVE_MEMORY_H 1" >>$@.tmp76 echo "#define HAVE_SIGACTION 1" >>$@.tmp77 echo "#define HAVE_SIGSETJMP 1" >>$@.tmp78 echo "#define HAVE_SIGPROCMASK 1" >>$@.tmp79 echo "#define HAVE_STDINT_H 1" >>$@.tmp80 echo "#define HAVE_STDLIB_H 1" >>$@.tmp81 echo "#define HAVE_STRERROR 1" >>$@.tmp82 echo "#define HAVE_STRINGS_H 1" >>$@.tmp83 echo "#define HAVE_STRING_H 1" >>$@.tmp84 echo "#define HAVE_STRTOLL 1" >>$@.tmp85 echo "#define HAVE_STRTOQ 1" >>$@.tmp86 echo "#define HAVE_SYS_STAT_H 1" >>$@.tmp87 echo "#define HAVE_SYS_TYPES_H 1" >>$@.tmp88 echo "#define HAVE_UNISTD_H 1" >>$@.tmp89 echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@.tmp90 echo "#define STDC_HEADERS 1" >>$@.tmp91 echo "#define HAVE_ALLOCA 1" >>$@.tmp92 echo "#define HAVE_ALLOCA_H 1" >>$@.tmp93 echo "#define HAVE_ERRNO_H 1" >>$@.tmp94 echo "#define HAVE_SYSEXITS_H 1" >>$@.tmp95# TODO: Use MacOS exe path mechanism?96 echo "#define SEARCH_EXE_PATH 1" >>$@.tmp97 echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@.tmp98ifdef GCHOOKS99 echo "#define C_GC_HOOKS" >>$@.tmp100endif101 cat $@.tmp chicken-defaults.h >$@.tmp2102 rm $@.tmp103 mv $@.tmp2 $@104105include $(SRCDIR)/rules.make