also make zero/ and zero. variants in Makefile
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
diff --git a/Makefile b/Makefile
index bff933e..84ccfee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,23 @@
.PHONY: FORCE
-SOURCES = sfd/IBM-Courier.sfd sfd/IBM-Courier-Italic.sfd sfd/IBM-Courier-Bold.sfd sfd/IBM-Courier-Bold-Italic.sfd
+SFD_SOURCES := sfd/IBM-Courier.sfd sfd/IBM-Courier-Italic.sfd sfd/IBM-Courier-Bold.sfd sfd/IBM-Courier-Bold-Italic.sfd
+SFD_ZERO_SLASH := $(patsubst sfd/%.sfd,sfd/zero-slash/%-zero-slash.sfd,$(SFD_SOURCES))
+SFD_ZERO_DOT := $(patsubst sfd/%.sfd,sfd/zero-dot/%-zero-dot.sfd,$(SFD_SOURCES))
+SFD := $(SFD_SOURCES) $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT)
-TTF = $(patsubst sfd/%.sfd,fonts/%.ttf,$(SOURCES))
-WOFF = $(patsubst sfd/%.sfd,fonts/%.woff,$(SOURCES))
-WOFF2 = $(patsubst sfd/%.sfd,fonts/%.woff2,$(SOURCES))
-SVG = $(patsubst sfd/%.sfd,fonts/%.svg,$(SOURCES))
-OTF = $(patsubst sfd/%.sfd,fonts/%.otf,$(SOURCES))
+TTF := $(patsubst sfd/%.sfd,fonts/%.ttf,$(SFD))
+WOFF := $(patsubst sfd/%.sfd,fonts/%.woff,$(SFD))
+WOFF2 := $(patsubst sfd/%.sfd,fonts/%.woff2,$(SFD))
+SVG := $(patsubst sfd/%.sfd,fonts/%.svg,$(SFD))
+OTF := $(patsubst sfd/%.sfd,fonts/%.otf,$(SFD))
default: FORCE $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF)
+sfd: $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT)
+
+echo: FORCE
+ for file in $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) ; do echo $$file ; done
+
fonts/%.ttf: sfd/%.sfd Makefile bin/convert.py
bin/convert.py "$<" "$@"
fonts/%.woff: sfd/%.sfd Makefile bin/convert.py
@@ -21,5 +29,14 @@ fonts/%.svg: sfd/%.sfd Makefile bin/convert.py
fonts/%.otf: sfd/%.sfd Makefile bin/convert.py
bin/convert.py "$<" "$@"
+sfd/zero-dot/%-zero-dot.sfd: sfd/%.sfd Makefile bin/zeroslash.py
+ mkdir -p $(<D)
+ bin/zeroslash.py --char zerodot "$<" "$@.tmp.sfd"
+ mv "$@.tmp.sfd" "$@"
+sfd/zero-slash/%-zero-slash.sfd: sfd/%.sfd Makefile bin/zeroslash.py
+ mkdir -p $(<D)
+ bin/zeroslash.py --char zeroslash "$<" "$@.tmp.sfd"
+ mv "$@.tmp.sfd" "$@"
+
clean:
- /bin/rm $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) >/dev/null 2>/dev/null || true
+ /bin/rm $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT) $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) >/dev/null 2>/dev/null || true