Last active
February 28, 2023 21:28
-
-
Save mansourmoufid/a536f28b0498ec844fb210bb597738e2 to your computer and use it in GitHub Desktop.
Make a Mac app icon from an image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ICON?= bigimage.png | |
NAME:= myapp | |
SIPS:= sips --setProperty format png --setProperty formatOptions best | |
$(NAME).iconset: $(ICON) | |
$(SIPS) -Z 16 $(ICON) --out $(NAME)-16x16.png | |
$(SIPS) -Z 32 $(ICON) --out $(NAME)-32x32.png | |
$(SIPS) -Z 64 $(ICON) --out $(NAME)-64x64.png | |
$(SIPS) -Z 128 $(ICON) --out $(NAME)-128x128.png | |
$(SIPS) -Z 256 $(ICON) --out $(NAME)-256x256.png | |
$(SIPS) -Z 512 $(ICON) --out $(NAME)-512x512.png | |
$(SIPS) -Z 1024 $(ICON) --out $(NAME)-1024x1024.png | |
mkdir -p $(NAME).iconset | |
cp -n $(NAME)-16x16.png $(NAME).iconset/icon_16x16.png | |
cp -n $(NAME)-32x32.png $(NAME).iconset/[email protected] | |
cp -n $(NAME)-32x32.png $(NAME).iconset/icon_32x32.png | |
cp -n $(NAME)-64x64.png $(NAME).iconset/[email protected] | |
# cp -n $(NAME)-64x64.png $(NAME).iconset/icon_64x64.png | |
# cp -n $(NAME)-128x128.png $(NAME).iconset/[email protected] | |
cp -n $(NAME)-128x128.png $(NAME).iconset/icon_128x128.png | |
cp -n $(NAME)-256x256.png $(NAME).iconset/[email protected] | |
cp -n $(NAME)-256x256.png $(NAME).iconset/icon_256x256.png | |
cp -n $(NAME)-512x512.png $(NAME).iconset/[email protected] | |
cp -n $(NAME)-512x512.png $(NAME).iconset/icon_512x512.png | |
cp -n $(NAME)-1024x1024.png $(NAME).iconset/[email protected] | |
$(NAME).icns: $(NAME).iconset | |
iconutil -c icns $(NAME).iconset | |
.PHONY: cleanup | |
cleanup: | |
rm -f $(NAME)-*x*.png | |
rm -rf $(NAME).iconset | |
rm -rf .DS_Store | |
.PHONY: clean | |
clean: cleanup | |
rm -f $(NAME)-*.png | |
rm -rf $(NAME).icns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment