forked from google/woff2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (34 loc) · 1.12 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
OS := $(shell uname)
CPPFLAGS = -I./brotli/dec/ -I./brotli/enc/ -I./src
CC ?= gcc
CXX ?= g++
COMMON_FLAGS = -fno-omit-frame-pointer -no-canonical-prefixes -DFONT_COMPRESSION_BIN -D __STDC_FORMAT_MACROS
ifeq ($(OS), Darwin)
CPPFLAGS += -DOS_MACOSX
else
COMMON_FLAGS += -fno-tree-vrp
endif
CFLAGS += $(COMMON_FLAGS)
CXXFLAGS += $(COMMON_FLAGS) -std=c++11
SRCDIR = src
OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
woff2_dec.o woff2_enc.o woff2_common.o variable_length.o
BROTLI = brotli
ENCOBJ = $(BROTLI)/enc/*.o
DECOBJ = $(BROTLI)/dec/*.o
OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
EXECUTABLES=woff2_compress woff2_decompress
EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))
ifeq (,$(wildcard $(BROTLI)/*))
$(error Brotli dependency not found : you must initialize the Git submodule)
endif
all : $(OBJS) $(EXECUTABLES)
$(EXECUTABLES) : $(EXE_OBJS) deps
$(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/[email protected] -o $@
deps :
$(MAKE) -C $(BROTLI)/dec
$(MAKE) -C $(BROTLI)/enc
clean :
rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
$(MAKE) -C $(BROTLI)/dec clean
$(MAKE) -C $(BROTLI)/enc clean