# ********************************************************************** # # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** # ---------------------------------------------------------------------- # Don't change anything below this line! # ---------------------------------------------------------------------- # # Objective-C mapping configurations # supported-configs = shared static arc-shared arc-static ifeq ($(os),Darwin) include $(lang_srcdir)/config/Make.xcodesdk.rules endif ifneq ($(filter arc-%,$(CONFIGS)),) # Make sure that the non-ARC configuration is also enabled override CONFIGS := $(call unique,$(CONFIGS) $(patsubst arc-%,%,$(CONFIGS))) endif # # Build only few components with the static configuration (libraries) # static_components = Ice IceSSL IceIAP IceObjC IceSSLObjC IceIAPObjC Glacier2ObjC IceStormObjC IceGridObjC static_projects = test/% static_ldflags += $(if $(filter program,$($1_target)),-ObjC) # # Build only the tests with the ARC configuration # arc_projects = test/Slice/% test/Ice/% # # Define the arc configuration to build the tests with ARC support. # # Note that we clear the dependency variable to not include the "arc" # sub-configuration into the dependency name (for example, if "client" # depends on "IceObjC", client[osx-arc-shared] will still depend on # Ice[osx-shared] not Ice[osx-arc-shared]). This is necessary since # we don't have an ARC specific build of the libraries. # arc_cppflags := -fobjc-arc -fobjc-arc-exceptions arc_dependency := # # Define slice2objc target extension since it can't be figured out # automatically from the slice2objc translator name. # slice2objc_targetext = m # Rule for installing headers file from include/objc directory ifeq ($(filter all obj%c,$(ICE_BIN_DIST)),) $(DESTDIR)$(install_includedir)/objc: $(Q)$(MKDIR) -p $(DESTDIR)$(install_includedir)/objc $(DESTDIR)$(install_includedir)/objc/%.h: include/objc/%.h | $(DESTDIR)$(install_includedir)/objc $(Q)$(call install-data,objc/$(*).h,include,$(DESTDIR)$(install_includedir)) endif # # $(make-objc-src-project $1=project) # define make-objc-src-project ifeq ($(filter all obj%c,$(ICE_BIN_DIST)),) $1_slicecompiler := slice2objc $1_sliceflags += -I$(slicedir) $1_cppflags += -I$(includedir) -I$(includedir)/generated $1_ldflags += -framework Foundation $(make-project) srcs:: $1 endif endef # # $(make-objc-test-project $1=project) # define make-objc-test-project $1_slicecompiler := slice2objc $1_sliceflags := -I$(slicedir) $$($1_sliceflags) $1_cppflags := -I$(includedir) -Itest/include -I$1 -I$1/generated $$($1_cppflags) $1_ldflags += -framework Foundation ifeq ($(filter all obj%c,$(ICE_BIN_DIST)),) $1_cppflags += -I$(includedir)/generated endif $(make-project) tests:: $1 endef # # $(create-objc-test-project $1=test) # define create-objc-test-project $1_srcext := m $1_dependencies := $$(or $$($1_dependencies),TestCommonObjC IceObjC) $1_cppflags += -Itest/Ice # Also link with IceSSL when compiling the project with the static configuration $1[static]_dependencies := IceSSL # Dependencies for Xcode SDK configuration $1[xcodesdk]_dependencies := IceSSL $(create-test-project) endef