include ../../../../../config/make/rules.mk TEST_MAINFILE = $(TEST_EXE_DIR)cunit_ringbuffer TEST_INCLUDES = \ -I . \ -I /usr/include \ -I $(ROOT_DIR)/source/firmware/kernel TEST_SOURCES = \ $(ROOT_DIR)/source/firmware/kernel/ringbuffer.c \ $(ROOT_DIR)/source/test/firmware/kernel/ringbuffer/cunit_ringbuffer.c TEST_OBJECTS = $(TEST_SOURCES:$(SRC_DIR)/%.c=$(TEST_OBJ_DIR)/%.o) TEST_DEPS = $(TEST_SOURCES:$(SRC_DIR)/%.c=$(TEST_OBJ_DIR)/%.d) TEST_CFLAGS = \ $(CFLAGS) \ $(TEST_INCLUDES) TEST_LDFLAGS = \ $(LDFLAGS) \ -lcunit all: $(TEST_MAINFILE) clean: -rm -f $(TEST_OBJECTS) \ $(TEST_DEPS) \ $(TEST_MAINFILE) $(TEST_MAINFILE): $(TEST_OBJECTS) @$(MKDIR) $(TEST_EXE_DIR) $(NATIVE_CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) $(TEST_OBJECTS) -o $(TEST_MAINFILE) $(TEST_OBJ_DIR)/%.o: $(SRC_DIR)/%.c @$(MKDIR) $(dir $@) $(call maketestdep,$<,$@,$(subst .o,.d,$@)) $(NATIVE_CC) $(TEST_CFLAGS) -c $< -o $@ ifneq "$(MAKECMDGOALS)" "clean" -include $(TEST_DEPS) endif