common: build ymodem only on need
Build ymodem only on need to shrink spl image size.
Signed-off-by: Jun Nie <jun.nie@linaro.org>
diff --git a/common/Makefile b/common/Makefile
index 7473b85..a238836 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -121,6 +121,7 @@
obj-$(CONFIG_$(SPL_)LOG) += log.o
obj-$(CONFIG_$(SPL_)LOG_CONSOLE) += log_console.o
obj-y += s_record.o
-obj-y += xyzModem.o
+obj-$(CONFIG_CMD_LOADB) += xyzModem.o
+obj-$(CONFIG_$(SPL_TPL_)YMODEM_SUPPORT) += xyzModem.o
obj-$(CONFIG_AVB_VERIFY) += avb_verify.o