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