tweak.mk 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ifeq ($(_THEOS_RULES_LOADED),)
  2. include $(THEOS_MAKE_PATH)/rules.mk
  3. endif
  4. .PHONY: internal-tweak-all_ internal-tweak-stage_
  5. LOCAL_INSTALL_PATH ?= $(strip $($(THEOS_CURRENT_INSTANCE)_INSTALL_PATH))
  6. ifeq ($(LOCAL_INSTALL_PATH),)
  7. LOCAL_INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries
  8. endif
  9. _LOCAL_USE_SUBSTRATE = $(or $($(THEOS_CURRENT_INSTANCE)_USE_SUBSTRATE),$(_THEOS_TARGET_DEFAULT_USE_SUBSTRATE),$(_THEOS_TRUE))
  10. ifeq ($(call __theos_bool,$(_LOCAL_USE_SUBSTRATE)),$(_THEOS_TRUE))
  11. _THEOS_INTERNAL_LDFLAGS += -lsubstrate
  12. else
  13. _THEOS_INTERNAL_LOGOSFLAGS += -c generator=internal
  14. endif
  15. include $(THEOS_MAKE_PATH)/instance/library.mk
  16. internal-tweak-all_:: internal-library-all_
  17. internal-tweak-compile: internal-library-compile
  18. ifneq ($(strip $($(THEOS_CURRENT_INSTANCE)_BUNDLE_RESOURCE_DIRS) $($(THEOS_CURRENT_INSTANCE)_BUNDLE_RESOURCE_FILES)),)
  19. _LOCAL_BUNDLE_INSTALL_PATH = $(or $($(THEOS_CURRENT_INSTANCE)_BUNDLE_INSTALL_PATH),/Library/Application Support/$(THEOS_CURRENT_INSTANCE))
  20. _LOCAL_BUNDLE_NAME = $(or $($(THEOS_CURRENT_INSTANCE)_BUNDLE_NAME),$(THEOS_CURRENT_INSTANCE))
  21. _LOCAL_BUNDLE_EXTENSION = $(or $($(THEOS_CURRENT_INSTANCE)_BUNDLE_EXTENSION),bundle)
  22. _THEOS_SHARED_BUNDLE_BUILD_PATH = $(THEOS_OBJ_DIR)/$(_LOCAL_BUNDLE_NAME).$(_LOCAL_BUNDLE_EXTENSION)
  23. _THEOS_SHARED_BUNDLE_STAGE_PATH = $(THEOS_STAGING_DIR)$(_LOCAL_BUNDLE_INSTALL_PATH)/$(_LOCAL_BUNDLE_NAME).$(_LOCAL_BUNDLE_EXTENSION)
  24. include $(THEOS_MAKE_PATH)/instance/shared/bundle.mk
  25. internal-tweak-all_:: shared-instance-bundle-all
  26. internal-tweak-stage_:: shared-instance-bundle-stage
  27. endif
  28. ifneq ($($(THEOS_CURRENT_INSTANCE)_INSTALL),0)
  29. internal-tweak-stage_:: $(_EXTRA_TARGET) internal-library-stage_
  30. $(ECHO_NOTHING)if [ -f $(THEOS_CURRENT_INSTANCE).plist ]; then cp $(THEOS_CURRENT_INSTANCE).plist "$(THEOS_STAGING_DIR)$(LOCAL_INSTALL_PATH)/"; fi$(ECHO_END)
  31. endif
  32. $(eval $(call __mod,instance/tweak.mk))