-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (46 loc) · 1.72 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
SOURCES=main.c sfnt.c sfnt_subset.c sfnt_write.c embed.c embed_sfnt.c embed_pdf.c test_analyse.c dynstring.c test_pdf.c fontfile.c aglfn13.c frequent.c font_get.c woffer.c cff.c cff_tables.c
LIBOBJ=sfnt.o sfnt_subset.o sfnt_write.o embed.o embed_sfnt.o embed_pdf.o dynstring.o fontfile.o aglfn13.o frequent.o cff.o cff_tables.o
EXEC=ttfread test_analyze test_pdf test_ps font_get woffer test_cff
LIB=libfontembed.a
CFLAGS=-O3 -funroll-all-loops -finline-functions -Wall -g
CPPFLAGS=-Wall -g -DTESTFONT="\"/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf\""
LDFLAGS=
CPPFLAGS+=-DWOFF_SUPPORT
LDFLAGS+=-lz
OBJECTS=$(patsubst %.c,$(PREFIX)%$(SUFFIX).o,\
$(patsubst %.cpp,$(PREFIX)%$(SUFFIX).o,\
$(SOURCES)))
DEPENDS=$(patsubst %.c,$(PREFIX)%$(SUFFIX).d,\
$(patsubst %.cpp,$(PREFIX)%$(SUFFIX).d,\
$(filter-out %.o,""\
$(SOURCES))))
all: $(EXEC)
ifneq "$(MAKECMDGOALS)" "clean"
-include $(DEPENDS)
endif
clean:
rm -f $(EXEC) $(LIB) $(OBJECTS) $(DEPENDS)
%.d: %.c
@$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@;\
[ -s $@ ] || rm -f $@'
%.d: %.cpp
@$(SHELL) -ec '$(CXX) -MM $(CPPFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@;\
[ -s $@ ] || rm -f $@'
$(LIB): $(LIBOBJ)
$(AR) rcu $@ $^
ttfread: main.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
test_analyze: test_analyze.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
test_pdf: test_pdf.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
test_ps: test_ps.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
font_get: font_get.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
woffer: woffer.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
test_cff: test_cff.o $(LIB)
$(CXX) -o $@ $^ $(LDFLAGS)