muinaisosoitin/Makefile
Juhani Krekelä 9b2153bf3c Add support for 2x scale cursors
This allows using muinaisosoitin with HiDPI screens.
2026-06-18 23:57:10 +03:00

102 lines
2.3 KiB
Makefile

PREFIX?=/usr/local
DATAROOTDIR?=$(PREFIX)/share
ICONSDIR?=$(DATAROOTDIR)/icons
FFMPEG?=ffmpeg
PYTHON?=python3
XCURSORGEN?=xcursorgen
X_CURSORS=\
left_ptr\
question_arrow\
hand1\
watch\
plus\
crosshair\
xterm\
fleur\
top_side\
right_side\
bottom_side\
left_side\
top_right_corner\
top_left_corner\
bottom_right_corner\
bottom_left_corner\
double_arrow\
sizing
NEW_CURSORS=\
context-menu\
progress\
vertical-text\
alias\
copy\
not-allowed\
ew-resize\
nesw-resize\
col-resize\
row-resize\
zoom-in\
zoom-out
GENERATED_CURSORS=$(X_CURSORS) $(NEW_CURSORS)
ALIASES=\
default:left_ptr\
help:question_arrow\
pointer:hand1\
wait:watch\
cell:plus\
text:xterm\
move:fleur\
no-drop:not-allowed\
grab:fleur\
grabbing:fleur\
all-scroll:fleur\
n-resize:top_side\
e-resize:right_side\
s-resize:bottom_side\
w-resize:left_side\
ne-resize:top_right_corner\
nw-resize:top_left_corner\
se-resize:bottom_right_corner\
sw-resize:bottom_left_corner\
ns-resize:double_arrow\
nwse-resize:sizing
all: $(GENERATED_CURSORS:=.xcursor)
install: all
mkdir -p $(DESTDIR)$(ICONSDIR)/muinaisosoitin/cursors
for cursor in $(GENERATED_CURSORS); do\
cp $$cursor.xcursor $(DESTDIR)$(ICONSDIR)/muinaisosoitin/cursors/$$cursor;\
done
for mapping in $(ALIASES); do\
ln -sf $${mapping#*:} $(DESTDIR)$(ICONSDIR)/muinaisosoitin/cursors/$${mapping%:*};\
done
printf '[Icon Theme]\nName=muinaisosoitin\n' > $(DESTDIR)$(ICONSDIR)/muinaisosoitin/index.theme
.PHONY: all install
.SUFFIXES:
.SUFFIXES: .xcursor
$(X_CURSORS:=.xcursor): bdf_extract.py cursor.bdf
$(PYTHON) bdf_extract.py --bitmap -i cursor.bdf $*
$(FFMPEG) -loglevel error -y -i $*-1x.pam $*-1x.png
$(FFMPEG) -loglevel error -y -i $*-2x.pam $*-2x.png
$(PYTHON) bdf_extract.py --cursor-config -i cursor.bdf $* | $(XCURSORGEN) - $@
$(NEW_CURSORS:=.xcursor): bdf_extract.py newcursors.bdf
$(PYTHON) bdf_extract.py --bitmap -i newcursors.bdf $*
$(FFMPEG) -loglevel error -y -i $*-1x.pam $*-1x.png
$(FFMPEG) -loglevel error -y -i $*-2x.pam $*-2x.png
$(PYTHON) bdf_extract.py --cursor-config -i newcursors.bdf $* | $(XCURSORGEN) - $@
clean:
rm -f $(GENERATED_CURSORS:=-1x.pam) $(GENERATED_CURSORS:=-2x.pam) $(GENERATED_CURSORS:=-1x.png) $(GENERATED_CURSORS:=-2x.png) $(GENERATED_CURSORS:=.xcursor)
distclean: clean
.PHONY: clean distclean