subproject.mk 1.1 KB

123456789101112131415161718192021222324
  1. ifeq ($(_THEOS_RULES_LOADED),)
  2. include $(THEOS_MAKE_PATH)/rules.mk
  3. endif
  4. .PHONY: internal-subproject-all_ internal-subproject-stage_ internal-subproject-compile
  5. ifeq ($(_THEOS_MAKE_PARALLEL_BUILDING), no)
  6. internal-subproject-all_:: $(_OBJ_DIR_STAMPS) $(THEOS_OBJ_DIR)/$(THEOS_CURRENT_INSTANCE).$(THEOS_SUBPROJECT_PRODUCT)
  7. else
  8. internal-subproject-all_:: $(_OBJ_DIR_STAMPS)
  9. $(ECHO_NOTHING)$(MAKE) -f $(_THEOS_PROJECT_MAKEFILE_NAME) --no-print-directory --no-keep-going \
  10. internal-subproject-compile \
  11. _THEOS_CURRENT_TYPE=$(_THEOS_CURRENT_TYPE) THEOS_CURRENT_INSTANCE=$(THEOS_CURRENT_INSTANCE) _THEOS_CURRENT_OPERATION=compile \
  12. THEOS_BUILD_DIR="$(THEOS_BUILD_DIR)" _THEOS_MAKE_PARALLEL=yes$(ECHO_END)
  13. internal-subproject-compile: $(THEOS_OBJ_DIR)/$(THEOS_CURRENT_INSTANCE).$(THEOS_SUBPROJECT_PRODUCT)
  14. endif
  15. $(THEOS_OBJ_DIR)/$(THEOS_CURRENT_INSTANCE).$(THEOS_SUBPROJECT_PRODUCT): $(OBJ_FILES_TO_LINK)
  16. $(ECHO_LINKING)$(TARGET_LD) -nostdlib -r -d $(ADDITIONAL_LDFLAGS) $(_THEOS_TARGET_LDFLAGS) $(LDFLAGS) -o $@ $^$(ECHO_END)
  17. @echo "$(_THEOS_INTERNAL_LDFLAGS)" > $(THEOS_OBJ_DIR)/$(THEOS_CURRENT_INSTANCE).ldflags
  18. $(eval $(call __mod,instance/subproject.mk))