stage.mk 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. ifeq ($(_THEOS_STAGING_RULES_LOADED),)
  2. _THEOS_STAGING_RULES_LOADED := 1
  3. .PHONY: stage before-stage internal-stage after-stage
  4. # For the toplevel invocation of make, mark 'all' and the *-stage rules as prerequisites.
  5. # We do not do this for anything else, because otherwise, all the staging rules would run for every subproject.
  6. ifeq ($(_THEOS_TOP_INVOCATION_DONE),)
  7. stage:: all before-stage internal-stage after-stage
  8. else # _THEOS_TOP_INVOCATION_DONE
  9. stage:: internal-stage
  10. endif
  11. # Only do the master staging rules if we're the toplevel make invocation.
  12. ifeq ($(_THEOS_TOP_INVOCATION_DONE),)
  13. before-stage::
  14. $(ECHO_NOTHING)rm -rf "$(THEOS_STAGING_DIR)"$(ECHO_END)
  15. $(ECHO_NOTHING)$(FAKEROOT) -c$(ECHO_END)
  16. $(ECHO_NOTHING)mkdir -p "$(THEOS_STAGING_DIR)"$(ECHO_END)
  17. else # _THEOS_TOP_INVOCATION_DONE
  18. before-stage::
  19. @:
  20. endif # _THEOS_TOP_INVOCATION_DONE
  21. internal-stage::
  22. $(ECHO_NOTHING)[ -d layout ] && rsync -a "layout/" "$(THEOS_STAGING_DIR)" --exclude "DEBIAN" $(_THEOS_RSYNC_EXCLUDE_COMMANDLINE) || true$(ECHO_END)
  23. after-stage::
  24. @:
  25. endif # _THEOS_STAGING_RULES_LOADED