X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=distrib%2FMacOS%2FMakefile;h=5287292fc010a3cf0926dbad10d376d620879a36;hb=f9caab8ed259e6aed792da54a4fb55ee5443c2ba;hp=6b44d15e5909f986d8af9008eeceda813b16fc20;hpb=b78367803c357d76b4538ea92414b3735de94740;p=ghc-hetmet.git diff --git a/distrib/MacOS/Makefile b/distrib/MacOS/Makefile index 6b44d15..5287292 100644 --- a/distrib/MacOS/Makefile +++ b/distrib/MacOS/Makefile @@ -7,7 +7,11 @@ # framework-pkg [MacOS only] # Builds /Library/Frameworks/GHC.framework wrapped into a Mac # installer package; must be executed in a ./configure'd tree -# (--prefix doesn't matter as it will be overridden) +# (--prefix doesn't matter as it will be overridden); other +# ./configure arguments are passed through, unless overwritten +# with XCODE_EXTRA_CONFIGURE_ARGS. A deployment target can +# be specified by setting the corresponding ./configure +# argument or by setting MACOSX_DEPLOYMENT_TARGET. # # framework-binary-dist [MacOS only] # Builds GHC.framework encapsulating a binary distribution @@ -34,6 +38,27 @@ SHORT_VERSION_STRING = $(ProjectVersion) # Name of the installer package PACKAGE_NAME = GHC-$(ProjectVersion)-$(TargetArch_CPP).pkg +# Determine arguments that should be passed to ./configure from within Xcode +# +# By default, we pass whatever was used when the present tree was configured. +# The user can override this by setting XCODE_EXTRA_CONFIGURE_ARGS. If +# MACOSX_DEPLOYMENT_TARGET is set, the target is added to whatever arguments +# are passed. +export XCODE_EXTRA_CONFIGURE_ARGS +ifeq "$(XCODE_EXTRA_CONFIGURE_ARGS)" "" +XCODE_EXTRA_CONFIGURE_ARGS = $(shell echo $(CONFIGURE_ARGS)) +endif +ifneq "$(MACOSX_DEPLOYMENT_TARGET)" "" +XCODE_EXTRA_CONFIGURE_ARGS += --with-macosx-deployment-target=$(MACOSX_DEPLOYMENT_TARGET) +endif + +# Determine whether we need to pass a "-target" option to packagemaker +# +# If a deployment target has been set, we use the same target for packagemaker. +ifneq "$(MACOSX_DEPLOYMENT_TARGET)" "" +PACKAGEMAKER_TARGET = -target $(MACOSX_DEPLOYMENT_TARGET) +endif + # Xcode's installation build product location (this is where the GHC.framework # is assembled) DSTROOT=/tmp/GHC.dst @@ -53,7 +78,7 @@ PACKAGEMAKER=/Developer/usr/bin/packagemaker # and permissions for all files (as well as prevent correct setting of those # for files that are not in the content list). framework-pkg: - -chmod -R u+w $(DSTROOT) + -chmod -fR u+w $(DSTROOT) -$(RM) -rf $(DSTROOT) mkdir -p $(TOOLS_SYSTEM) cp installer-scripts/Uninstaller $(TOOLS_SYSTEM) @@ -63,7 +88,8 @@ framework-pkg: FRAMEWORK_VERSION=$(FRAMEWORK_VERSION)\ CURRENT_LIBRARY_VERSION=$(FRAMEWORK_VERSION) -$(RM) -f GHC-system.pmdoc/*-contents.xml - $(PACKAGEMAKER) -v --doc GHC-system.pmdoc -o $(TOP)/$(PACKAGE_NAME) + $(PACKAGEMAKER) -v --doc GHC-system.pmdoc\ + $(PACKAGEMAKER_TARGET) -o $(TOP)/$(PACKAGE_NAME) # Instead of making 'binary-dist' a Makefile dependency, we let xcodebuild call # 'make binary-dist'. This has the advantage that xcode knows the framework