~ chicken-core (chicken-5) /Makefile.ios


  1# Makefile.ios - configuration for Apple iOS -*- Makefile -*-
  2#
  3# Copyright (c) 2013, The CHICKEN Team
  4# All rights reserved.
  5#
  6# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
  7# conditions are met:
  8#
  9#   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
 10#     disclaimer. 
 11#   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
 12#     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 promote
 14#     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 EXPRESS
 17# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 18# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
 19# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 22# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 23# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 24# POSSIBILITY OF SUCH DAMAGE.
 25
 26SRCDIR ?= ./
 27
 28# platform configuration
 29
 30# for simulator:  ARCH ?= i386
 31ARCH ?= armv7
 32XCODE_PATH ?= /Applications/Xcode.app
 33XCODE_DEVELOPER ?= $(XCODE_PATH)/Contents/Developer
 34# for Xcode 4:  XCODE_TOOLPATH ?= $(XCODE_DEVELOPER)/Toolchains/XCodeDefault.xctoolchain/usr/bin
 35XCODE_TOOLPATH ?= $(XCODE_DEVELOPER)/usr/bin
 36# for simulator:  XCODE_SDK ?= $(XCODE_DEVELOPER)/Platforms/iPhoneSimulator.platform/Developer/SDKs/ipHoneSimulator7.0.sdk
 37XCODE_SDK ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
 38STATICBUILD = 1
 39
 40# options
 41
 42# for Xcode 4:  C_COMPILER ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/iPhoneOS.platform/Developer/usr/bin
 43C_COMPILER ?= $(XCODE_TOOLPATH)/gcc
 44LIBRARIAN ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
 45C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H -mno-thumb -isysroot $(XCODE_SDK) -arch $(ARCH)
 46ifdef DEBUGBUILD
 47C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
 48else
 49ifdef OPTIMIZE_FOR_SPEED
 50C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3 -fomit-frame-pointer
 51else
 52C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer
 53endif
 54endif
 55LIBRARIAN_OPTIONS = scru
 56ASSEMBLER_OPTIONS =
 57LINKER_OPTIONS = -isysroot $(XCODE_SDK) -arch $(ARCH)
 58
 59# special files
 60
 61CHICKEN_CONFIG_H = chicken-config.h
 62
 63# select default and internal settings
 64
 65include $(SRCDIR)/defaults.make
 66
 67chicken-config.h: chicken-defaults.h
 68	echo "/* GENERATED */" >$@.tmp
 69	echo "#define STATICBUILD 1" >>$@.tmp
 70	echo "#define HAVE_DIRENT_H 1" >>$@.tmp
 71	echo "#define HAVE_INTTYPES_H 1" >>$@.tmp
 72	echo "#define HAVE_LIMITS_H 1" >>$@.tmp
 73	echo "#define HAVE_LONG_LONG 1" >>$@.tmp
 74	echo "#define HAVE_MEMMOVE 1" >>$@.tmp
 75	echo "#define HAVE_MEMORY_H 1" >>$@.tmp
 76	echo "#define HAVE_SIGACTION 1" >>$@.tmp
 77	echo "#define HAVE_SIGSETJMP 1" >>$@.tmp
 78	echo "#define HAVE_SIGPROCMASK 1" >>$@.tmp
 79	echo "#define HAVE_STDINT_H 1" >>$@.tmp
 80	echo "#define HAVE_STDLIB_H 1" >>$@.tmp
 81	echo "#define HAVE_STRERROR 1" >>$@.tmp
 82	echo "#define HAVE_STRINGS_H 1" >>$@.tmp
 83	echo "#define HAVE_STRING_H 1" >>$@.tmp
 84	echo "#define HAVE_STRTOLL 1" >>$@.tmp
 85	echo "#define HAVE_STRTOQ 1" >>$@.tmp
 86	echo "#define HAVE_SYS_STAT_H 1" >>$@.tmp
 87	echo "#define HAVE_SYS_TYPES_H 1" >>$@.tmp
 88	echo "#define HAVE_UNISTD_H 1" >>$@.tmp
 89	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@.tmp
 90	echo "#define STDC_HEADERS 1" >>$@.tmp
 91	echo "#define HAVE_ALLOCA 1" >>$@.tmp
 92	echo "#define HAVE_ALLOCA_H 1" >>$@.tmp
 93	echo "#define HAVE_ERRNO_H 1" >>$@.tmp
 94	echo "#define HAVE_SYSEXITS_H 1" >>$@.tmp
 95# TODO: Use MacOS exe path mechanism?
 96	echo "#define SEARCH_EXE_PATH 1" >>$@.tmp
 97	echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@.tmp
 98ifdef GCHOOKS
 99	echo "#define C_GC_HOOKS" >>$@.tmp
100endif
101	cat $@.tmp chicken-defaults.h >$@.tmp2
102	rm $@.tmp
103	mv $@.tmp2 $@
104
105include $(SRCDIR)/rules.make
Trap