-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
31 lines (25 loc) · 1.02 KB
/
Makefile
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
SOURCES = test/runtests.cpp \
test/fake_serial.cpp \
test/mock_arduino.cpp \
libraries/q_learning/StateController.cpp \
libraries/q_learning/QLearningMachine.cpp \
libraries/q_learning/State.cpp \
libraries/q_learning/Memory.cpp \
libraries/q_learning/SimpleMemory.cpp \
libraries/q_learning/RestState.cpp \
libraries/q_learning/MockState.cpp
OBJECTS := $(addsuffix .o, $(addprefix .build/, $(basename $(SOURCES))))
DEPFILES := $(subst .o,.dep, $(subst .build/,.deps/, $(OBJECTS)))
TESTCPPFLAGS = -D_TEST_ -D_INFO_ -D_DEBUG_ -D_ERROR_ -Itest -Ilibraries/q_learning -Iarduino
CPPDEPFLAGS = -MMD -MP -MF .deps/$(basename $<).dep
RUNTEST := $(if $(COMSPEC), runtest.exe, runtest)
all: runtests
.build/%.o: %.cpp
mkdir -p .deps/$(dir $<)
mkdir -p .build/$(dir $<)
$(COMPILE.cpp) $(TESTCPPFLAGS) $(CPPDEPFLAGS) -o $@ $<
runtests: $(OBJECTS)
$(CC) $(OBJECTS) -lstdc++ -o $@
clean:
@rm -rf runtests .deps/ .build/ $(RUNTEST)
-include $(DEPFILES)