DIST_MOD	:= dist
DIST_SRC	:= $(PATH_SRC)/$(DIST_MOD)
DIST_BIN	:= $(PATH_BIN)/$(DIST_MOD)
DIST_OUT	:= $(PATH_BIN)/$(DIST_MOD).tar.gz
DIST_DEPS	:= $(DIST_BIN)/readme.txt $(DIST_BIN)/ahello1.com $(DIST_BIN)/ahello2.com

$(DIST_BIN): | @init
	$(call mb_mkdir,$(DIST_BIN))

$(DIST_BIN)/readme.txt: $(DIST_SRC)/readme.txt | $(DIST_BIN)
	$(call mb_conv_unix2dos,$<,$@)

$(DIST_BIN)/ahello1.com: bin/ahello-m80/ahello.com | $(DIST_BIN)
	$(call mb_copy,$<,$@)

$(DIST_BIN)/ahello2.com: bin/ahello-sdcc/ahello.com | $(DIST_BIN)
	$(call mb_copy,$<,$@)

$(DIST_BIN)/@prepare: | $(DIST_DEPS)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_BIN)/@prepare,"Prepare folder with binaries for distribution.") 
.PHONY: $(DIST_BIN)/@prepare

$(DIST_OUT): | $(DIST_BIN)/@prepare
	$(call mb_create_dist,$(DIST_BIN),$@)
MB_DOC_FIRE_TARGET += $(call mb_doc_target,$(DIST_OUT),"Build archive distribution artifact.")
MB_PROJ_PHASE_PACKAGE_DEPS += $(DIST_OUT)