mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Add install target
This commit is contained in:
parent
0a6ffaab5f
commit
dc72b1324f
1 changed files with 11 additions and 9 deletions
20
Makefile
20
Makefile
|
@ -3,34 +3,33 @@ TARGET = alacritty
|
||||||
APP_NAME = Alacritty.app
|
APP_NAME = Alacritty.app
|
||||||
ASSETS_DIR = assets
|
ASSETS_DIR = assets
|
||||||
RELEASE_DIR = target/release
|
RELEASE_DIR = target/release
|
||||||
BINARY_FILE = $(RELEASE_DIR)/$(TARGET)
|
|
||||||
APP_TEMPLATE = $(ASSETS_DIR)/osx/$(APP_NAME)
|
APP_TEMPLATE = $(ASSETS_DIR)/osx/$(APP_NAME)
|
||||||
APP_DIR = $(RELEASE_DIR)/osx
|
APP_DIR = $(RELEASE_DIR)/osx
|
||||||
|
APP_BINARY = $(RELEASE_DIR)/$(TARGET)
|
||||||
APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS
|
APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS
|
||||||
|
|
||||||
|
|
||||||
DMG_NAME = Alacritty.dmg
|
DMG_NAME = Alacritty.dmg
|
||||||
DMG_DIR = $(RELEASE_DIR)/osx
|
DMG_DIR = $(RELEASE_DIR)/osx
|
||||||
|
|
||||||
vpath $(TARGET) $(RELEASE_DIR)
|
vpath $(TARGET) $(RELEASE_DIR)
|
||||||
vpath $(APP_NAME) $(APP_DIR)
|
vpath $(APP_NAME) $(APP_DIR)
|
||||||
|
vpath $(DMG_NAME) $(APP_DIR)
|
||||||
|
|
||||||
all: help
|
all: help
|
||||||
|
|
||||||
help: ## Prints help for targets with comments
|
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}'
|
@grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
binary: | $(TARGET) ## Build release binary
|
binary: | $(TARGET) ## Build release binary with cargo
|
||||||
$(TARGET):
|
$(TARGET):
|
||||||
@echo "Please build '$@' with 'cargo build --release'"
|
cargo build --release
|
||||||
|
|
||||||
app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary
|
app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary
|
||||||
$(APP_NAME): $(TARGET) $(APP_TEMPLATE)
|
$(APP_NAME): $(TARGET) $(APP_TEMPLATE)
|
||||||
@mkdir -p $(APP_DIR)
|
@mkdir -p $(APP_DIR)
|
||||||
@cp -R $(APP_TEMPLATE) $(APP_DIR)
|
@cp -R $(APP_TEMPLATE) $(APP_DIR)
|
||||||
@mkdir $(APP_BINARY_DIR)
|
@cp $(APP_BINARY) $(APP_BINARY_DIR)
|
||||||
@cp $(BINARY_FILE) $(APP_BINARY_DIR)
|
@echo "Created '$@' in '$(APP_DIR)'"
|
||||||
@echo "$@ created in $(APP_DIR)"
|
|
||||||
|
|
||||||
dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg
|
dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg
|
||||||
$(DMG_NAME): $(APP_NAME)
|
$(DMG_NAME): $(APP_NAME)
|
||||||
|
@ -40,9 +39,12 @@ $(DMG_NAME): $(APP_NAME)
|
||||||
-fs HFS+ \
|
-fs HFS+ \
|
||||||
-srcfolder $(APP_DIR) \
|
-srcfolder $(APP_DIR) \
|
||||||
-ov -format UDZO
|
-ov -format UDZO
|
||||||
@echo "$@ packed in $(APP_DIR)"
|
@echo "Packed '$@' in '$(APP_DIR)'"
|
||||||
|
|
||||||
.PHONY: app binary clean dmg
|
install: $(DMG_NAME) ## Mount disk image
|
||||||
|
@open $(DMG_DIR)/$(DMG_NAME)
|
||||||
|
|
||||||
|
.PHONY: app binary clean dmg install
|
||||||
|
|
||||||
clean: ## Remove all artifacts
|
clean: ## Remove all artifacts
|
||||||
-rm -rf $(APP_DIR)
|
-rm -rf $(APP_DIR)
|
||||||
|
|
Loading…
Reference in a new issue