INCLUDE = -I../ \
-I../cfg \
-I../../../asp/include \
-I../../../asp/include/syssvc \
-I../../../asp/arch \
-I../../../asp/arch/arm_m_gcc/stm32f4xx_stm32cube \
-I../../../asp/arch/arm_m_gcc/common \
-I../../../asp/arch/ccrx \
-I../../../asp/arch/rx_rxc \
-I../../../asp/arch/rx630_ccrx \
-I../../../asp/arch/gcc \
-I../../../program_asp/device \
-I../../../asp/target/nucleo_f401re_gcc \
-I../../../asp/target/grsakura_ccrx

UNIT = ${wildcard ./*.cpp}

BUILD_DIR = ./build


init:
	mkdir -p build
	cd fff/gtest; $(MAKE) all

testBaseTimeCyclic:init
	g++ -o $(BUILD_DIR)/testBaseTimeCyclic $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testBaseTimeCyclic.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testBlinkMain:init
	g++ -o $(BUILD_DIR)/testBlinkMain $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testBlinkMain.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testBlinkSub:init
	g++ -o $(BUILD_DIR)/testBlinkSub $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testBlinkSub.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testLed4BlinkCyclic:init
	g++ -o $(BUILD_DIR)/testLed4BlinkCyclic $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testLed4BlinkCyclic.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testSwStateCyclic:init
	g++ -o $(BUILD_DIR)/testSwStateCyclic $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testSwStateCyclic.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testTimerMain:init
	g++ -o $(BUILD_DIR)/testTimerMain $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testTimerMain.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread

testTimerSub:init
	g++ -o $(BUILD_DIR)/testTimerSub $(INCLUDE) -fno-exceptions -O0 -g3 -DTOPPERS_OMIT_SYSLOG testTimerSub.cpp  fff/build/gtest-all.o fff/build/gtest-main.o -pthread


all:init testBaseTimeCyclic testBlinkMain testBlinkSub testLed4BlinkCyclic testSwStateCyclic testTimerMain testTimerSub 


clean: 
	cd fff/gtest; $(MAKE) clean
	cd ../; rm -rf build
