dotfiles/rofi/makefile

46 lines
1.0 KiB
Makefile
Raw Normal View History

2019-05-04 05:51:37 +00:00
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
TARGET := $(XDG_DIR)/rofi
DESKTOP_SRC := $(SRC)/desktop
DESKTOP_TARGET := ~/.local/share/applications
2019-05-04 05:51:37 +00:00
install: | init update
init:
ifeq ($(call cmd_exist,rofi), true)
$(info => Setting up rofi)
$(mk_link) $(SRC) $(TARGET)
$(MAKE) -C $(SRC) desktop_init
else
$(report) warn "rofi not installed. Skipping."
2019-05-04 05:51:37 +00:00
endif
update:
remove:
$(info => Remvoing rofi)
$(rm_link) $(TARGET)
$(MAKE) -C $(SRC) desktop_remove
desktop_init:
ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true)
$(info ==> Setting up desktop shortcuts.)
cd $(DESKTOP_SRC) ; \
for i in *.desktop; do ; \
$(mk_link) $(DESKTOP_SRC)/$$i $(DESKTOP_TARGET)/$$i ; \
done
else
$(report) warn "$(DESKTOP_TARGET) does not exist. Skipping."
endif
desktop_remove:
ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true)
$(info ==> removing rofi desktop entries.)
cd $(DESKTOP_SRC) ; \
for i in *.desktop; do ; \
$(rm_link) $(DESKTOP_TARGET)/$$i ; \
done
endif