-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (31 loc) · 1017 Bytes
/
makefile
File metadata and controls
41 lines (31 loc) · 1017 Bytes
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
TARGET_EXEC := cpp_interview
CXXFLAGS := -Wall -std=c++17 -g
BUILD_DIR := ./build
.PHONY: clean test run patch
# A list of source files used
SRCS := interview/main.cpp test/Tests.cpp
# Every folder in will need to be passed to GCC so that it can find header files
INC_DIRS := interview/ test/
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CPPFLAGS := $(INC_FLAGS) -MMD -MP
# Build it all
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
$(BUILD_DIR)/%.cpp.o: %.cpp
mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
clean:
rm -r $(BUILD_DIR)
test:
#$(BUILD_DIR)/$(TARGET_EXEC) test
$(BUILD_DIR)/$(TARGET_EXEC) ./data/data2.csv > ./data/result2c.csv
awk -f ./data/extract_agg_stat.awk ./data/data2.csv > ./data/result2a.csv
diff ./data/result2c.csv ./data/result2a.csv
run:
$(BUILD_DIR)/$(TARGET_EXEC) ./data/data.csv
patch:
git add .
git diff --binary origin/main > exyn_interview_solution.patch
-include $(DEPS)