bundle.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ifeq ($(_THEOS_RULES_LOADED),)
  2. include $(THEOS_MAKE_PATH)/rules.mk
  3. endif
  4. .PHONY: internal-bundle-all_ internal-bundle-stage_ internal-bundle-compile
  5. ifeq ($(call __theos_bool,$(or $($(THEOS_CURRENT_INSTANCE)_DYNAMIC_LIBRARY),$(_THEOS_TRUE))),$(_THEOS_TRUE))
  6. _THEOS_INTERNAL_LDFLAGS += -dynamiclib
  7. endif
  8. # Bundle Setup
  9. LOCAL_BUNDLE_NAME = $(or $($(THEOS_CURRENT_INSTANCE)_BUNDLE_NAME),$(THEOS_CURRENT_INSTANCE))
  10. LOCAL_BUNDLE_EXTENSION = $(or $($(THEOS_CURRENT_INSTANCE)_BUNDLE_EXTENSION),bundle)
  11. _LOCAL_BUNDLE_FULL_NAME = $(LOCAL_BUNDLE_NAME).$(LOCAL_BUNDLE_EXTENSION)
  12. _THEOS_SHARED_BUNDLE_BUILD_PATH = $(THEOS_OBJ_DIR)/$(_LOCAL_BUNDLE_FULL_NAME)
  13. _THEOS_SHARED_BUNDLE_STAGE_PATH = $(THEOS_STAGING_DIR)$($(THEOS_CURRENT_INSTANCE)_INSTALL_PATH)/$(_LOCAL_BUNDLE_FULL_NAME)
  14. _LOCAL_INSTANCE_TARGET := $(_LOCAL_BUNDLE_FULL_NAME)$(_THEOS_TARGET_BUNDLE_BINARY_SUBDIRECTORY)/$(THEOS_CURRENT_INSTANCE)$(TARGET_EXE_EXT)
  15. include $(THEOS_MAKE_PATH)/instance/shared/bundle.mk
  16. # End Bundle Setup
  17. ifeq ($(_THEOS_MAKE_PARALLEL_BUILDING), no)
  18. internal-bundle-all_:: $(_OBJ_DIR_STAMPS) shared-instance-bundle-all $(THEOS_OBJ_DIR)/$(_LOCAL_INSTANCE_TARGET)
  19. else
  20. internal-bundle-all_:: $(_OBJ_DIR_STAMPS) shared-instance-bundle-all
  21. $(ECHO_NOTHING)$(MAKE) -f $(_THEOS_PROJECT_MAKEFILE_NAME) --no-print-directory --no-keep-going \
  22. internal-bundle-compile \
  23. _THEOS_CURRENT_TYPE=$(_THEOS_CURRENT_TYPE) THEOS_CURRENT_INSTANCE=$(THEOS_CURRENT_INSTANCE) _THEOS_CURRENT_OPERATION=compile \
  24. THEOS_BUILD_DIR="$(THEOS_BUILD_DIR)" _THEOS_MAKE_PARALLEL=yes$(ECHO_END)
  25. internal-bundle-compile: $(THEOS_OBJ_DIR)/$(_LOCAL_INSTANCE_TARGET)
  26. endif
  27. ifneq ($(OBJ_FILES_TO_LINK),)
  28. $(eval $(call _THEOS_TEMPLATE_DEFAULT_LINKING_RULE,$(_LOCAL_INSTANCE_TARGET),nowarn))
  29. else # OBJ_FILES_TO_LINK == ""
  30. $(THEOS_OBJ_DIR)/$(_LOCAL_INSTANCE_TARGET):
  31. $(NOTICE_EMPTY_LINKING)
  32. endif # OBJ_FILES_TO_LINK
  33. internal-bundle-stage_:: shared-instance-bundle-stage
  34. $(eval $(call __mod,instance/bundle.mk))