|
|
|
@ -1,13 +1,14 @@
|
|
|
|
|
BIN_DIR=bin
|
|
|
|
|
LIB_DIR=lib
|
|
|
|
|
OBJ_DIR=obj
|
|
|
|
|
SRC_DIR=test
|
|
|
|
|
|
|
|
|
|
SKETCH_FILE=$(wildcard *.ino)
|
|
|
|
|
BIN_FILE=$(subst .ino,,$(SKETCH_FILE))
|
|
|
|
|
LIB_FILE=${BIN_FILE}-latest.a
|
|
|
|
|
|
|
|
|
|
TEST_FILES=$(wildcard *_test.cpp)
|
|
|
|
|
TEST_OBJS=$(patsubst %.cpp,${OBJ_DIR}/%.o,$(TEST_FILES))
|
|
|
|
|
TEST_FILES=$(wildcard $(SRC_DIR)/*_test.cpp)
|
|
|
|
|
TEST_OBJS=$(patsubst $(SRC_DIR)/%.cpp,${OBJ_DIR}/%.o,$(TEST_FILES))
|
|
|
|
|
|
|
|
|
|
run: ${BIN_DIR}/${BIN_FILE}
|
|
|
|
|
@echo "run"
|
|
|
|
@ -17,19 +18,32 @@ ${BIN_DIR}/${BIN_FILE}: ${TEST_OBJS} FORCE
|
|
|
|
|
@echo "link"
|
|
|
|
|
mkdir -p "${BIN_DIR}" "${LIB_DIR}"
|
|
|
|
|
env LIBONLY=yes LOCAL_CFLAGS='"-I$(PWD)"' OUTPUT_PATH="$(PWD)/$(LIB_DIR)" VERBOSE=1 $(MAKE) -f delegate.mk
|
|
|
|
|
g++ -o "${BIN_DIR}/${BIN_FILE}" -lpthread -g -w -lm -lXtst -lX11 ${TEST_OBJS} "${LIB_DIR}/${LIB_FILE}" -L"$(PWD)/../googletest/lib" -lgtest -lgmock
|
|
|
|
|
|
|
|
|
|
${OBJ_DIR}/%.o: %.cpp
|
|
|
|
|
g++ -o "${BIN_DIR}/${BIN_FILE}" \
|
|
|
|
|
-lpthread \
|
|
|
|
|
-g \
|
|
|
|
|
-w \
|
|
|
|
|
${TEST_OBJS} \
|
|
|
|
|
"${LIB_DIR}/${LIB_FILE}" \
|
|
|
|
|
-L"$(PWD)/../googletest/lib" \
|
|
|
|
|
-L"${PWD}/../lib" \
|
|
|
|
|
-lcommon \
|
|
|
|
|
-lgtest \
|
|
|
|
|
-lgmock \
|
|
|
|
|
-lm \
|
|
|
|
|
-lXtst \
|
|
|
|
|
-lX11
|
|
|
|
|
|
|
|
|
|
${OBJ_DIR}/%.o: ${SRC_DIR}/%.cpp
|
|
|
|
|
@echo "compile $@"
|
|
|
|
|
mkdir -p "${OBJ_DIR}"
|
|
|
|
|
g++ -o "$@" -c \
|
|
|
|
|
-I../.. \
|
|
|
|
|
-I../../src \
|
|
|
|
|
-I../../../../../virtual/cores/arduino \
|
|
|
|
|
-I../../../Kaleidoscope-HIDAdaptor-KeyboardioHID/src \
|
|
|
|
|
-I../../../KeyboardioHID/src \
|
|
|
|
|
-I../../testing/googletest/googlemock/include \
|
|
|
|
|
-I../../testing/googletest/googletest/include \
|
|
|
|
|
-I${PWD}/../.. \
|
|
|
|
|
-I${PWD}/../../src \
|
|
|
|
|
-I${PWD}/../../../../../virtual/cores/arduino \
|
|
|
|
|
-I${PWD}/../../../Kaleidoscope-HIDAdaptor-KeyboardioHID/src \
|
|
|
|
|
-I${PWD}/../../../KeyboardioHID/src \
|
|
|
|
|
-I${PWD}/../../testing/googletest/googlemock/include \
|
|
|
|
|
-I${PWD}/../../testing/googletest/googletest/include \
|
|
|
|
|
-DARDUINO=10607 \
|
|
|
|
|
-DARDUINO_AVR_MODEL01 \
|
|
|
|
|
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
|
|
|
|
|