wpa_gui: Add support for multiple icon files

This commit is contained in:
Mike Shepherd 2009-11-19 20:49:51 +02:00 committed by Jouni Malinen
parent 8f089e7ff8
commit 720e23b2ae

View File

@ -1,27 +1,23 @@
#!/usr/bin/make -f #!/usr/bin/make -f
NAME := wpa_gui NAMES := wpa_gui
SVG := $(NAME).svg
SIZES := 16x16 22x22 32x32 48x48 64x64 128x128 SIZES := 16x16 22x22 32x32 48x48 64x64 128x128
ICONS := $(addsuffix .png,$(SIZES)) ICONS := $(addsuffix .png, $(foreach name, $(NAMES), $(foreach size, $(SIZES), $(size)/$(name))))
ICONS += $(addsuffix .xpm,$(NAME) $(NAME)-16) ICONS += $(addsuffix .xpm, $(NAMES))
all: $(ICONS) all: $(ICONS)
%.png: %.png:
mkdir -p hicolor/$(@:.png=)/apps/ mkdir -p hicolor/$(word 1, $(subst /, ,$(@)))/apps/
inkscape $(SVG) --without-gui \ inkscape $(subst .png,.svg, $(word 2, $(subst /, , $(@)))) --without-gui \
--export-width=$(word 1,$(subst x, ,$(@:.png=))) \ --export-width=$(word 1, $(subst x, , $(@))) \
--export-height=$(word 2,$(subst x, ,$(@:.png=))) \ --export-height=$(word 2, $(subst x, , $(subst /, , $(@)))) \
--export-png=hicolor/$(@:.png=)/apps/$(NAME).png --export-png=hicolor/$(word 1, $(subst /, ,$(@)))/apps/$(word 2, $(subst /, , $@))
$(NAME).xpm: %.xpm:
mkdir -p pixmaps/ mkdir -p pixmaps/
convert hicolor/32x32/apps/$(NAME).png pixmaps/$@ convert hicolor/16x16/apps/$(@:.xpm=.png) pixmaps/$(@:.xpm=-16.xpm)
convert hicolor/32x32/apps/$(@:.xpm=.png) pixmaps/$@
$(NAME)-16.xpm:
mkdir -p pixmaps/
convert hicolor/16x16/apps/$(NAME).png pixmaps/$@
clean: clean:
$(RM) -r pixmaps hicolor $(RM) -r pixmaps hicolor