bash update
This commit is contained in:
parent
033935bf67
commit
fd853aebaa
326
Makefile
Normal file → Executable file
326
Makefile
Normal file → Executable file
@ -1,164 +1,162 @@
|
||||
#
|
||||
# All-in-one website favicon generator
|
||||
# Copyright (C) 2019 Illya Marchenko <stuzer05@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
CC = magick
|
||||
FILE ?= source.png
|
||||
|
||||
# Files & forlders
|
||||
DIST = dist
|
||||
override DIST := $(DIST)/
|
||||
override dist_public = $(DIST)public/
|
||||
override dist_icons = $(DIST)public/icons/
|
||||
|
||||
ICON_PATH = /icons
|
||||
override ICON_PATH := $(ICON_PATH)/
|
||||
|
||||
override define file_manifest
|
||||
@echo '{' > $(dist_public)manifest.json
|
||||
@echo ' "name": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "short_name": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "icons": [' >> $(dist_public)manifest.json
|
||||
@echo ' {' >> $(dist_public)manifest.json
|
||||
@echo ' "src": "'$(ICON_PATH)'android-chrome-192x192.png",' >> $(dist_public)manifest.json
|
||||
@echo ' "sizes": "192x192",' >> $(dist_public)manifest.json
|
||||
@echo ' "type": "image/png"' >> $(dist_public)manifest.json
|
||||
@echo ' },' >> $(dist_public)manifest.json
|
||||
@echo ' {' >> $(dist_public)manifest.json
|
||||
@echo ' "src": "'$(ICON_PATH)'android-chrome-512x512.png",' >> $(dist_public)manifest.json
|
||||
@echo ' "sizes": "512x512",' >> $(dist_public)manifest.json
|
||||
@echo ' "type": "image/png"' >> $(dist_public)manifest.json
|
||||
@echo ' }' >> $(dist_public)manifest.json
|
||||
@echo ' ],' >> $(dist_public)manifest.json
|
||||
@echo ' "theme_color": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "background_color": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "display": "standalone"' >> $(dist_public)manifest.json
|
||||
@echo '}' >> $(dist_public)manifest.json
|
||||
endef
|
||||
|
||||
override define file_ieconfig
|
||||
@echo '<?xml version="1.0" encoding="utf-8"?>' > $(dist_icons)ieconfig.xml
|
||||
@echo '<browserconfig>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <msapplication>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <tile>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square70x70logo src="'$(ICON_PATH)'mstile-small.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square150x150logo src="'$(ICON_PATH)'mstile-medium.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <wide310x150logo src="'$(ICON_PATH)'mstile-wide.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square310x310logo src="'$(ICON_PATH)'mstile-large.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <TileColor>#ffffff</TileColor>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' </tile>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' </msapplication>' >> $(dist_icons)ieconfig.xml
|
||||
@echo '</browserconfig>' >> $(dist_icons)ieconfig.xml
|
||||
endef
|
||||
|
||||
override define file_source
|
||||
@echo '<!-- Regular icons -->' > $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-57x57.png" sizes="57x57">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-76x76.png" sizes="76x76">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-96x96.png" sizes="96x96">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-128x128.png" sizes="128x128">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-192x192.png" sizes="192x192">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-196x196.png" sizes="196x196">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-228x228.png" sizes="228x228">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-16x16.png" sizes="16x16">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-32x32.png" sizes="32x32">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-48x48.png" sizes="48x48">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- Android icons -->' >> $(DIST)source.html
|
||||
@echo '<link rel="shortcut icon" sizes="196x196" href="'$(ICON_PATH)'favicon-196x196.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="manifest" href="manifest.json">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- Apple icons -->' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="57x57" href="'$(ICON_PATH)'apple-touch-icon-57x57.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="114x114" href="'$(ICON_PATH)'apple-touch-icon-114x114.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="72x72" href="'$(ICON_PATH)'apple-touch-icon-72x72.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="144x144" href="'$(ICON_PATH)'apple-touch-icon-144x144.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="60x60" href="'$(ICON_PATH)'apple-touch-icon-60x60.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="120x120" href="'$(ICON_PATH)'apple-touch-icon-120x120.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="76x76" href="'$(ICON_PATH)'apple-touch-icon-76x76.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="152x152" href="'$(ICON_PATH)'apple-touch-icon-152x152.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="180x180" href="'$(ICON_PATH)'apple-touch-icon.png">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- IE 10 Metro tile icons -->' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-TileColor" content="#ffffff">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-TileImage" content="'$(ICON_PATH)'mstile-144x144.png">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- IE 11 Metro tile for Windows 8.1 start screen -->' >> $(DIST)source.html
|
||||
@echo '<meta name="application-name" content="Application name">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-tooltip" content="Tooltip">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-config" content="'$(ICON_PATH)'ieconfig.xml">' >> $(DIST)source.html
|
||||
endef
|
||||
|
||||
all: $(FILE)
|
||||
-mkdir $(DIST) $(dist_public)
|
||||
-mkdir $(DIST) $(dist_icons)
|
||||
|
||||
@echo "Generating.. Regular icons"
|
||||
$(CC) $(FILE) -resize 16x16! $(dist_icons)favicon-16x16.png
|
||||
$(CC) $(FILE) -resize 32x32! $(dist_icons)favicon-32x32.png
|
||||
$(CC) $(FILE) -resize 48x48! $(dist_icons)favicon-48x48.png
|
||||
$(CC) $(FILE) -resize 57x57! $(dist_icons)favicon-57x57.png
|
||||
$(CC) $(FILE) -resize 76x76! $(dist_icons)favicon-76x76.png
|
||||
$(CC) $(FILE) -resize 96x96! $(dist_icons)favicon-96x96.png
|
||||
$(CC) $(FILE) -resize 128x128! $(dist_icons)favicon-128x128.png
|
||||
$(CC) $(FILE) -resize 192x192! $(dist_icons)favicon-192x192.png
|
||||
$(CC) $(FILE) -resize 192x192! $(dist_icons)favicon-196x196.png
|
||||
$(CC) $(FILE) -resize 228x228! $(dist_icons)favicon-228x228.png
|
||||
|
||||
@echo "Packing.. triple-sized favicon.ico"
|
||||
$(CC) $(dist_icons)favicon-16x16.png $(dist_icons)favicon-32x32.png $(dist_icons)favicon-48x48.png $(dist_public)favicon.ico
|
||||
|
||||
@echo "Generating.. Android icons"
|
||||
$(CC) $(FILE) -resize 196x196! $(dist_icons)favicon-196x196.png
|
||||
$(CC) $(FILE) -resize 192x192! $(dist_icons)android-chrome-192x192.png
|
||||
$(CC) $(FILE) -resize 196x196! $(dist_icons)android-chrome-512x512.png
|
||||
|
||||
@echo "Generating.. Apple icons"
|
||||
$(CC) $(FILE) -resize 57x57! $(dist_icons)apple-touch-icon-57x57.png
|
||||
$(CC) $(FILE) -resize 114x114! $(dist_icons)apple-touch-icon-114x114.png
|
||||
$(CC) $(FILE) -resize 72x72! $(dist_icons)apple-touch-icon-72x72.png
|
||||
$(CC) $(FILE) -resize 144x144! $(dist_icons)apple-touch-icon-144x144.png
|
||||
$(CC) $(FILE) -resize 60x60! $(dist_icons)apple-touch-icon-60x60.png
|
||||
$(CC) $(FILE) -resize 120x120! $(dist_icons)apple-touch-icon-120x120.png
|
||||
$(CC) $(FILE) -resize 76x76! $(dist_icons)apple-touch-icon-76x76.png
|
||||
$(CC) $(FILE) -resize 152x152! $(dist_icons)apple-touch-icon-152x152.png
|
||||
$(CC) $(FILE) -resize 180x180! $(dist_icons)apple-touch-icon.png
|
||||
$(CC) $(FILE) -resize 180x180! $(dist_public)apple-touch-icon.png
|
||||
$(CC) $(FILE) -resize 180x180! -quality 80% $(dist_public)apple-touch-icon-precomposed.png
|
||||
|
||||
@echo "Generating.. IE 10 Metro tile icons"
|
||||
$(CC) $(FILE) -resize 144x144! $(dist_icons)mstile-144x144.png
|
||||
|
||||
@echo "Generating.. IE 11 Metro tile for Windows 8.1 start screen"
|
||||
$(CC) $(FILE) -resize 70x70! $(dist_icons)mstile-small.png
|
||||
$(CC) $(FILE) -resize 150x150! $(dist_icons)mstile-medium.png
|
||||
$(CC) $(FILE) -resize 310x150! $(dist_icons)mstile-wide.png
|
||||
$(CC) $(FILE) -resize 310x310! $(dist_icons)mstile-large.png
|
||||
|
||||
@echo "Generating.. manifest.json"
|
||||
$(file_manifest)
|
||||
|
||||
@echo "Generating.. ieconfig.xml"
|
||||
$(file_ieconfig)
|
||||
|
||||
@echo "Generating.. source.html"
|
||||
$(file_source)
|
||||
|
||||
@echo "Done."
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -r $(DIST)* $(subst /,,$(DIST))
|
||||
# All-in-one website favicon generator
|
||||
# Copyright (C) 2019 Illya Marchenko <stuzer05@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
CC = convert
|
||||
SOURCE ?= source.png
|
||||
|
||||
# Files & forlders
|
||||
DIST = dist
|
||||
override DIST := $(DIST)/
|
||||
override dist_public = $(DIST)public/
|
||||
override dist_icons = $(DIST)public/icons/
|
||||
|
||||
ICON_PATH = /icons
|
||||
override ICON_PATH := $(ICON_PATH)/
|
||||
|
||||
override define file_manifest
|
||||
@echo '{' > $(dist_public)manifest.json
|
||||
@echo ' "name": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "short_name": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "icons": [' >> $(dist_public)manifest.json
|
||||
@echo ' {' >> $(dist_public)manifest.json
|
||||
@echo ' "src": "'$(ICON_PATH)'android-chrome-192x192.png",' >> $(dist_public)manifest.json
|
||||
@echo ' "sizes": "192x192",' >> $(dist_public)manifest.json
|
||||
@echo ' "type": "image/png"' >> $(dist_public)manifest.json
|
||||
@echo ' },' >> $(dist_public)manifest.json
|
||||
@echo ' {' >> $(dist_public)manifest.json
|
||||
@echo ' "src": "'$(ICON_PATH)'android-chrome-512x512.png",' >> $(dist_public)manifest.json
|
||||
@echo ' "sizes": "512x512",' >> $(dist_public)manifest.json
|
||||
@echo ' "type": "image/png"' >> $(dist_public)manifest.json
|
||||
@echo ' }' >> $(dist_public)manifest.json
|
||||
@echo ' ],' >> $(dist_public)manifest.json
|
||||
@echo ' "theme_color": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "background_color": "",' >> $(dist_public)manifest.json
|
||||
@echo ' "display": "standalone"' >> $(dist_public)manifest.json
|
||||
@echo '}' >> $(dist_public)manifest.json
|
||||
endef
|
||||
|
||||
override define file_ieconfig
|
||||
@echo '<?xml version="1.0" encoding="utf-8"?>' > $(dist_icons)ieconfig.xml
|
||||
@echo '<browserconfig>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <msapplication>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <tile>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square70x70logo src="'$(ICON_PATH)'mstile-small.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square150x150logo src="'$(ICON_PATH)'mstile-medium.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <wide310x150logo src="'$(ICON_PATH)'mstile-wide.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <square310x310logo src="'$(ICON_PATH)'mstile-large.png"/>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' <TileColor>#ffffff</TileColor>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' </tile>' >> $(dist_icons)ieconfig.xml
|
||||
@echo ' </msapplication>' >> $(dist_icons)ieconfig.xml
|
||||
@echo '</browserconfig>' >> $(dist_icons)ieconfig.xml
|
||||
endef
|
||||
|
||||
override define file_source
|
||||
@echo '<!-- Regular icons -->' > $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-57x57.png" sizes="57x57">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-76x76.png" sizes="76x76">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-96x96.png" sizes="96x96">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-128x128.png" sizes="128x128">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-192x192.png" sizes="192x192">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-196x196.png" sizes="196x196">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-228x228.png" sizes="228x228">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-16x16.png" sizes="16x16">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-32x32.png" sizes="32x32">' >> $(DIST)source.html
|
||||
@echo '<link rel="icon" type="image/png" href="'$(ICON_PATH)'favicon-48x48.png" sizes="48x48">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- Android icons -->' >> $(DIST)source.html
|
||||
@echo '<link rel="shortcut icon" sizes="196x196" href="'$(ICON_PATH)'favicon-196x196.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="manifest" href="manifest.json">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- Apple icons -->' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="57x57" href="'$(ICON_PATH)'apple-touch-icon-57x57.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="114x114" href="'$(ICON_PATH)'apple-touch-icon-114x114.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="72x72" href="'$(ICON_PATH)'apple-touch-icon-72x72.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="144x144" href="'$(ICON_PATH)'apple-touch-icon-144x144.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="60x60" href="'$(ICON_PATH)'apple-touch-icon-60x60.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="120x120" href="'$(ICON_PATH)'apple-touch-icon-120x120.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="76x76" href="'$(ICON_PATH)'apple-touch-icon-76x76.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="152x152" href="'$(ICON_PATH)'apple-touch-icon-152x152.png">' >> $(DIST)source.html
|
||||
@echo '<link rel="apple-touch-icon" sizes="180x180" href="'$(ICON_PATH)'apple-touch-icon.png">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- IE 10 Metro tile icons -->' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-TileColor" content="#ffffff">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-TileImage" content="'$(ICON_PATH)'mstile-144x144.png">' >> $(DIST)source.html
|
||||
@echo '' >> $(DIST)source.html
|
||||
@echo '<!-- IE 11 Metro tile for Windows 8.1 start screen -->' >> $(DIST)source.html
|
||||
@echo '<meta name="application-name" content="Application name">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-tooltip" content="Tooltip">' >> $(DIST)source.html
|
||||
@echo '<meta name="msapplication-config" content="'$(ICON_PATH)'ieconfig.xml">' >> $(DIST)source.html
|
||||
endef
|
||||
|
||||
all: $(SOURCE)
|
||||
-mkdir $(DIST) $(dist_public) $(dist_icons)
|
||||
|
||||
@echo "Generating.. Regular icons"
|
||||
@$(CC) $(SOURCE) -resize 16x16! $(dist_icons)favicon-16x16.png
|
||||
@$(CC) $(SOURCE) -resize 32x32! $(dist_icons)favicon-32x32.png
|
||||
@$(CC) $(SOURCE) -resize 48x48! $(dist_icons)favicon-48x48.png
|
||||
@$(CC) $(SOURCE) -resize 57x57! $(dist_icons)favicon-57x57.png
|
||||
@$(CC) $(SOURCE) -resize 76x76! $(dist_icons)favicon-76x76.png
|
||||
@$(CC) $(SOURCE) -resize 96x96! $(dist_icons)favicon-96x96.png
|
||||
@$(CC) $(SOURCE) -resize 128x128! $(dist_icons)favicon-128x128.png
|
||||
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)favicon-192x192.png
|
||||
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)favicon-196x196.png
|
||||
@$(CC) $(SOURCE) -resize 228x228! $(dist_icons)favicon-228x228.png
|
||||
|
||||
@echo "Packing.. triple-sized favicon.ico"
|
||||
@$(CC) $(dist_icons)favicon-16x16.png $(dist_icons)favicon-32x32.png $(dist_icons)favicon-48x48.png $(dist_public)favicon.ico
|
||||
|
||||
@echo "Generating.. Android icons"
|
||||
@$(CC) $(SOURCE) -resize 196x196! $(dist_icons)favicon-196x196.png
|
||||
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)android-chrome-192x192.png
|
||||
@$(CC) $(SOURCE) -resize 196x196! $(dist_icons)android-chrome-512x512.png
|
||||
|
||||
@echo "Generating.. Apple icons"
|
||||
@$(CC) $(SOURCE) -resize 57x57! $(dist_icons)apple-touch-icon-57x57.png
|
||||
@$(CC) $(SOURCE) -resize 114x114! $(dist_icons)apple-touch-icon-114x114.png
|
||||
@$(CC) $(SOURCE) -resize 72x72! $(dist_icons)apple-touch-icon-72x72.png
|
||||
@$(CC) $(SOURCE) -resize 144x144! $(dist_icons)apple-touch-icon-144x144.png
|
||||
@$(CC) $(SOURCE) -resize 60x60! $(dist_icons)apple-touch-icon-60x60.png
|
||||
@$(CC) $(SOURCE) -resize 120x120! $(dist_icons)apple-touch-icon-120x120.png
|
||||
@$(CC) $(SOURCE) -resize 76x76! $(dist_icons)apple-touch-icon-76x76.png
|
||||
@$(CC) $(SOURCE) -resize 152x152! $(dist_icons)apple-touch-icon-152x152.png
|
||||
@$(CC) $(SOURCE) -resize 180x180! $(dist_icons)apple-touch-icon.png
|
||||
@$(CC) $(SOURCE) -resize 180x180! $(dist_public)apple-touch-icon.png
|
||||
@$(CC) $(SOURCE) -resize 180x180! -quality 80% $(dist_public)apple-touch-icon-precomposed.png
|
||||
|
||||
@echo "Generating.. IE 10 Metro tile icons"
|
||||
@$(CC) $(SOURCE) -resize 144x144! $(dist_icons)mstile-144x144.png
|
||||
|
||||
@echo "Generating.. IE 11 Metro tile for Windows 8.1 start screen"
|
||||
@$(CC) $(SOURCE) -resize 70x70! $(dist_icons)mstile-small.png
|
||||
@$(CC) $(SOURCE) -resize 150x150! $(dist_icons)mstile-medium.png
|
||||
@$(CC) $(SOURCE) -resize 310x150! $(dist_icons)mstile-wide.png
|
||||
@$(CC) $(SOURCE) -resize 310x310! $(dist_icons)mstile-large.png
|
||||
|
||||
@echo "Generating.. manifest.json"
|
||||
$(file_manifest)
|
||||
|
||||
@echo "Generating.. ieconfig.xml"
|
||||
$(file_ieconfig)
|
||||
|
||||
@echo "Generating.. source.html"
|
||||
$(file_source)
|
||||
|
||||
@echo "Done."
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -r $(DIST)* $(subst /,,$(DIST))
|
89
README.md
89
README.md
@ -6,7 +6,7 @@ This includes iOS Safari, Google Chrome, Mozilla Firefox, Windows 8 and 10, and
|
||||
To get started with favicon generator you need to make sure [ImageMagick](https://imagemagick.org/index.php) and the latest [GNU make](https://www.gnu.org/software/make/) software are installed and present in your PATH environment variable.
|
||||
|
||||
# Configuration
|
||||
By default, makefile uses `magick` filename for ImageMagick software, but you can change that by specifying a new name as a parameter for make
|
||||
By default, makefile uses `convert` file of ImageMagick software, but you can change that by specifying a new name as a parameter for make
|
||||
```
|
||||
make CC=<executable name>
|
||||
```
|
||||
@ -24,53 +24,62 @@ or by changing the following line
|
||||
FILE ?= <image filename>
|
||||
```
|
||||
|
||||
# Using bash
|
||||
You use bash script `generate.sh` to use the program anywhere on your system. First of, you have to areat a symbolic link to an executable using the following command
|
||||
```bash
|
||||
$ ln -s <path to program>/generate.sh ~/.local/bin/webicongen
|
||||
# example: ln -s ~/Programs/Favicons_generation/generate.sh ~/.local/bin/webicongen
|
||||
```
|
||||
then you can use it in such a way
|
||||
```bash
|
||||
$ webicongen <image> <output dir>
|
||||
```
|
||||
The output directory will be created automatically.
|
||||
|
||||
# Usage
|
||||
After everything is configured, simply place your image in the same directory as makefile, and then simply run `make`. It will generate the following directory structure
|
||||
```
|
||||
dist
|
||||
│ source.html
|
||||
│
|
||||
└───public
|
||||
│ apple-touch-icon-precomposed.png
|
||||
│ apple-touch-icon.png
|
||||
│ favicon.ico
|
||||
│ manifest.json
|
||||
│
|
||||
└───icons
|
||||
android-chrome-192x192.png
|
||||
android-chrome-512x512.png
|
||||
apple-touch-icon-114x114.png
|
||||
apple-touch-icon-120x120.png
|
||||
apple-touch-icon-144x144.png
|
||||
apple-touch-icon-152x152.png
|
||||
apple-touch-icon-57x57.png
|
||||
apple-touch-icon-60x60.png
|
||||
apple-touch-icon-72x72.png
|
||||
apple-touch-icon-76x76.png
|
||||
apple-touch-icon.png
|
||||
favicon-128x128.png
|
||||
favicon-16x16.png
|
||||
favicon-192x192.png
|
||||
favicon-196x196.png
|
||||
favicon-228x228.png
|
||||
favicon-32x32.png
|
||||
favicon-48x48.png
|
||||
favicon-57x57.png
|
||||
favicon-76x76.png
|
||||
favicon-96x96.png
|
||||
ieconfig.xml
|
||||
mstile-144x144.png
|
||||
mstile-large.png
|
||||
mstile-medium.png
|
||||
mstile-small.png
|
||||
mstile-wide.png
|
||||
dist/
|
||||
├── public
|
||||
│ ├── apple-touch-icon.png
|
||||
│ ├── apple-touch-icon-precomposed.png
|
||||
│ ├── favicon.ico
|
||||
│ ├── icons
|
||||
│ │ ├── android-chrome-192x192.png
|
||||
│ │ ├── android-chrome-512x512.png
|
||||
│ │ ├── apple-touch-icon-114x114.png
|
||||
│ │ ├── apple-touch-icon-120x120.png
|
||||
│ │ ├── apple-touch-icon-144x144.png
|
||||
│ │ ├── apple-touch-icon-152x152.png
|
||||
│ │ ├── apple-touch-icon-57x57.png
|
||||
│ │ ├── apple-touch-icon-60x60.png
|
||||
│ │ ├── apple-touch-icon-72x72.png
|
||||
│ │ ├── apple-touch-icon-76x76.png
|
||||
│ │ ├── apple-touch-icon.png
|
||||
│ │ ├── favicon-128x128.png
|
||||
│ │ ├── favicon-16x16.png
|
||||
│ │ ├── favicon-192x192.png
|
||||
│ │ ├── favicon-196x196.png
|
||||
│ │ ├── favicon-228x228.png
|
||||
│ │ ├── favicon-32x32.png
|
||||
│ │ ├── favicon-48x48.png
|
||||
│ │ ├── favicon-57x57.png
|
||||
│ │ ├── favicon-76x76.png
|
||||
│ │ ├── favicon-96x96.png
|
||||
│ │ ├── ieconfig.xml
|
||||
│ │ ├── mstile-144x144.png
|
||||
│ │ ├── mstile-large.png
|
||||
│ │ ├── mstile-medium.png
|
||||
│ │ ├── mstile-small.png
|
||||
│ │ └── mstile-wide.png
|
||||
│ └── manifest.json
|
||||
└── source.html
|
||||
```
|
||||
`source.html` contains HTML code that needs to be pasted in your document's head.
|
||||
|
||||
|
||||
`public` folder must be the same as your project's public folder, you can simply copy-paste it into your project (make sure you don't have one of these generated files already in your project, such as `manifest.json`).
|
||||
|
||||
# Acknowledgements
|
||||
I would love to hear any ideas or issues regarding this makefile. Make sure to create an issue or a pull request.
|
||||
|
||||
You can also send me an email at stuzer05@gmail.com
|
||||
You can also send me an email to stuzer05 at gmail.com
|
||||
|
19
generate.sh
Executable file
19
generate.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_FOLLOW=`realpath $0`
|
||||
SCRIPT=`realpath -s $0`
|
||||
SCRIPTPATH=`dirname $SCRIPT_FOLLOW`
|
||||
CALLPATH=`pwd`
|
||||
me=`basename "$0"`
|
||||
|
||||
DIST="dist"
|
||||
if [ $# -eq 2 ]; then
|
||||
DIST=$2
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
make -C $SCRIPTPATH SOURCE="$(pwd)/$1" DIST="$CALLPATH/$DIST"
|
||||
else
|
||||
echo -e "Error: missing arguments\n"
|
||||
echo -e "USAGE:"
|
||||
echo -e "\t$me <image> <output dir>"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user