-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 1.01 KB
/
Makefile
File metadata and controls
37 lines (26 loc) · 1.01 KB
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
CXX ?= g++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
CPPFLAGS ?= -Isource/commonlib -Isource/arithmetic_coder -Isource/arithmetic_coder/third_party -Isource/encoder -Isource/decoder
BUILD_DIR := build
COMMON_SRCS := \
source/commonlib/coding_unit.cpp \
source/commonlib/global_arithmetic.cpp \
source/commonlib/utility.cpp \
source/arithmetic_coder/acodec.cpp \
source/arithmetic_coder/third_party/arithmetic_codec.cpp
ENCODER_SRCS := source/encoder/encoder.cpp source/encoder/encOptions.cpp
DECODER_SRCS := source/decoder/decoder.cpp source/decoder/decOptions.cpp
COMMON_OBJS := $(COMMON_SRCS:%=$(BUILD_DIR)/%.o)
ENCODER_OBJS := $(ENCODER_SRCS:%=$(BUILD_DIR)/%.o)
DECODER_OBJS := $(DECODER_SRCS:%=$(BUILD_DIR)/%.o)
.PHONY: all clean
all: encoder decoder
encoder: $(COMMON_OBJS) $(ENCODER_OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@
decoder: $(COMMON_OBJS) $(DECODER_OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@
$(BUILD_DIR)/%.o: %
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf $(BUILD_DIR) encoder decoder