Files
GBM/makefile
2017-11-19 22:31:55 +01:00

40 lines
1.5 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ICONSIZES := 16 24 32 48 64 72 96 128 256
IMGMAGICK := $(shell command -v convert 2> /dev/null)
XDGUTILS := $(shell command -v xdg-desktop-menu 2> /dev/null)
define \n
endef
install: GBM.exe $(foreach size,$(ICONSIZES),gbm_$(size)x$(size).png)
ifndef XDGUTILS
$(error "xdg-desktop-menu is not available, please install xdg-utils")
endif
#rename it in a way, it can easily started from terminal
install gbm.sh /usr/local/bin/gbm;
install -d /usr/local/share/gbm;
install GBM.exe /usr/local/share/gbm/;
#install icon in different sizes
$(foreach size,$(ICONSIZES),xdg-icon-resource install --mode system --novendor --noupdate --size $(size) gbm_$(size)x$(size).png gbm;$(\n))
xdg-icon-resource forceupdate --mode system;
#install .desktop file, which is used for running gbm from desktop and menus
xdg-desktop-menu install --mode system --novendor gbm.desktop;
uninstall: /usr/local/bin/gbm
ifndef XDGUTILS
$(error "xdg-desktop-menu is not available, please install xdg-utils")
endif
rm /usr/local/bin/gbm;
rm -r /usr/local/share/gbm/;
$(foreach size,$(ICONSIZES),xdg-icon-resource uninstall --mode system --novendor --noupdate --size $(size) gbm;$(\n))
xdg-icon-resource forceupdate --mode system;
xdg-desktop-menu uninstall --mode system --novendor gbm.desktop;
gbm_%.png: gbm.ico
ifndef IMGMAGICK
$(error "convert is not available, please install imagemagick")
endif
#extracts the correct ico index appended to the filename from identifys output
$(eval INDEX := $(shell identify gbm.ico | grep $* | cut -d" " -f1;))
convert '$(INDEX)' '$@';