-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
85 lines (67 loc) · 2.22 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
BIN?=bin
CXXFLAGS+=-std=c++14
CXXFLAGS+=-Wall -Wextra -Werror
# Reduce executable size
CXXFLAGS+=-fvisibility=hidden -fvisibility-inlines-hidden
CXXFLAGS+=-ffunction-sections -fdata-sections
LDFLAGS+=-Wl,-gc-sections
ifeq ($(DEBUG),1)
CXXFLAGS+=-g3
LDFLAGS+=-g
else
CFLAGS+=-w -DNDEBUG
LDFLAGS+=-Xlinker -s
CXXFLAGS+=-O3
endif
CXXFLAGS+=-Isrc/ -I$(BIN)
all: everything
#------------------------------------------------------------------------------
version:
@mkdir -p $(BIN)
@scripts/version.sh > $(BIN)/cw_version.cpp.new
@if ! diff -q $(BIN)/cw_version.cpp $(BIN)/cw_version.cpp.new >/dev/null ; then \
mv $(BIN)/cw_version.cpp.new $(BIN)/cw_version.cpp; \
else \
rm $(BIN)/cw_version.cpp.new; \
fi
$(BIN)/cw_version.cpp: version
#------------------------------------------------------------------------------
SRCS_CW+=\
src/app/cw.cpp\
src/app/options.cpp\
src/app/json.cpp\
src/app/list_std.cpp\
src/app/list_json.cpp\
src/app/report_std.cpp\
src/app/report_json.cpp\
src/core/common_boxes.cpp\
src/utils/tools.cpp\
src/utils/av1_utils.cpp\
src/utils/isobmff_get_data.cpp\
src/utils/isobmff_utils.cpp\
src/utils/isobmff_derivations.cpp\
src/utils/spec_utils.cpp\
SRCS_CW+=src/specs/av1_hdr10plus/av1_hdr10plus.cpp
SRCS_CW+=src/specs/av1_isobmff/av1_isobmff.cpp
SRCS_CW+=src/specs/avif/avif.cpp src/specs/avif/profiles.cpp src/specs/avif/utils.cpp
SRCS_CW+=src/specs/isobmff/isobmff.cpp
SRCS_CW+=src/specs/heif/heif.cpp
SRCS_CW+=src/specs/miaf/miaf.cpp src/specs/miaf/audio.cpp src/specs/miaf/brands.cpp\
src/specs/miaf/derivations.cpp src/specs/miaf/colours.cpp src/specs/miaf/num_pixels.cpp\
src/specs/miaf/profiles.cpp
SRCS_CW+=$(BIN)/cw_version.cpp
#------------------------------------------------------------------------------
TARGETS+=$(BIN)/cw.exe
everything: version $(TARGETS)
$(BIN)/cw.exe: $(SRCS_CW:%=$(BIN)/%.o)
$(BIN)/%.exe:
@mkdir -p $(dir $@)
$(CXX) -o "$@" $^ $(LDFLAGS)
$(BIN)/%.cpp.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c -o "$@" "$<"
@$(CXX) $(CXXFLAGS) -c -o "$@.deps" "$<" -MP -MM -MT "$@"
@$(CXX) $(CXXFLAGS) -c "$<" -E | wc -l > "$@.lines" # keep track of the code mass
clean:
rm -rf $(BIN)
-include $(shell test -d $(BIN) && find $(BIN) -name "*.deps")