1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
#
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
#
# Do not:
# o use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
# o print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory
# Avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C
LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifeq ("$(origin V)", "command line")
BUILD_VERBOSE = $(V)
endif
ifndef BUILD_VERBOSE
BUILD_VERBOSE = 0
endif
# That's our default target when none is given on the command line
PHONY := _all
_all:
# Cancel implicit rules on top Makefile
$(CURDIR)/Makefile Makefile: ;
ifeq ($(BUILD_VERBOSE),1)
quiet =
Q =
else
quiet=quiet_
Q = @
endif
# If the user is running make -s (silent mode), suppress echoing of
# # commands
ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet=silent_
endif
export quiet Q BUILD_VERBOSE
PHONY += clean xplanet sheets png-country-squared png-country-4x2
_all: all
all: local pngs
SVG2SVG_EXTRA = Makefike scripts/build.pl
PHONY += $(SVG2SVG_EXTRA)
SVG2SVG_11 = scripts/build.pl --cmd svg2svg --res 512x512 --back back.png --fore fore.png --svgs svg/country-squared --mask 57x57+35x35+398x398 --geo 57x57+512x512 --geoscale 0.7775
SVG2SVG_110 = scripts/build.pl --cmd svg2svg --res 512x512 --back back.png --fore fore.png --svgs svg/country-squared --mask 0x0+0x0+512x512 --geo 0x0+512x512 --geoscale 1
SVG2SVG_43 = scripts/build.pl --cmd svg2svg --res 1280x960 --back back.png --fore fore.png --svgs svg/country-4x3 --mask 107x107+67x67+1065x745 --geo 106x75+1280x960 --geoscale 1.667
SVG2SVG_430 = scripts/build.pl --cmd svg2svg --res 1280x960 --back back.png --fore fore.png --svgs svg/country-4x3 --mask 0x0+0x0+1280x960 --geo 0x0+1280x960 --geoscale 2
SVGS_11 = $(shell cd svg/country-squared; ls -1 ??.svg)
SVGS_11_FANCY = ${SVGS_11:%.svg=build/svg-country-squared-fancy/%.svg}
SVGS_11_SIMPLE = ${SVGS_11:%.svg=build/svg-country-squared-simple/%.svg}
SVGS_11_FLAT = ${SVGS_11:%.svg=build/svg-country-squared-flat/%.svg}
SVGS_11_GLOSSY = ${SVGS_11:%.svg=build/svg-country-squared-glossy/%.svg}
SVGS_11_NONE = ${SVGS_11:%.svg=build/svg-country-squared-none/%.svg}
PNGS_11_FANCY = ${SVGS_11:%.svg=build/png-country-squared-fancy/%.png}
PNGS_11_SIMPLE = ${SVGS_11:%.svg=build/png-country-squared-simple/%.png}
PNGS_11_FLAT = ${SVGS_11:%.svg=build/png-country-squared-flat/%.png}
PNGS_11_GLOSSY = ${SVGS_11:%.svg=build/png-country-squared-glossy/%.png}
PNGS_11_NONE = ${SVGS_11:%.svg=build/png-country-squared-none/%.png}
SVGS_43 = $(shell cd svg/country-4x3; ls -1 *.svg)
SVGS_42_FANCY = ${SVGS_43:%.svg=build/svg-country-4x2-fancy/%.svg}
SVGS_42_SIMPLE = ${SVGS_43:%.svg=build/svg-country-4x2-simple/%.svg}
SVGS_42_FLAT = ${SVGS_43:%.svg=build/svg-country-4x2-flat/%.svg}
SVGS_42_GLOSSY = ${SVGS_43:%.svg=build/svg-country-4x2-glossy/%.svg}
SVGS_42_NONE = ${SVGS_43:%.svg=build/svg-country-4x2-none/%.svg}
PNGS_42_FANCY = ${SVGS_43:%.svg=build/png-country-4x2-fancy/%.png}
PNGS_42_SIMPLE = ${SVGS_43:%.svg=build/png-country-4x2-simple/%.png}
PNGS_42_FLAT = ${SVGS_43:%.svg=build/png-country-4x2-flat/%.png}
PNGS_42_GLOSSY = ${SVGS_43:%.svg=build/png-country-4x2-glossy/%.png}
PNGS_42_NONE = ${SVGS_43:%.svg=build/png-country-4x2-none/%.png}
SVGS_11ALL=$(SVGS_11_FANCY) $(SVGS_11_SIMPLE) $(SVGS_11_FLAT) $(SVGS_11_GLOSSY) $(SVGS_11_NONE)
SVGS_42ALL=$(SVGS_42_FANCY) $(SVGS_42_SIMPLE) $(SVGS_42_FLAT) $(SVGS_42_GLOSSY) $(SVGS_42_NONE)
svgs: $(SVGS_11ALL) $(SVGS_42ALL)
$(Q)echo "Finished building svgs."
pngs: png-country-squared png-country-4x2
$(Q)echo "Finished building pngs."
## svg2svg squared
build/svg-country-squared-fancy/%.svg: svg/country-squared/%.svg
$(Q)$(SVG2SVG_11) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-squared-simple/%.svg: svg/country-squared/%.svg
$(Q)$(SVG2SVG_11) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-squared-flat/%.svg: svg/country-squared/%.svg
$(Q)$(SVG2SVG_11) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-squared-glossy/%.svg: svg/country-squared/%.svg
$(Q)$(SVG2SVG_11) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-squared-none/%.svg: svg/country-squared/%.svg
$(Q)$(SVG2SVG_110) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
## svg2svg 4x2
build/svg-country-4x2-fancy/%.svg: svg/country-4x3/%.svg
$(Q)$(SVG2SVG_43) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-4x2-simple/%.svg: svg/country-4x3/%.svg
$(Q)$(SVG2SVG_43) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-4x2-flat/%.svg: svg/country-4x3/%.svg
$(Q)$(SVG2SVG_43) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-4x2-glossy/%.svg: svg/country-4x3/%.svg
$(Q)$(SVG2SVG_43) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
build/svg-country-4x2-none/%.svg: svg/country-4x3/%.svg
$(Q)$(SVG2SVG_430) --out $(dir $@) \
--flag $(notdir ${<}) \
--svg $(notdir ${<})
png-country-4x2: $(SVGS_42ALL)
$(Q)scripts/png-country-4x2.sh
png-country-320x240-fancy: $(SVGS_42_FANCY)
$(Q)scripts/build.pl --cmd rsvg2png --out build --res "320x240" --svgs build/svg-country-4x2-fancy
png-country-squared: $(SVGS_11ALL)
$(Q)scripts/png-country-squared.sh
sheets:
$(Q)scripts/sheets.sh
xplanet:
$(Q)scripts/build.pl --cmd example xplanet --json iso-3166-1.json --out build --res 16x16 --lang all
kml:
$(Q)scripts/build.pl --cmd example kml --json iso-3166-1.json --out build --res 16x16 --lang all
wiki:
$(Q)scripts/build.pl --cmd example wm_commons --json iso-3166-1.json > ../iso-country-flags-svg-collection.wiki/Credits.md
distclean: clean
clean:
$(Q)/bin/rm -rvf build/svg-*/*.svg
$(Q)/bin/rm -rvf build/png-*/res-*
$(Q)/bin/rm -rvf build/png-*/sheets
$(Q)/bin/rm -rvf build/xplanet
$(Q)echo "Finished cleaning up build."
help:
@echo 'Cleaning targets:'
@echo ' clean - Remove most generated files'
@echo ' distclean - Remove all generated files.'
@echo ''
@echo 'Generic targets:'
@echo ' all - Build all targets marked with [*].'
@echo ' svgs [*] - Build the svg variants.'
@echo ' pngs [*] - Build the png variants.'
@echo ' sheets - Build sheets for the png variants.'
@echo ''
@echo 'Example targets:'
@echo ' kml - Build kml example file.'
@echo ' poster - Build svg flags of the world poster (wip).'
@echo ' xplanet - Build xplanet marker files.'
@echo ''
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
@echo ''
@echo ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README.md file'
-include Makefile.local
# Dummies...
PHONY += scripts
scripts: ;
PHONY += FORCE
FORCE:
.PHONY: $(PHONY)
|