2017-01-12 05:01:52 -05:00
|
|
|
TARGET = alacritty
|
|
|
|
|
2019-04-01 18:41:20 -04:00
|
|
|
ASSETS_DIR = extra
|
2017-01-12 05:01:52 -05:00
|
|
|
RELEASE_DIR = target/release
|
2023-05-29 05:22:15 -04:00
|
|
|
MANPAGE = $(ASSETS_DIR)/man/alacritty.1.scd
|
|
|
|
MANPAGE-MSG = $(ASSETS_DIR)/man/alacritty-msg.1.scd
|
2023-06-11 20:23:41 -04:00
|
|
|
MANPAGE-CONFIG = $(ASSETS_DIR)/man/alacritty.5.scd
|
|
|
|
MANPAGE-CONFIG-BINDINGS = $(ASSETS_DIR)/man/alacritty-bindings.5.scd
|
2020-07-04 10:03:48 -04:00
|
|
|
TERMINFO = $(ASSETS_DIR)/alacritty.info
|
|
|
|
COMPLETIONS_DIR = $(ASSETS_DIR)/completions
|
|
|
|
COMPLETIONS = $(COMPLETIONS_DIR)/_alacritty \
|
2020-11-05 21:12:29 -05:00
|
|
|
$(COMPLETIONS_DIR)/alacritty.bash \
|
|
|
|
$(COMPLETIONS_DIR)/alacritty.fish
|
2020-07-04 10:03:48 -04:00
|
|
|
|
|
|
|
APP_NAME = Alacritty.app
|
2017-01-12 05:01:52 -05:00
|
|
|
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)
|
2020-11-05 21:12:29 -05:00
|
|
|
APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS
|
2020-07-04 10:03:48 -04:00
|
|
|
APP_EXTRAS_DIR = $(APP_DIR)/$(APP_NAME)/Contents/Resources
|
|
|
|
APP_COMPLETIONS_DIR = $(APP_EXTRAS_DIR)/completions
|
2017-01-12 05:01:52 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
help: ## Print this help message
|
2017-01-12 05:01:52 -05:00
|
|
|
@grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
2021-10-03 13:51:34 -04:00
|
|
|
binary: $(TARGET)-native ## Build a release binary
|
|
|
|
binary-universal: $(TARGET)-universal ## Build a universal release binary
|
2021-08-17 14:04:46 -04:00
|
|
|
$(TARGET)-native:
|
2019-01-06 14:12:30 -05:00
|
|
|
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release
|
2021-08-17 14:04:46 -04:00
|
|
|
$(TARGET)-universal:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release --target=x86_64-apple-darwin
|
|
|
|
MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --release --target=aarch64-apple-darwin
|
|
|
|
@lipo target/{x86_64,aarch64}-apple-darwin/release/$(TARGET) -create -output $(APP_BINARY)
|
2017-01-12 05:01:52 -05:00
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
app: $(APP_NAME)-native ## Create an Alacritty.app
|
|
|
|
app-universal: $(APP_NAME)-universal ## Create a universal Alacritty.app
|
|
|
|
$(APP_NAME)-%: $(TARGET)-%
|
2017-01-15 11:46:23 -05:00
|
|
|
@mkdir -p $(APP_BINARY_DIR)
|
2020-07-04 10:03:48 -04:00
|
|
|
@mkdir -p $(APP_EXTRAS_DIR)
|
|
|
|
@mkdir -p $(APP_COMPLETIONS_DIR)
|
2023-05-29 05:22:15 -04:00
|
|
|
@scdoc < $(MANPAGE) | gzip -c > $(APP_EXTRAS_DIR)/alacritty.1.gz
|
|
|
|
@scdoc < $(MANPAGE-MSG) | gzip -c > $(APP_EXTRAS_DIR)/alacritty-msg.1.gz
|
2023-06-11 20:23:41 -04:00
|
|
|
@scdoc < $(MANPAGE-CONFIG) | gzip -c > $(APP_EXTRAS_DIR)/alacritty.5.gz
|
|
|
|
@scdoc < $(MANPAGE-CONFIG-BINDINGS) | gzip -c > $(APP_EXTRAS_DIR)/alacritty-bindings.5.gz
|
2020-07-04 10:03:48 -04:00
|
|
|
@tic -xe alacritty,alacritty-direct -o $(APP_EXTRAS_DIR) $(TERMINFO)
|
2017-01-15 11:46:23 -05:00
|
|
|
@cp -fRp $(APP_TEMPLATE) $(APP_DIR)
|
|
|
|
@cp -fp $(APP_BINARY) $(APP_BINARY_DIR)
|
2020-07-04 10:03:48 -04:00
|
|
|
@cp -fp $(COMPLETIONS) $(APP_COMPLETIONS_DIR)
|
2018-10-31 15:48:04 -04:00
|
|
|
@touch -r "$(APP_BINARY)" "$(APP_DIR)/$(APP_NAME)"
|
2022-02-02 14:23:29 -05:00
|
|
|
@codesign --remove-signature "$(APP_DIR)/$(APP_NAME)"
|
|
|
|
@codesign --force --deep --sign - "$(APP_DIR)/$(APP_NAME)"
|
2021-08-17 14:04:46 -04:00
|
|
|
@echo "Created '$(APP_NAME)' in '$(APP_DIR)'"
|
2017-01-12 05:01:52 -05:00
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
dmg: $(DMG_NAME)-native ## Create an Alacritty.dmg
|
|
|
|
dmg-universal: $(DMG_NAME)-universal ## Create a universal Alacritty.dmg
|
|
|
|
$(DMG_NAME)-%: $(APP_NAME)-%
|
2017-01-12 05:01:52 -05:00
|
|
|
@echo "Packing disk image..."
|
2020-01-18 07:48:34 -05:00
|
|
|
@ln -sf /Applications $(DMG_DIR)/Applications
|
2017-01-12 05:01:52 -05:00
|
|
|
@hdiutil create $(DMG_DIR)/$(DMG_NAME) \
|
|
|
|
-volname "Alacritty" \
|
|
|
|
-fs HFS+ \
|
|
|
|
-srcfolder $(APP_DIR) \
|
|
|
|
-ov -format UDZO
|
2021-08-17 14:04:46 -04:00
|
|
|
@echo "Packed '$(APP_NAME)' in '$(APP_DIR)'"
|
2017-01-13 02:25:02 -05:00
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
install: $(INSTALL)-native ## Mount disk image
|
|
|
|
install-universal: $(INSTALL)-native ## Mount universal disk image
|
|
|
|
$(INSTALL)-%: $(DMG_NAME)-%
|
2017-01-13 02:25:02 -05:00
|
|
|
@open $(DMG_DIR)/$(DMG_NAME)
|
2017-01-12 05:01:52 -05:00
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
.PHONY: app binary clean dmg install $(TARGET) $(TARGET)-universal
|
2017-01-12 05:01:52 -05:00
|
|
|
|
2021-08-17 14:04:46 -04:00
|
|
|
clean: ## Remove all build artifacts
|
|
|
|
@cargo clean
|