2017-01-12 05:01:52 -05:00
|
|
|
TARGET = alacritty
|
|
|
|
|
|
|
|
APP_NAME = Alacritty.app
|
|
|
|
ASSETS_DIR = assets
|
|
|
|
RELEASE_DIR = target/release
|
|
|
|
APP_TEMPLATE = $(ASSETS_DIR)/osx/$(APP_NAME)
|
|
|
|
APP_DIR = $(RELEASE_DIR)/osx
|
2017-01-13 02:25:02 -05:00
|
|
|
APP_BINARY = $(RELEASE_DIR)/$(TARGET)
|
2017-01-12 05:01:52 -05:00
|
|
|
APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS
|
|
|
|
|
|
|
|
DMG_NAME = Alacritty.dmg
|
|
|
|
DMG_DIR = $(RELEASE_DIR)/osx
|
|
|
|
|
|
|
|
vpath $(TARGET) $(RELEASE_DIR)
|
|
|
|
vpath $(APP_NAME) $(APP_DIR)
|
2017-01-13 02:25:02 -05:00
|
|
|
vpath $(DMG_NAME) $(APP_DIR)
|
2017-01-12 05:01:52 -05:00
|
|
|
|
|
|
|
all: help
|
|
|
|
|
|
|
|
help: ## Prints help for targets with comments
|
|
|
|
@grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
2017-01-13 02:25:02 -05:00
|
|
|
binary: | $(TARGET) ## Build release binary with cargo
|
2017-01-12 05:01:52 -05:00
|
|
|
$(TARGET):
|
2017-01-13 02:25:02 -05:00
|
|
|
cargo build --release
|
2017-01-12 05:01:52 -05:00
|
|
|
|
|
|
|
app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary
|
|
|
|
$(APP_NAME): $(TARGET) $(APP_TEMPLATE)
|
|
|
|
@mkdir -p $(APP_DIR)
|
|
|
|
@cp -R $(APP_TEMPLATE) $(APP_DIR)
|
2017-01-13 02:25:02 -05:00
|
|
|
@cp $(APP_BINARY) $(APP_BINARY_DIR)
|
|
|
|
@echo "Created '$@' in '$(APP_DIR)'"
|
2017-01-12 05:01:52 -05:00
|
|
|
|
|
|
|
dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg
|
|
|
|
$(DMG_NAME): $(APP_NAME)
|
|
|
|
@echo "Packing disk image..."
|
|
|
|
@hdiutil create $(DMG_DIR)/$(DMG_NAME) \
|
|
|
|
-volname "Alacritty" \
|
|
|
|
-fs HFS+ \
|
|
|
|
-srcfolder $(APP_DIR) \
|
|
|
|
-ov -format UDZO
|
2017-01-13 02:25:02 -05:00
|
|
|
@echo "Packed '$@' in '$(APP_DIR)'"
|
|
|
|
|
|
|
|
install: $(DMG_NAME) ## Mount disk image
|
|
|
|
@open $(DMG_DIR)/$(DMG_NAME)
|
2017-01-12 05:01:52 -05:00
|
|
|
|
2017-01-13 02:25:02 -05:00
|
|
|
.PHONY: app binary clean dmg install
|
2017-01-12 05:01:52 -05:00
|
|
|
|
|
|
|
clean: ## Remove all artifacts
|
|
|
|
-rm -rf $(APP_DIR)
|