os/Makefile.unix: Automate compression tool creation process
compression tool (mkcompressimg) is created during build
before binaries that are to be compressed are created
@@ -533,7 +533,7 @@ ota_img:
# pass1dep: Create pass1 build dependencies
# pass2dep: Create pass2 build dependencies
-pass1dep: context tools/mkdeps$(HOSTEXEEXT)
+pass1dep: context tools/mkdeps$(HOSTEXEEXT) tools/compression/mkcompresstool.sh
$(Q) for dir in $(USERDEPDIRS) ; do \
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" EXTDIR="$(EXTDIR)" depend ; \
done
@@ -686,3 +686,14 @@ romfs:
ifeq ($(CONFIG_FS_ROMFS),y)
$(Q) ../tools/fs/mkromfsimg.sh
endif
+
+# tools/compression/mkcompresstool.sh
+#
+# This target will make a compression tool by calling mkcompresstool.sh.
+# This compression tool (mkcompressimg) will be used to compress binaries.
+# Hence, this tool needs to be created before we build those binaries.
+
+tools/compression/mkcompresstool.sh: include/tinyara/config.h
+ifeq ($(CONFIG_COMPRESSED_BINARY),y)
+ $(Q) tools/compression/mkcompresstool.sh
+endif
