forked from gbowne1/GearForge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 773 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 773 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
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Iinclude
LDFLAGS = -lglog
TEST_LDFLAGS = -lgtest -lgtest_main -pthread
SOURCES = src/main.cpp src/gear_calculator.cpp src/ui.cpp src/user_manager.cpp src/utils.cpp
TEST_SOURCES = tests/main_test.cpp src/gear_calculator.cpp src/utils.cpp src/user_manager.cpp
OBJECTS = $(SOURCES:.cpp=.o)
TEST_OBJECTS = $(TEST_SOURCES:.cpp=.o)
OUT = build/gearforge
TEST_OUT = build/tests
all: $(OUT) $(TEST_OUT)
$(OUT): $(OBJECTS)
@mkdir -p build
$(CXX) $(OBJECTS) -o $(OUT) $(LDFLAGS)
$(TEST_OUT): $(TEST_OBJECTS)
@mkdir -p build
$(CXX) $(TEST_OBJECTS) -o $(TEST_OUT) $(TEST_LDFLAGS) $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf build *.o src/*.o tests/*.o
test: $(TEST_OUT)
./$(TEST_OUT)
.PHONY: all clean test