2008-09-24 11:19:31 +02:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2010-07-18 23:30:26 +02:00
|
|
|
NAMES := wpa_gui ap laptop group invitation
|
2008-09-24 11:19:31 +02:00
|
|
|
SIZES := 16x16 22x22 32x32 48x48 64x64 128x128
|
2009-11-19 19:49:51 +01:00
|
|
|
ICONS := $(addsuffix .png, $(foreach name, $(NAMES), $(foreach size, $(SIZES), $(size)/$(name))))
|
|
|
|
ICONS += $(addsuffix .xpm, $(NAMES))
|
2008-09-24 11:19:31 +02:00
|
|
|
|
2020-05-07 00:29:53 +02: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 11:19:31 +02:00
|
|
|
all: $(ICONS)
|
|
|
|
|
|
|
|
%.png:
|
2009-11-19 19:49:51 +01:00
|
|
|
mkdir -p hicolor/$(word 1, $(subst /, ,$(@)))/apps/
|
2020-05-07 00:29:53 +02:00
|
|
|
inkscape $(subst .png,.svg, $(word 2, $(subst /, , $(@)))) $(INKSCAPE_GUI_FLAG) \
|
2009-11-19 19:49:51 +01:00
|
|
|
--export-width=$(word 1, $(subst x, , $(@))) \
|
|
|
|
--export-height=$(word 2, $(subst x, , $(subst /, , $(@)))) \
|
2020-05-07 00:29:53 +02:00
|
|
|
$(INKSCAPE_OUTPUT_FLAG)=hicolor/$(word 1, $(subst /, ,$(@)))/apps/$(word 2, $(subst /, , $@))
|
2008-09-24 11:19:31 +02:00
|
|
|
|
2009-11-19 19:49:51 +01:00
|
|
|
%.xpm:
|
2008-09-24 11:19:31 +02:00
|
|
|
mkdir -p pixmaps/
|
2009-11-19 19:49:51 +01:00
|
|
|
convert hicolor/16x16/apps/$(@:.xpm=.png) pixmaps/$(@:.xpm=-16.xpm)
|
|
|
|
convert hicolor/32x32/apps/$(@:.xpm=.png) pixmaps/$@
|
2008-09-24 11:19:31 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -r pixmaps hicolor
|