diff --git a/Makefile b/Makefile index f1a3598b5f..bfa2063099 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,6 @@ SERIAL_DEVICE ?= $(firstword $(wildcard /dev/ttyUSB*) no-port-found) # Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override. FLASH_SIZE ?= -## V : Set verbosity level based on the V= parameter -## V=0 Low -## V=1 High -include build_verbosity.mk ############################################################################### # Things that need to be maintained as the source changes @@ -58,6 +54,11 @@ INCLUDE_DIRS = $(SRC_DIR) \ $(ROOT)/src/main/target LINKER_DIR = $(ROOT)/src/main/target/link +## V : Set verbosity level based on the V= parameter +## V=0 Low +## V=1 High +include $(ROOT)/make/build_verbosity.mk + # Build tools, so we all share the same versions # import macros common to all supported build systems include $(ROOT)/make/system-id.mk diff --git a/build_verbosity.mk b/make/build_verbosity.mk similarity index 100% rename from build_verbosity.mk rename to make/build_verbosity.mk diff --git a/src/test/Makefile b/src/test/Makefile index f33bc3e12d..c31d875f38 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -8,6 +8,163 @@ # make TARGET - makes the given target. # make clean - removes all files generated by make. + +# Where to find user code. +USER_DIR = ../main + + +# specify which files that are included in the test in addition to the unittest file. +# variables available: +# _SRC +# _DEFINES + + +alignsensor_unittest_SRC := \ + $(USER_DIR)/sensors/boardalignment.c \ + $(USER_DIR)/common/maths.c + + +altitude_hold_unittest_SRC := \ + $(USER_DIR)/flight/altitudehold.c + + +baro_bmp085_unittest_SRC := \ + $(USER_DIR)/drivers/barometer_bmp085.c \ + $(USER_DIR)/drivers/io.c + + +baro_bmp280_unittest_SRC := \ + $(USER_DIR)/drivers/barometer_bmp280.c + + +baro_ms5611_unittest_SRC := \ + $(USER_DIR)/drivers/barometer_ms5611.c + + +battery_unittest_SRC := \ + $(USER_DIR)/sensors/battery.c \ + $(USER_DIR)/common/maths.c + + +cms_unittest_SRC := \ + $(USER_DIR)/cms/cms.c \ + $(USER_DIR)/common/typeconversion.c \ + $(USER_DIR)/drivers/display.c + + +common_filter_unittest_SRC := \ + $(USER_DIR)/common/filter.c + + +encoding_unittest_SRC := \ + $(USER_DIR)/common/encoding.c + + +flight_failsafe_unittest_SRC := \ + $(USER_DIR)/flight/failsafe.c + + +flight_imu_unittest_SRC := \ + $(USER_DIR)/flight/imu.c \ + $(USER_DIR)/flight/altitudehold.c \ + $(USER_DIR)/common/maths.c + + +flight_mixer_unittest := \ + $(USER_DIR)/flight/mixer.c \ + $(USER_DIR)/flight/servos.c \ + $(USER_DIR)/common/maths.c + + +gps_conversion_unittest_SRC := \ + $(USER_DIR)/common/gps_conversion.c + + +io_serial_unittest_SRC := \ + $(USER_DIR)/io/serial.c + + +ledstrip_unittest_SRC := \ + $(USER_DIR)/io/ledstrip.c + + +maths_unittest_SRC := \ + $(USER_DIR)/common/maths.c + + +parameter_groups_unittest_SRC := \ + $(USER_DIR)/config/parameter_group.c + + +rc_controls_unittest_SRC := \ + $(USER_DIR)/fc/rc_controls.c \ + $(USER_DIR)/common/maths.c + + +rx_crsf_unittest_SRC := \ + $(USER_DIR)/rx/crsf.c \ + $(USER_DIR)/common/maths.c + + +rx_ibus_unittest_SRC := \ + $(USER_DIR)/rx/ibus.c + + +rx_ranges_unittest_SRC := \ + $(USER_DIR)/rx/rx.c \ + $(USER_DIR)/common/maths.c + + +rx_rx_unittest_SRC := \ + $(USER_DIR)/rx/rx.c \ + $(USER_DIR)/common/maths.c + + +sensor_gyro_unittest_SRC := \ + $(USER_DIR)/sensors/gyro.c \ + $(USER_DIR)/sensors/boardalignment.c \ + $(USER_DIR)/build/debug.c \ + $(USER_DIR)/common/filter.c \ + $(USER_DIR)/common/maths.c \ + $(USER_DIR)/drivers/accgyro_fake.c \ + $(USER_DIR)/drivers/gyro_sync.c + + +telemetry_crsf_unittest_SRC := \ + $(USER_DIR)/rx/crsf.c \ + $(USER_DIR)/telemetry/crsf.c \ + $(USER_DIR)/common/maths.c \ + $(USER_DIR)/common/streambuf.c \ + $(USER_DIR)/common/gps_conversion.c \ + $(USER_DIR)/fc/runtime_config.c + +telemetry_crsf_unittest_DEFINES := \ + FLASH_SIZE=128 \ + STM32F10X_MD \ + __TARGET__="TEST" \ + __REVISION__="revision" + + +telemetry_hott_unittest_SRC := \ + $(USER_DIR)/telemetry/hott.c \ + $(USER_DIR)/common/gps_conversion.c + + +telemetry_ibus_unittest_SRC := \ + $(USER_DIR)/telemetry/ibus_shared.c \ + $(USER_DIR)/telemetry/ibus.c + + +type_conversion_unittest_SRC := \ + $(USER_DIR)/common/typeconversion.c + + +ws2811_unittest_SRC := \ + $(USER_DIR)/drivers/light_ws2811strip.c + + + + # Please tweak the following variable definitions as needed by your # project, except GTEST_HEADERS, which you can use in your own targets # but shouldn't modify. @@ -16,8 +173,7 @@ # Remember to tweak this if you move this file. GTEST_DIR = ../../lib/test/gtest -# Where to find user code. -USER_DIR = ../main + TEST_DIR = unit USER_INCLUDE_DIR = $(USER_DIR) @@ -30,9 +186,9 @@ CXX := clang++ COMMON_FLAGS = \ -g \ -Wall \ - -pthread \ -Wextra \ -ggdb3 \ + -pthread \ -O0 \ -DUNIT_TEST \ -isystem $(GTEST_DIR)/inc \ @@ -63,7 +219,6 @@ endif # Gather up all of the tests. TEST_SRC = $(sort $(wildcard $(TEST_DIR)/*.cc)) TESTS = $(TEST_SRC:$(TEST_DIR)/%.cc=%) -TEST_BINARIES = $(TESTS:%=$(OBJECT_DIR)/%) # All Google Test headers. Usually you shouldn't change this # definition. @@ -72,12 +227,38 @@ GTEST_HEADERS = $(GTEST_DIR)/inc/gtest/*.h ## V : Set verbosity level based on the V= parameter ## V=0 Low ## V=1 High -include ../../build_verbosity.mk +include ../../make/build_verbosity.mk # House-keeping build targets. -## all : Build all Unit Tests (Default goal) -all : $(TEST_BINARIES) +## test : Build and run the Unit Tests (default goal) +test: $(TESTS:%=test-%) + +## junittest : Build and run the Unit Tests, producing Junit XML result files." +junittest: EXEC_OPTS = "--gtest_output=xml:$<_results.xml" +junittest: $(TESTS:%=test-%) + + + +## help : print this help message and exit +## what : print this help message and exit +## usage : print this help message and exit +help what usage: Makefile + @echo "" + @echo "Makefile for Unit Tests" + @echo "" + @echo "Usage:" + @echo " make [goal] " + @echo "" + @echo "Valid goals are:" + @echo "" + @sed -n 's/^## //p' $< + @echo "" + @echo "Any of the Unit Test programs can be used as goals to build:" + @$(foreach test, $(TESTS), echo " $(OBJECT_DIR)/$(test)/$(test)";) + @echo "" + @echo "Any of the Unit Test programs can be used as goals to build and run:" + @$(foreach test, $(TESTS), echo " test-$(test)";) ## clean : Cleanup the UnitTest binaries. clean : @@ -124,1010 +305,56 @@ TEST_INCLUDE_DIRS := $(TEST_DIR) \ TEST_CFLAGS = $(addprefix -I,$(TEST_INCLUDE_DIRS)) -DEPS = $(TEST_BINARIES:%=%.d) -$(OBJECT_DIR)/common/maths.o : \ - $(USER_DIR)/common/maths.c \ - $(USER_DIR)/common/maths.h \ - $(GTEST_HEADERS) +# canned recipe for all test builds +# param $1 = testname +define test-specific-stuff - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/common/maths.c -o $@ +$$1_OBJS = $$(patsubst $$(USER_DIR)%,$$(OBJECT_DIR)/$1%,$$($1_SRC:=.o)) -$(OBJECT_DIR)/maths_unittest.o : \ - $(TEST_DIR)/maths_unittest.cc \ - $(GTEST_HEADERS) +# $$(info $1 -v-v-------) +# $$(info $1_SRC: $($1_SRC)) +# $$(info $1_OBJS: $$($$1_OBJS)) +# $$(info $1 -^-^-------) - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/maths_unittest.cc -o $@ -$(OBJECT_DIR)/maths_unittest : \ - $(OBJECT_DIR)/maths_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ +#include generated dependencies +-include $$($$1_OBJS:.o=.d) +-include $(OBJECT_DIR)/$1/$1.d + + +$(OBJECT_DIR)/$1/%.c.o: $(USER_DIR)/%.c + @echo "compiling $$<" "$(STDOUT)" + $(V1) mkdir -p $$(dir $$@) + $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) \ + $(foreach def,$1_DEFINES,-D $(def)) \ + -c $$< -o $$@ + + +$(OBJECT_DIR)/$1/$1.o: $(TEST_DIR)/$1.cc + @echo "compiling $$<" "$(STDOUT)" + $(V1) mkdir -p $$(dir $$@) + $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) \ + $(foreach def,$1_DEFINES,-D $(def)) \ + -c $$< -o $$@ + + +$(OBJECT_DIR)/$1/$1 : $$($$1_OBJS) \ + $(OBJECT_DIR)/$1/$1.o \ $(OBJECT_DIR)/gtest_main.a - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ + @echo "linking $$@" "$(STDOUT)" + $(V1) mkdir -p $(dir $$@) + $(V1) $(CXX) $(CXX_FLAGS) $(PG_FLAGS) $$^ -o $$@ --include $(OBJECT_DIR)/maths_unittest.d \ - $(OBJECT_DIR)/common/maths.d +test-$1: $(OBJECT_DIR)/$1/$1 + $(V1) $$< $(EXEC_OPTS) "$(STDOUT)" && echo "running $$@: PASS" -$(OBJECT_DIR)/common/filter.o : \ - $(USER_DIR)/common/filter.c \ - $(USER_DIR)/common/filter.h \ - $(GTEST_HEADERS) +endef - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/common/filter.c -o $@ +#apply the canned recipe above to all tests +$(eval $(foreach test,$(TESTS),$(call test-specific-stuff,$(test)))) -$(OBJECT_DIR)/common_filter_unittest.o : \ - $(TEST_DIR)/common_filter_unittest.cc \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/common_filter_unittest.cc -o $@ - -$(OBJECT_DIR)/common_filter_unittest : \ - $(OBJECT_DIR)/common_filter_unittest.o \ - $(OBJECT_DIR)/common/filter.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common_filter_unittest.d \ - $(OBJECT_DIR)/common/filter.d - - -$(OBJECT_DIR)/common/encoding.o : $(USER_DIR)/common/encoding.c $(USER_DIR)/common/encoding.h $(GTEST_HEADERS) - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/common/encoding.c -o $@ - -$(OBJECT_DIR)/encoding_unittest.o : \ - $(TEST_DIR)/encoding_unittest.cc \ - $(USER_DIR)/common/encoding.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/encoding_unittest.cc -o $@ - -$(OBJECT_DIR)/encoding_unittest : \ - $(OBJECT_DIR)/common/encoding.o \ - $(OBJECT_DIR)/encoding_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common/encoding.d \ - $(OBJECT_DIR)/encoding_unittest.d - - -$(OBJECT_DIR)/common/typeconversion.o : \ - $(USER_DIR)/common/typeconversion.c \ - $(USER_DIR)/common/typeconversion.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/common/typeconversion.c -o $@ - -$(OBJECT_DIR)/type_conversion_unittest.o : \ - $(TEST_DIR)/type_conversion_unittest.cc \ - $(USER_DIR)/common/typeconversion.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/type_conversion_unittest.cc -o $@ - -$(OBJECT_DIR)/type_conversion_unittest : \ - $(OBJECT_DIR)/common/typeconversion.o \ - $(OBJECT_DIR)/type_conversion_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common/typeconversion.d \ - $(OBJECT_DIR)/type_conversion_unittest.d - - -$(OBJECT_DIR)/fc/runtime_config.o : \ - $(USER_DIR)/fc/runtime_config.c \ - $(USER_DIR)/fc/runtime_config.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -D'FLASH_SIZE = 128' -DSTM32F10X_MD -c $(USER_DIR)/fc/runtime_config.c -o $@ - -$(OBJECT_DIR)/flight/imu.o : \ - $(USER_DIR)/flight/imu.c \ - $(USER_DIR)/flight/imu.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/flight/imu.c -o $@ - -$(OBJECT_DIR)/flight_imu_unittest.o : \ - $(TEST_DIR)/flight_imu_unittest.cc \ - $(USER_DIR)/flight/imu.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/flight_imu_unittest.cc -o $@ - -$(OBJECT_DIR)/flight_imu_unittest : \ - $(OBJECT_DIR)/flight/imu.o \ - $(OBJECT_DIR)/flight/altitudehold.o \ - $(OBJECT_DIR)/flight_imu_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/flight/imu.d \ - $(OBJECT_DIR)/flight/altitudehold.d \ - $(OBJECT_DIR)/flight_imu_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/flight/altitudehold.o : \ - $(USER_DIR)/flight/altitudehold.c \ - $(USER_DIR)/flight/altitudehold.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/flight/altitudehold.c -o $@ - -$(OBJECT_DIR)/altitude_hold_unittest.o : \ - $(TEST_DIR)/altitude_hold_unittest.cc \ - $(USER_DIR)/flight/altitudehold.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/altitude_hold_unittest.cc -o $@ - -$(OBJECT_DIR)/altitude_hold_unittest : \ - $(OBJECT_DIR)/flight/altitudehold.o \ - $(OBJECT_DIR)/altitude_hold_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/flight/altitudehold.d \ - $(OBJECT_DIR)/altitude_hold_unittest.d - - -$(OBJECT_DIR)/common/gps_conversion.o : \ - $(USER_DIR)/common/gps_conversion.c \ - $(USER_DIR)/common/gps_conversion.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/common/gps_conversion.c -o $@ - -$(OBJECT_DIR)/gps_conversion_unittest.o : \ - $(TEST_DIR)/gps_conversion_unittest.cc \ - $(USER_DIR)/common/gps_conversion.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/gps_conversion_unittest.cc -o $@ - -$(OBJECT_DIR)/gps_conversion_unittest : \ - $(OBJECT_DIR)/common/gps_conversion.o \ - $(OBJECT_DIR)/gps_conversion_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common/gps_conversion.d \ - $(OBJECT_DIR)/gps_conversion_unittest.d - - -$(OBJECT_DIR)/flight/mixer.o : \ - $(USER_DIR)/flight/mixer.c \ - $(USER_DIR)/flight/mixer.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/flight/mixer.c -o $@ - -$(OBJECT_DIR)/flight/servos.o : \ - $(USER_DIR)/flight/servos.c \ - $(USER_DIR)/flight/servos.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/flight/servos.c -o $@ - -$(OBJECT_DIR)/flight_mixer_unittest.o : \ - $(TEST_DIR)/flight_mixer_unittest.cc \ - $(USER_DIR)/flight/mixer.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/flight_mixer_unittest.cc -o $@ - -$(OBJECT_DIR)/flight_mixer_unittest : \ - $(OBJECT_DIR)/flight/mixer.o \ - $(OBJECT_DIR)/flight/servos.o \ - $(OBJECT_DIR)/flight_mixer_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/flight/mixer.d \ - $(OBJECT_DIR)/flight/servos.d \ - $(OBJECT_DIR)/flight_mixer_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/flight/failsafe.o : \ - $(USER_DIR)/flight/failsafe.c \ - $(USER_DIR)/flight/failsafe.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/flight/failsafe.c -o $@ - -$(OBJECT_DIR)/flight_failsafe_unittest.o : \ - $(TEST_DIR)/flight_failsafe_unittest.cc \ - $(USER_DIR)/flight/failsafe.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/flight_failsafe_unittest.cc -o $@ - -$(OBJECT_DIR)/flight_failsafe_unittest : \ - $(OBJECT_DIR)/flight/failsafe.o \ - $(OBJECT_DIR)/flight_failsafe_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/flight/failsafe.d \ - $(OBJECT_DIR)/flight_failsafe_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/telemetry/hott.o : \ - $(USER_DIR)/telemetry/hott.c \ - $(USER_DIR)/telemetry/hott.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/telemetry/hott.c -o $@ - -$(OBJECT_DIR)/telemetry_hott_unittest.o : \ - $(TEST_DIR)/telemetry_hott_unittest.cc \ - $(USER_DIR)/telemetry/hott.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/telemetry_hott_unittest.cc -o $@ - -$(OBJECT_DIR)/telemetry_hott_unittest : \ - $(OBJECT_DIR)/telemetry/hott.o \ - $(OBJECT_DIR)/telemetry_hott_unittest.o \ - $(OBJECT_DIR)/common/gps_conversion.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/telemetry/hott.d \ - $(OBJECT_DIR)/telemetry_hott_unittest.d \ - $(OBJECT_DIR)/common/gps_conversion.d - - -$(OBJECT_DIR)/fc/rc_controls.o : \ - $(USER_DIR)/fc/rc_controls.c \ - $(USER_DIR)/fc/rc_controls.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/fc/rc_controls.c -o $@ - -$(OBJECT_DIR)/rc_controls_unittest.o : \ - $(TEST_DIR)/rc_controls_unittest.cc \ - $(USER_DIR)/fc/rc_controls.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/rc_controls_unittest.cc -o $@ - -$(OBJECT_DIR)/rc_controls_unittest : \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/fc/rc_controls.o \ - $(OBJECT_DIR)/rc_controls_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common/maths.d \ - $(OBJECT_DIR)/fc/rc_controls.d \ - $(OBJECT_DIR)/rc_controls_unittest.d - - -$(OBJECT_DIR)/io/ledstrip.o : \ - $(USER_DIR)/io/ledstrip.c \ - $(USER_DIR)/io/ledstrip.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/io/ledstrip.c -o $@ - -$(OBJECT_DIR)/ledstrip_unittest.o : \ - $(TEST_DIR)/ledstrip_unittest.cc \ - $(USER_DIR)/io/ledstrip.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/ledstrip_unittest.cc -o $@ - -$(OBJECT_DIR)/ledstrip_unittest : \ - $(OBJECT_DIR)/io/ledstrip.o \ - $(OBJECT_DIR)/ledstrip_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/io/ledstrip.d \ - $(OBJECT_DIR)/ledstrip_unittest.d - - -$(OBJECT_DIR)/drivers/light_ws2811strip.o : \ - $(USER_DIR)/drivers/light_ws2811strip.c \ - $(USER_DIR)/drivers/light_ws2811strip.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/light_ws2811strip.c -o $@ - -$(OBJECT_DIR)/ws2811_unittest.o : \ - $(TEST_DIR)/ws2811_unittest.cc \ - $(USER_DIR)/drivers/light_ws2811strip.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/ws2811_unittest.cc -o $@ - -$(OBJECT_DIR)/ws2811_unittest : \ - $(OBJECT_DIR)/drivers/light_ws2811strip.o \ - $(OBJECT_DIR)/ws2811_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/drivers/light_ws2811strip.d \ - $(OBJECT_DIR)/ws2811_unittest.d - - -$(OBJECT_DIR)/io/serial.o : \ - $(USER_DIR)/io/serial.c \ - $(USER_DIR)/io/serial.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/io/serial.c -o $@ - -$(OBJECT_DIR)/io_serial_unittest.o : \ - $(TEST_DIR)/io_serial_unittest.cc \ - $(USER_DIR)/io/serial.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/io_serial_unittest.cc -o $@ - -$(OBJECT_DIR)/io_serial_unittest : \ - $(OBJECT_DIR)/io/serial.o \ - $(OBJECT_DIR)/io_serial_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/io/serial.d \ - $(OBJECT_DIR)/io_serial_unittest.d - - -$(OBJECT_DIR)/rx/rx.o : \ - $(USER_DIR)/rx/rx.c \ - $(USER_DIR)/rx/rx.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/rx/rx.c -o $@ - -$(OBJECT_DIR)/rx_rx_unittest.o : \ - $(TEST_DIR)/rx_rx_unittest.cc \ - $(USER_DIR)/rx/rx.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/rx_rx_unittest.cc -o $@ - -$(OBJECT_DIR)/rx_rx_unittest : \ - $(OBJECT_DIR)/rx/rx.o \ - $(OBJECT_DIR)/rx_rx_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/rx/rx.d \ - $(OBJECT_DIR)/rx_rx_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/rx/crsf.o : \ - $(USER_DIR)/rx/crsf.c \ - $(USER_DIR)/rx/crsf.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/rx/crsf.c -o $@ - -$(OBJECT_DIR)/rx_crsf_unittest.o : \ - $(TEST_DIR)/rx_crsf_unittest.cc \ - $(USER_DIR)/rx/crsf.h \ - $(USER_DIR)/rx/crsf.c \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/rx_crsf_unittest.cc -o $@ - -$(OBJECT_DIR)/rx_crsf_unittest : \ - $(OBJECT_DIR)/rx/crsf.o \ - $(OBJECT_DIR)/rx_crsf_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/rx/crsf.d \ - $(OBJECT_DIR)/rx_crsf_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/telemetry/crsf.o : \ - $(USER_DIR)/telemetry/crsf.c \ - $(USER_DIR)/telemetry/crsf.h \ - $(USER_DIR)/rx/crsf.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/telemetry/crsf.c -o $@ - -$(OBJECT_DIR)/telemetry_crsf_unittest.o : \ - $(TEST_DIR)/telemetry_crsf_unittest.cc \ - $(USER_DIR)/telemetry/crsf.h \ - $(USER_DIR)/telemetry/crsf.c \ - $(USER_DIR)/rx/crsf.c \ - $(USER_DIR)/rx/crsf.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/telemetry_crsf_unittest.cc -o $@ - -$(OBJECT_DIR)/telemetry_crsf_unittest : \ - $(OBJECT_DIR)/rx/crsf.o \ - $(OBJECT_DIR)/telemetry/crsf.o \ - $(OBJECT_DIR)/telemetry_crsf_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/common/streambuf.o \ - $(OBJECT_DIR)/common/gps_conversion.o \ - $(OBJECT_DIR)/fc/runtime_config.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/rx/crsf.d \ - $(OBJECT_DIR)/telemetry/crsf.d \ - $(OBJECT_DIR)/telemetry_crsf_unittest.d \ - $(OBJECT_DIR)/common/maths.d \ - $(OBJECT_DIR)/common/streambuf.d \ - $(OBJECT_DIR)/common/gps_conversion.d \ - $(OBJECT_DIR)/fc/runtime_config.d - - -$(OBJECT_DIR)/rx_ranges_unittest.o : \ - $(TEST_DIR)/rx_ranges_unittest.cc \ - $(USER_DIR)/rx/rx.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/rx_ranges_unittest.cc -o $@ - -$(OBJECT_DIR)/rx_ranges_unittest : \ - $(OBJECT_DIR)/rx/rx.o \ - $(OBJECT_DIR)/rx_ranges_unittest.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/rx/rx.d \ - $(OBJECT_DIR)/rx_ranges_unittest.d \ - $(OBJECT_DIR)/common/maths.d - - -$(OBJECT_DIR)/sensors/battery.o : $(USER_DIR)/sensors/battery.c $(USER_DIR)/sensors/battery.h $(GTEST_HEADERS) - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/sensors/battery.c -o $@ - -$(OBJECT_DIR)/battery_unittest.o : \ - $(TEST_DIR)/battery_unittest.cc \ - $(USER_DIR)/sensors/battery.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $< -o $@ - -$(OBJECT_DIR)/battery_unittest : \ - $(OBJECT_DIR)/sensors/battery.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/battery_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - $(CXX) $(CXX_FLAGS) $^ -o $@ - --include $(OBJECT_DIR)/sensors/battery.d \ - $(OBJECT_DIR)/common/maths.d \ - $(OBJECT_DIR)/battery_unittest.d - - -$(OBJECT_DIR)/drivers/barometer_ms5611.o : \ - $(USER_DIR)/drivers/barometer_ms5611.c \ - $(USER_DIR)/drivers/barometer_ms5611.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/barometer_ms5611.c -o $@ - -$(OBJECT_DIR)/baro_ms5611_unittest.o : \ - $(TEST_DIR)/baro_ms5611_unittest.cc \ - $(USER_DIR)/drivers/barometer_ms5611.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/baro_ms5611_unittest.cc -o $@ - -$(OBJECT_DIR)/baro_ms5611_unittest : \ - $(OBJECT_DIR)/drivers/barometer_ms5611.o \ - $(OBJECT_DIR)/baro_ms5611_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/drivers/barometer_ms5611.d \ - $(OBJECT_DIR)/baro_ms5611_unittest.d - - -$(OBJECT_DIR)/drivers/barometer_bmp085.o : \ - $(USER_DIR)/drivers/barometer_bmp085.c \ - $(USER_DIR)/drivers/barometer_bmp085.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/barometer_bmp085.c -o $@ - -$(OBJECT_DIR)/baro_bmp085_unittest.o : \ - $(TEST_DIR)/baro_bmp085_unittest.cc \ - $(USER_DIR)/drivers/barometer_bmp085.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/baro_bmp085_unittest.cc -o $@ - -$(OBJECT_DIR)/baro_bmp085_unittest : \ - $(OBJECT_DIR)/drivers/barometer_bmp085.o \ - $(OBJECT_DIR)/drivers/io.o \ - $(OBJECT_DIR)/baro_bmp085_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/drivers/barometer_bmp085.d \ - $(OBJECT_DIR)/drivers/io.d \ - $(OBJECT_DIR)/baro_bmp085_unittest.d - - -$(OBJECT_DIR)/drivers/barometer_bmp280.o : \ - $(USER_DIR)/drivers/barometer_bmp280.c \ - $(USER_DIR)/drivers/barometer_bmp280.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/barometer_bmp280.c -o $@ - -$(OBJECT_DIR)/baro_bmp280_unittest.o : \ - $(TEST_DIR)/baro_bmp280_unittest.cc \ - $(USER_DIR)/drivers/barometer_bmp280.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/baro_bmp280_unittest.cc -o $@ - -$(OBJECT_DIR)/baro_bmp280_unittest : \ - $(OBJECT_DIR)/drivers/barometer_bmp280.o \ - $(OBJECT_DIR)/baro_bmp280_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/drivers/barometer_bmp280.d \ - $(OBJECT_DIR)/baro_bmp280_unittest.d - - -$(OBJECT_DIR)/sensors/boardalignment.o : \ - $(USER_DIR)/sensors/boardalignment.c \ - $(USER_DIR)/sensors/boardalignment.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/sensors/boardalignment.c -o $@ - -$(OBJECT_DIR)/alignsensor_unittest.o : \ - $(TEST_DIR)/alignsensor_unittest.cc \ - $(USER_DIR)/sensors/boardalignment.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/alignsensor_unittest.cc -o $@ - -$(OBJECT_DIR)/alignsensor_unittest : \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/sensors/boardalignment.o \ - $(OBJECT_DIR)/alignsensor_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/common/maths.d \ - $(OBJECT_DIR)/sensors/boardalignment.d \ - $(OBJECT_DIR)/alignsensor_unittest.d - - -$(OBJECT_DIR)/build/debug.o : \ - $(USER_DIR)/build/debug.c \ - $(USER_DIR)/build/debug.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/build/debug.c -o $@ - -$(OBJECT_DIR)/drivers/gyro_sync.o : \ - $(USER_DIR)/drivers/gyro_sync.c \ - $(USER_DIR)/drivers/gyro_sync.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/gyro_sync.c -o $@ - -$(OBJECT_DIR)/drivers/accgyro_fake.o : \ - $(USER_DIR)/drivers/accgyro_fake.c \ - $(USER_DIR)/drivers/accgyro_fake.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/accgyro_fake.c -o $@ - -$(OBJECT_DIR)/sensors/gyro.o : \ - $(USER_DIR)/sensors/gyro.c \ - $(USER_DIR)/sensors/gyro.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/sensors/gyro.c -o $@ - -$(OBJECT_DIR)/sensor_gyro_unittest.o : \ - $(TEST_DIR)/sensor_gyro_unittest.cc \ - $(USER_DIR)/sensors/gyro.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/sensor_gyro_unittest.cc -o $@ - -$(OBJECT_DIR)/sensor_gyro_unittest : \ - $(OBJECT_DIR)/build/debug.o \ - $(OBJECT_DIR)/common/filter.o \ - $(OBJECT_DIR)/common/maths.o \ - $(OBJECT_DIR)/drivers/accgyro_fake.o \ - $(OBJECT_DIR)/drivers/gyro_sync.o \ - $(OBJECT_DIR)/sensors/boardalignment.o \ - $(OBJECT_DIR)/sensors/gyro.o \ - $(OBJECT_DIR)/sensor_gyro_unittest.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/build/debug.d \ - $(OBJECT_DIR)/common/filter.d \ - $(OBJECT_DIR)/common/maths.d \ - $(OBJECT_DIR)/drivers/accgyro_fake.d \ - $(OBJECT_DIR)/drivers/gyro_sync.d \ - $(OBJECT_DIR)/sensors/boardalignment.d \ - $(OBJECT_DIR)/sensors/gyro.d \ - $(OBJECT_DIR)/sensor_gyro_unittest.d - - -$(OBJECT_DIR)/build/version.o : \ - $(USER_DIR)/build/version.c \ - $(USER_DIR)/build/version.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -D'__TARGET__="TEST"' -D'__REVISION__="revision"' -c $(USER_DIR)/build/version.c -o $@ - -$(OBJECT_DIR)/drivers/buf_writer.o : \ - $(USER_DIR)/drivers/buf_writer.c \ - $(USER_DIR)/drivers/buf_writer.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -D'__TARGET__="TEST"' -D'__REVISION__="revision"' -c $(USER_DIR)/drivers/buf_writer.c -o $@ - -$(OBJECT_DIR)/common/streambuf.o : \ - $(USER_DIR)/common/streambuf.c \ - $(USER_DIR)/common/streambuf.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -D'__TARGET__="TEST"' -D'__REVISION__="revision"' -c $(USER_DIR)/common/streambuf.c -o $@ - -$(OBJECT_DIR)/drivers/display.o : \ - $(USER_DIR)/drivers/display.c \ - $(USER_DIR)/drivers/display.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/display.c -o $@ - -$(OBJECT_DIR)/cms/cms.o : \ - $(USER_DIR)/cms/cms.c \ - $(USER_DIR)/cms/cms.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/cms/cms.c -o $@ - -$(OBJECT_DIR)/cms_unittest.o : \ - $(TEST_DIR)/cms_unittest.cc \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/cms_unittest.cc -o $@ - -$(OBJECT_DIR)/cms_unittest : \ - $(OBJECT_DIR)/cms_unittest.o \ - $(OBJECT_DIR)/common/typeconversion.o \ - $(OBJECT_DIR)/drivers/display.o \ - $(OBJECT_DIR)/cms/cms.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/cms_unittest.d \ - $(OBJECT_DIR)/common/typeconversion.d \ - $(OBJECT_DIR)/drivers/display.d \ - $(OBJECT_DIR)/cms/cms.d - - -$(OBJECT_DIR)/drivers/io.o : \ - $(USER_DIR)/drivers/io.c \ - $(USER_DIR)/drivers/io.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/drivers/io.c -o $@ - -$(OBJECT_DIR)/config/parameter_group.o : \ - $(USER_DIR)/config/parameter_group.c \ - $(USER_DIR)/config/parameter_group.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/config/parameter_group.c -o $@ - -$(OBJECT_DIR)/parameter_groups_unittest.o : \ - $(TEST_DIR)/parameter_groups_unittest.cc \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/parameter_groups_unittest.cc -o $@ - -$(OBJECT_DIR)/parameter_groups_unittest : \ - $(OBJECT_DIR)/parameter_groups_unittest.o \ - $(OBJECT_DIR)/config/parameter_group.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $(PG_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/parameter_groups_unittest.d \ - $(OBJECT_DIR)/config/parameter_group.d - - -$(OBJECT_DIR)/rx/ibus.o : \ - $(USER_DIR)/rx/ibus.c \ - $(USER_DIR)/rx/ibus.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/rx/ibus.c -o $@ - -$(OBJECT_DIR)/rx_ibus_unittest.o : \ - $(TEST_DIR)/rx_ibus_unittest.cc \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/rx_ibus_unittest.cc -o $@ - -$(OBJECT_DIR)/rx_ibus_unittest : \ - $(OBJECT_DIR)/rx_ibus_unittest.o \ - $(OBJECT_DIR)/rx/ibus.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $(PG_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/rx_ibus_unittest.d \ - $(OBJECT_DIR)/rx/ibus.d - - -$(OBJECT_DIR)/telemetry/ibus.o : \ - $(USER_DIR)/telemetry/ibus.c \ - $(USER_DIR)/telemetry/ibus.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/telemetry/ibus.c -o $@ - -$(OBJECT_DIR)/telemetry/ibus_shared.o : \ - $(USER_DIR)/telemetry/ibus_shared.c \ - $(USER_DIR)/telemetry/ibus_shared.h \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/telemetry/ibus_shared.c -o $@ - -$(OBJECT_DIR)/telemetry_ibus_unittest.o : \ - $(TEST_DIR)/telemetry_ibus_unittest.cc \ - $(GTEST_HEADERS) - - @echo "compiling $@" "$(STDOUT)" - @mkdir -p $(dir $@) - $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) -c $(TEST_DIR)/telemetry_ibus_unittest.cc -o $@ - -$(OBJECT_DIR)/telemetry_ibus_unittest : \ - $(OBJECT_DIR)/telemetry_ibus_unittest.o \ - $(OBJECT_DIR)/telemetry/ibus_shared.o \ - $(OBJECT_DIR)/telemetry/ibus.o \ - $(OBJECT_DIR)/gtest_main.a - - @echo "linking $@" "$(STDOUT)" - $(V1) $(CXX) $(CXX_FLAGS) $(PG_FLAGS) $^ -o $(OBJECT_DIR)/$@ - --include $(OBJECT_DIR)/telemetry_ibus_unittest.d \ - $(OBJECT_DIR)/telemetry/ibus_shared.d \ - $(OBJECT_DIR)/telemetry/ibus.d - - - -## test : Build and run the Unit Tests -test: $(TESTS:%=test-%) - -## junittest : Build and run the Unit Tests, producing Junit XML result files." -junittest: EXEC_OPTS = "--gtest_output=xml:$<_results.xml" -junittest: $(TESTS:%=test-%) - -test-%: $(OBJECT_DIR)/% - $(V0) $< $(EXEC_OPTS) "$(STDOUT)" && echo "running $@: PASS" - -## help : print this help message and exit -## what : print this help message and exit -## usage : print this help message and exit -help what usage: Makefile - @echo "" - @echo "Makefile for Unit Tests" - @echo "" - @echo "Usage:" - @echo " make [goal] " - @echo "" - @echo "Valid goals are:" - @echo "" - @sed -n 's/^## //p' $< - @echo "" - @echo "Any of the Unit Test programs can be used as goals:" - @$(foreach prg, $(TEST_BINARIES), echo " $(prg)";) - --include $(DEPS)