Skip to content

Commit 7d2a1cb

Browse files
committed
makefile: clean up zip targets
1 parent 6a64cb5 commit 7d2a1cb

File tree

1 file changed

+30
-74
lines changed

1 file changed

+30
-74
lines changed

Makefile

Lines changed: 30 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -234,100 +234,43 @@ $(FONTDIR)/samples:
234234
.PHONY: samples
235235

236236

237-
238-
ZD = build/tmp/zip
239-
# intermediate zip target that creates a zip file at build/tmp/a.zip
240-
build/tmp/a.zip:
241-
@rm -rf "$(ZD)"
242-
@rm -f build/tmp/a.zip
243-
@mkdir -p \
244-
"$(ZD)/Inter" \
245-
"$(ZD)/Inter (Hinted, for Windows)" \
246-
"$(ZD)/Inter (Variable)" \
247-
"$(ZD)/Inter (Variable, single axis)" \
248-
"$(ZD)/Inter (Web)" \
249-
"$(ZD)/Inter V (Variable)"
250-
@#
251-
@# copy font files
252-
cp -a $(FONTDIR)/const/*.otf "$(ZD)/Inter/"
253-
@#
254-
cp -a $(FONTDIR)/const/*.woff \
255-
$(FONTDIR)/const/*.woff2 \
256-
$(FONTDIR)/var/Inter.var.woff2 \
257-
$(FONTDIR)/var/Inter-italic.var.woff2 \
258-
$(FONTDIR)/var/Inter-roman.var.woff2 \
259-
$(FONTDIR)/var/InterDisplay.var.woff2 \
260-
$(FONTDIR)/var/InterDisplay-italic.var.woff2 \
261-
$(FONTDIR)/var/InterDisplay-roman.var.woff2 \
262-
misc/dist/inter.css \
263-
"$(ZD)/Inter (Web)/"
264-
cp -a $(FONTDIR)/const-hinted/*.woff \
265-
$(FONTDIR)/const-hinted/*.woff2 \
266-
$(FONTDIR)/const-hinted/*.ttf \
267-
misc/dist/inter.css \
268-
"misc/dist/about hinted fonts.txt" \
269-
"$(ZD)/Inter (Hinted, for Windows)/"
270-
@#
271-
cp -a $(FONTDIR)/var/Inter.var.otf "$(ZD)/Inter (Variable)/Inter.otf"
272-
cp -a $(FONTDIR)/var/Inter-roman.var.otf "$(ZD)/Inter (Variable, single axis)/Inter-roman.otf"
273-
cp -a $(FONTDIR)/var/Inter-italic.var.otf "$(ZD)/Inter (Variable, single axis)/Inter-italic.otf"
274-
cp -a $(FONTDIR)/var/InterDisplay.var.otf "$(ZD)/Inter (Variable)/InterDisplay.otf"
275-
cp -a $(FONTDIR)/var/InterDisplay-roman.var.otf "$(ZD)/Inter (Variable, single axis)/InterDisplay-roman.otf"
276-
cp -a $(FONTDIR)/var/InterDisplay-italic.var.otf "$(ZD)/Inter (Variable, single axis)/InterDisplay-italic.otf"
277-
@#
278-
cp -a $(FONTDIR)/var/Inter-V.var.otf "$(ZD)/Inter V (Variable)/Inter-V.otf"
279-
cp -a $(FONTDIR)/var/InterDisplay-V.var.otf "$(ZD)/Inter V (Variable)/InterDisplay-V.otf"
280-
@#
281-
@# copy misc stuff
282-
cp -a misc/dist/install*.txt "$(ZD)/"
283-
cp -a LICENSE.txt "$(ZD)/"
284-
@#
285-
@# zip
286-
cd "$(ZD)" && zip -q -X -r "../../../$@" * && cd ../..
287-
@rm -rf "$(ZD)"
288-
289237
# load version, used by zip and dist
290238
VERSION := $(shell cat version.txt)
291239

292240
# distribution zip files
293241
ZIP_FILE_DIST := build/release/Inter-${VERSION}.zip
294242

295-
# zip
296-
build/release/Inter-%.zip: build/tmp/a.zip
297-
@mkdir -p "$(shell dirname "$@")"
298-
@mv -f "$<" "$@"
299-
@echo write "$@"
300-
@sh -c "if [ -f /usr/bin/open ]; then /usr/bin/open --reveal '$@'; fi"
301-
302243
zip: all
303244
$(MAKE) check_text check_display
304-
bash misc/makezip.sh -all \
245+
bash misc/makezip.sh -all -reveal-in-finder \
305246
"build/release/Inter-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip"
306247

307-
zip_text: all
248+
zip_text: all_text
308249
$(MAKE) check_text
309-
bash misc/makezip.sh -text \
250+
bash misc/makezip.sh -text -reveal-in-finder \
310251
"build/release/Inter-${VERSION}-text-$(shell git rev-parse --short=10 HEAD).zip"
311252

312-
zip_display: all
253+
zip_display: all_display
313254
$(MAKE) check_display
314-
bash misc/makezip.sh -display \
255+
bash misc/makezip.sh -display -reveal-in-finder \
315256
"build/release/Inter-${VERSION}-display-$(shell git rev-parse --short=10 HEAD).zip"
316257

317-
zip_dist: pre_dist
258+
259+
dist_zip: dist_check dist_build
318260
$(MAKE) check_text
319-
bash misc/makezip.sh -text "build/release/Inter-${VERSION}.zip"
261+
bash misc/makezip.sh -text -reveal-in-finder "$(ZIP_FILE_DIST)"
262+
263+
dist_build: all_text
264+
misc/tools/versionize.py
320265

321-
# distribution
322-
pre_dist: all_text
266+
dist_check:
323267
@echo "Creating distribution for version ${VERSION}"
324-
@if [ -f "${ZIP_FILE_DIST}" ]; \
325-
then echo "${ZIP_FILE_DIST} already exists. Bump version or remove the zip file to continue." >&2; \
268+
@if [ -f "${ZIP_FILE_DIST}" ]; then \
269+
echo "${ZIP_FILE_DIST} already exists. Bump version or remove the zip file to continue." >&2; \
326270
exit 1; \
327271
fi
328-
misc/tools/versionize.py
329272

330-
dist: zip_dist
273+
dist: dist_zip
331274
$(MAKE) -j docs
332275
@echo "——————————————————————————————————————————————————————————————————"
333276
@echo ""
@@ -353,9 +296,22 @@ docs_info: docs/_data/fontinfo.json \
353296
docs/lab/glyphinfo.json \
354297
docs/glyphs/metrics.json
355298

356-
docs_fonts:
299+
docs_fonts: docs_fonts_text docs_fonts_display
300+
docs_fonts_pre:
357301
rm -rf docs/font-files
358302
mkdir docs/font-files
303+
304+
docs_fonts_text: docs_fonts_pre
305+
cp -a $(FONTDIR)/const/*.woff \
306+
$(FONTDIR)/const/*.woff2 \
307+
$(FONTDIR)/const/*.otf \
308+
$(FONTDIR)/var/Inter.var.* \
309+
$(FONTDIR)/var/InterDisplay.var.* \
310+
$(FONTDIR)/var/Inter*-roman.var.* \
311+
$(FONTDIR)/var/Inter*-italic.var.* \
312+
docs/font-files/
313+
314+
docs_fonts_display: docs_fonts_pre
359315
cp -a $(FONTDIR)/const/*.woff \
360316
$(FONTDIR)/const/*.woff2 \
361317
$(FONTDIR)/const/*.otf \
@@ -365,7 +321,7 @@ docs_fonts:
365321
$(FONTDIR)/var/Inter*-italic.var.* \
366322
docs/font-files/
367323

368-
.PHONY: docs docs_info docs_fonts
324+
.PHONY: docs docs_info docs_fonts docs_fonts_pre docs_fonts_text docs_fonts_display
369325

370326
docs/_data/fontinfo.json: docs/font-files/Inter-Regular.otf misc/tools/fontinfo.py
371327
misc/tools/fontinfo.py -pretty $< > docs/_data/fontinfo.json

0 commit comments

Comments
 (0)