-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 938 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (26 loc) · 938 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
SHELL=/bin/bash
CXX = g++
CXXFLAGS = -g -std=c++14 -Wall -Wall -Werror=return-type \
-Werror=uninitialized -Wno-sign-compare
SRCS = $(wildcard *.cpp)
HEADERS = $(wildcard *.hpp)
OBJECTS = $(SRCS:%.cpp=%.o)
CATCH = test/catch/catch.o
TEST_SRCS = $(wildcard test/*.cpp)
TESTS = $(TEST_SRCS:test/%.cpp=%)
main: $(OBJECTS)
$(CXX) -o $@ $^
clean:
$(RM) *.o *.gc* test/*.o test/*.gc* *.dSYM $(TESTS) main $(CATCH)
test-all: $(TESTS)
%.o: %.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) -o $@ -c $<
test-1-node: test/test-1-node.o node.o
test-2-filesystem-create: test/test-2-filesystem-create.o filesystem.o node.o
test-3-filesystem-move: test/test-3-filesystem-move.o filesystem.o node.o
test-4-filesystem-remove: test/test-4-filesystem-remove.o filesystem.o node.o
$(TESTS): $(CATCH)
$(CXX) $(CXXFLAGS) -o $@ $^
./$@ --success
test-run: main
echo -e "ls\ntouch foo\nmkdir bar\ntouch foo\ncd bar\ntouch baz\ncd ..\nls\nexit\n" | ./main