Skip to content

Commit 481067b

Browse files
committed
cosmetics
1 parent b53a6d0 commit 481067b

13 files changed

+34
-145
lines changed

Makefile

+33-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
include generic.mk
1+
BIN?=bin
22

33
CXXFLAGS+=-std=c++14
44
CXXFLAGS+=-Wall -Wextra -Werror
55

6-
CXXFLAGS+=-Isrc/utils -I$(BIN)
6+
# Reduce executable size
7+
CXXFLAGS+=-fvisibility=hidden -fvisibility-inlines-hidden
8+
CXXFLAGS+=-ffunction-sections -fdata-sections
9+
LDFLAGS+=-Wl,-gc-sections
710

811
ifeq ($(DEBUG),1)
912
CXXFLAGS+=-g3
1013
LDFLAGS+=-g
1114
else
12-
CXXFLAGS+=-Os
15+
CFLAGS+=-w -DNDEBUG
16+
LDFLAGS+=-Xlinker -s
17+
CXXFLAGS+=-O3
1318
endif
1419

15-
# Reduce executable size
16-
CXXFLAGS+=-ffunction-sections -fdata-sections
17-
LDFLAGS+=-Wl,-gc-sections
20+
CXXFLAGS+=-Isrc/utils -I$(BIN)
21+
22+
all: everything
1823

1924
#------------------------------------------------------------------------------
2025
version:
@@ -39,24 +44,34 @@ SRCS_CW+=\
3944
src/utils/spec_utils.cpp\
4045

4146
SRCS_CW+=src/specs/av1_hdr10plus/av1_hdr10plus.cpp
42-
SRCS_CW+=src/specs/avif/avif.cpp
43-
SRCS_CW+=src/specs/avif/profiles.cpp
44-
SRCS_CW+=src/specs/avif/utils.cpp
47+
SRCS_CW+=src/specs/avif/avif.cpp src/specs/avif/profiles.cpp src/specs/avif/utils.cpp
4548
SRCS_CW+=src/specs/isobmff/isobmff.cpp
4649
SRCS_CW+=src/specs/heif/heif.cpp
47-
SRCS_CW+=src/specs/miaf/miaf.cpp
48-
SRCS_CW+=src/specs/miaf/audio.cpp
49-
SRCS_CW+=src/specs/miaf/brands.cpp
50-
SRCS_CW+=src/specs/miaf/derivations.cpp
51-
SRCS_CW+=src/specs/miaf/colours.cpp
52-
SRCS_CW+=src/specs/miaf/num_pixels.cpp
53-
SRCS_CW+=src/specs/miaf/profiles.cpp
50+
SRCS_CW+=src/specs/miaf/miaf.cpp src/specs/miaf/audio.cpp src/specs/miaf/brands.cpp\
51+
src/specs/miaf/derivations.cpp src/specs/miaf/colours.cpp src/specs/miaf/num_pixels.cpp\
52+
src/specs/miaf/profiles.cpp
5453

5554
SRCS_CW+=$(BIN)/cw_version.cpp
5655

56+
#------------------------------------------------------------------------------
57+
5758
TARGETS+=$(BIN)/cw.exe
58-
$(BIN)/cw.exe: $(SRCS_CW:%=$(BIN)/%.o)
5959

60-
#------------------------------------------------------------------------------
6160
everything: version $(TARGETS)
6261

62+
$(BIN)/cw.exe: $(SRCS_CW:%=$(BIN)/%.o)
63+
64+
$(BIN)/%.exe:
65+
@mkdir -p $(dir $@)
66+
$(CXX) -o "$@" $^ $(LDFLAGS)
67+
68+
$(BIN)/%.cpp.o: %.cpp
69+
@mkdir -p $(dir $@)
70+
$(CXX) $(CXXFLAGS) -c -o "$@" "$<"
71+
@$(CXX) $(CXXFLAGS) -c -o "$@.deps" "$<" -MP -MM -MT "$@"
72+
@$(CXX) $(CXXFLAGS) -c "$<" -E | wc -l > "$@.lines" # keep track of the code mass
73+
74+
clean:
75+
rm -rf $(BIN)
76+
77+
-include $(shell test -d $(BIN) && find $(BIN) -name "*.deps")

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ $ make
110110
### Emscripten (WASM)
111111

112112
```
113-
em++ -std=c++14 -DCW_WASM bin/cw_version.cpp `find src -name '*.cpp'` -Isrc/utils -o ComplianceWarden.js -O3 -s WASM=1 -s EXPORTED_FUNCTIONS="['_specFindC', '_specCheckC', '_specListRulesC', '_printVersion', '_free']" -s FORCE_FILESYSTEM=1 -s EXIT_RUNTIME=0 -s ALLOW_MEMORY_GROWTH=1 --pre-js wasm-fs-pre.js
113+
em++ -std=c++14 -DCW_WASM bin/cw_version.cpp `find src -name '*.cpp'` -Isrc/utils -o ComplianceWarden.js -O3 -s WASM=1 -s EXPORTED_FUNCTIONS="['_specFindC', '_specCheckC', '_specListRulesC', '_printVersion', '_free']" -s FORCE_FILESYSTEM=1 -s EXIT_RUNTIME=0 -s ALLOW_MEMORY_GROWTH=1 --pre-js scripts/wasm-fs-pre.js
114114
```
115115

116116
See https://gpac.github.io/ComplianceWarden-wasm/ for a demo.

generic.mk

-21
This file was deleted.
File renamed without changes.
File renamed without changes.

tests/binarize_me.txt

-5
This file was deleted.

tests/binarized.ref

-1
This file was deleted.

tests/dummy/invalid-forbidden-value-in-custom-box.asm

-24
This file was deleted.

tests/dummy/invalid-forbidden-value-in-custom-box.ref

-16
This file was deleted.

tests/dummy/invalid-no-ftyp.asm

-12
This file was deleted.

tests/dummy/invalid-no-ftyp.ref

-19
This file was deleted.

tests/dummy/valid.asm

-18
This file was deleted.

tests/dummy/valid.ref

-10
This file was deleted.

0 commit comments

Comments
 (0)