2022-08-12 13:37:15 -05:00
|
|
|
ARGS ?= -c
|
|
|
|
OK_TYPES := otf ttf woff woff2
|
|
|
|
NF_SRC := $(shell find src -type f)
|
2022-12-01 14:13:01 -06:00
|
|
|
ML_TYPES := $(shell find ./MonoLisa \
|
|
|
|
-mindepth 1 \
|
|
|
|
-maxdepth 1 \
|
|
|
|
-not -empty \
|
|
|
|
-type d \
|
|
|
|
-exec basename {} \;)
|
2022-08-12 13:37:15 -05:00
|
|
|
|
|
|
|
UNKNOWN := $(filter-out $(OK_TYPES),$(ML_TYPES))
|
|
|
|
$(if $(UNKNOWN),$(error unknown font type in ./MonoLisa: $(UNKNOWN)))
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
msg = $(call tprint,{a.bold}==>{a.end} {a.b_magenta}$(1){a.end} {a.bold}<=={a.end})
|
|
|
|
|
|
|
|
## patch | add nerd fonts to MonoLisa
|
2022-12-01 14:16:40 -06:00
|
|
|
ifdef DOCKER
|
|
|
|
.PHONY: patch
|
|
|
|
patch: $(foreach ml-type,$(ML_TYPES),patch-$(ml-type)-docker)
|
|
|
|
else
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: patch
|
|
|
|
patch: $(addprefix patch-,$(ML_TYPES))
|
2022-12-01 14:16:40 -06:00
|
|
|
endif
|
2022-08-12 13:37:15 -05:00
|
|
|
|
|
|
|
patch-%: ./bin/font-patcher
|
2022-09-05 18:37:47 -05:00
|
|
|
$(call msg, Patching MonoLisa $* Files)
|
2022-08-12 13:37:15 -05:00
|
|
|
@./bin/patch-monolisa $* $(ARGS)
|
|
|
|
|
2022-12-01 14:16:40 -06:00
|
|
|
patch-%-docker: ./bin/font-patcher
|
|
|
|
$(call msg, Patching Monolisa $* Files w/Docker)
|
|
|
|
@./bin/patch-monolisa-docker $* $(ARGS)
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
## update-fonts | move fonts and update fc-cache
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: update-fonts
|
|
|
|
update-fonts:
|
2022-09-05 18:37:47 -05:00
|
|
|
$(call msg,Adding Fonts To System)
|
2022-08-12 13:37:15 -05:00
|
|
|
@./bin/update-fonts
|
|
|
|
@fc-cache -f -v
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
## check | check fc-list for MonoLisa
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: check
|
|
|
|
check:
|
2022-10-13 10:41:38 -05:00
|
|
|
$(call msg,Checking System for Fonts)
|
2022-08-12 13:37:15 -05:00
|
|
|
@fc-list | grep "MonoLisa"
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
## update-src | update nerd fonts source
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: update-src
|
|
|
|
update-src:
|
2022-09-05 18:37:47 -05:00
|
|
|
$(call msg,Updating Source Files)
|
2022-08-12 13:37:15 -05:00
|
|
|
@./bin/update-src
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
## lint | check shell scripts
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
@shfmt -w -s $(shell shfmt -f bin/)
|
|
|
|
|
2022-09-05 18:37:47 -05:00
|
|
|
## clean | remove patched fonts
|
2022-08-12 13:37:15 -05:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@rm -r patched/*
|
2022-09-05 18:37:47 -05:00
|
|
|
|
2022-10-13 10:41:38 -05:00
|
|
|
USAGE = {a.b_green}Update MonoLisa with Nerd Fonts! {a.end}\n\n{a.header}usage{a.end}:\n make <recipe>\n
|
2022-09-05 18:37:47 -05:00
|
|
|
-include .task.mk
|