2008-09-24 05:19:31 -04:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2010-07-18 17:30:26 -04:00
|
|
|
NAMES := wpa_gui ap laptop group invitation
|
2008-09-24 05:19:31 -04:00
|
|
|
SIZES := 16x16 22x22 32x32 48x48 64x64 128x128
|
2009-11-19 13:49:51 -05:00
|
|
|
ICONS := $(addsuffix .png, $(foreach name, $(NAMES), $(foreach size, $(SIZES), $(size)/$(name))))
|
|
|
|
ICONS += $(addsuffix .xpm, $(NAMES))
|
2008-09-24 05:19:31 -04:00
|
|
|
|
2020-05-06 18:29:53 -04:00
|
|
|
ifeq (1, $(shell which inkscape; echo $$?))
|
|
|
|
$(error "No inkscape in PATH, it is required for exporting icons.")
|
|
|
|
else
|
|
|
|
ifeq (0, $(shell inkscape --without-gui 2>&1 > /dev/null; echo $$?))
|
|
|
|
# Inkscape < 1.0
|
|
|
|
INKSCAPE_GUI_FLAG := --without-gui
|
|
|
|
INKSCAPE_OUTPUT_FLAG := --export-png
|
|
|
|
else
|
|
|
|
# Inkscape >= 1.0
|
|
|
|
INKSCAPE_GUI_FLAG :=
|
|
|
|
INKSCAPE_OUTPUT_FLAG := --export-filename
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2008-09-24 05:19:31 -04:00
|
|
|
all: $(ICONS)
|
|
|
|
|
|
|
|
%.png:
|
2009-11-19 13:49:51 -05:00
|
|
|
mkdir -p hicolor/$(word 1, $(subst /, ,$(@)))/apps/
|
2020-05-06 18:29:53 -04:00
|
|
|
inkscape $(subst .png,.svg, $(word 2, $(subst /, , $(@)))) $(INKSCAPE_GUI_FLAG) \
|
2009-11-19 13:49:51 -05:00
|
|
|
--export-width=$(word 1, $(subst x, , $(@))) \
|
|
|
|
--export-height=$(word 2, $(subst x, , $(subst /, , $(@)))) \
|
2020-05-06 18:29:53 -04:00
|
|
|
$(INKSCAPE_OUTPUT_FLAG)=hicolor/$(word 1, $(subst /, ,$(@)))/apps/$(word 2, $(subst /, , $@))
|
2008-09-24 05:19:31 -04:00
|
|
|
|
2009-11-19 13:49:51 -05:00
|
|
|
%.xpm:
|
2008-09-24 05:19:31 -04:00
|
|
|
mkdir -p pixmaps/
|
2009-11-19 13:49:51 -05:00
|
|
|
convert hicolor/16x16/apps/$(@:.xpm=.png) pixmaps/$(@:.xpm=-16.xpm)
|
|
|
|
convert hicolor/32x32/apps/$(@:.xpm=.png) pixmaps/$@
|
2008-09-24 05:19:31 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -r pixmaps hicolor
|