application.mk 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ifeq ($(_THEOS_RULES_LOADED),)
  2. include $(THEOS_MAKE_PATH)/rules.mk
  3. endif
  4. .PHONY: internal-application-all_ internal-application-stage_ internal-application-compile
  5. ifeq ($(findstring UIKit,$($(THEOS_CURRENT_INSTANCE)_FRAMEWORKS))$(findstring AppKit,$($(THEOS_CURRENT_INSTANCE)_FRAMEWORKS)),)
  6. _THEOS_INTERNAL_LDFLAGS += -framework UIKit
  7. ifeq ($(_THEOS_APPLICATION_WARNED_IMPLICIT_UIKIT_$(THEOS_CURRENT_INSTANCE)),)
  8. internal-application-all_::
  9. @$(PRINT_FORMAT_WARNING) "$(THEOS_CURRENT_INSTANCE): warning: Implicit UIKit linkage for application instances is deprecated. Please add \"UIKit\" to $(THEOS_CURRENT_INSTANCE)_FRAMEWORKS." >&2
  10. export _THEOS_APPLICATION_WARNED_IMPLICIT_UIKIT_$(THEOS_CURRENT_INSTANCE) = 1
  11. endif
  12. endif
  13. # Bundle Setup
  14. LOCAL_INSTALL_PATH ?= $(strip $($(THEOS_CURRENT_INSTANCE)_INSTALL_PATH))
  15. ifeq ($(LOCAL_INSTALL_PATH),)
  16. LOCAL_INSTALL_PATH = /Applications
  17. endif
  18. ifeq ($($(THEOS_CURRENT_INSTANCE)_BUNDLE_NAME),)
  19. LOCAL_BUNDLE_NAME = $(THEOS_CURRENT_INSTANCE)
  20. else
  21. LOCAL_BUNDLE_NAME = $($(THEOS_CURRENT_INSTANCE)_BUNDLE_NAME)
  22. endif
  23. _LOCAL_BUNDLE_FULL_NAME = $(LOCAL_BUNDLE_NAME).app
  24. _THEOS_SHARED_BUNDLE_BUILD_PATH = $(THEOS_OBJ_DIR)/$(_LOCAL_BUNDLE_FULL_NAME)
  25. _THEOS_SHARED_BUNDLE_STAGE_PATH = $(THEOS_STAGING_DIR)$(LOCAL_INSTALL_PATH)/$(_LOCAL_BUNDLE_FULL_NAME)
  26. _LOCAL_INSTANCE_TARGET := $(_LOCAL_BUNDLE_FULL_NAME)$(_THEOS_TARGET_BUNDLE_BINARY_SUBDIRECTORY)/$(THEOS_CURRENT_INSTANCE)$(TARGET_EXE_EXT)
  27. include $(THEOS_MAKE_PATH)/instance/shared/bundle.mk
  28. # End Bundle Setup
  29. ifeq ($(_THEOS_MAKE_PARALLEL_BUILDING), no)
  30. internal-application-all_:: $(_OBJ_DIR_STAMPS) shared-instance-bundle-all $(THEOS_OBJ_DIR)/$(_LOCAL_INSTANCE_TARGET)
  31. else
  32. internal-application-all_:: $(_OBJ_DIR_STAMPS) shared-instance-bundle-all
  33. $(ECHO_NOTHING)$(MAKE) -f $(_THEOS_PROJECT_MAKEFILE_NAME) --no-print-directory --no-keep-going \
  34. internal-application-compile \
  35. _THEOS_CURRENT_TYPE=$(_THEOS_CURRENT_TYPE) THEOS_CURRENT_INSTANCE=$(THEOS_CURRENT_INSTANCE) _THEOS_CURRENT_OPERATION=compile \
  36. THEOS_BUILD_DIR="$(THEOS_BUILD_DIR)" _THEOS_MAKE_PARALLEL=yes$(ECHO_END)
  37. internal-application-compile: $(THEOS_OBJ_DIR)/$(_LOCAL_INSTANCE_TARGET)
  38. endif
  39. $(eval $(call _THEOS_TEMPLATE_DEFAULT_LINKING_RULE,$(_LOCAL_INSTANCE_TARGET)))
  40. internal-application-stage_:: shared-instance-bundle-stage
  41. $(eval $(call __mod,instance/application.mk))