. ./.config
-
- if [ "$CONFIG_CARL9170FW_MAKE_RELEASE" = "y" ]; then
- echo -n "Installing firmware..."
- tmpfwfile=`mktemp`
- cat carlfw/carl9170.fw carlfw/carl9170.dsc > $tmpfwfile
- if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ] &&
- [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
- echo -n "Apply miniboot..."
- tools/src/miniboot a $tmpfwfile minifw/miniboot.fw
- fi
-
- sudo install $tmpfwfile /lib/firmware/carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
- rm $tmpfwfile
- echo "done."
+ echo -n "Installing firmware..."
+ if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ] &&
+ [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
+ echo -n "Apply miniboot..."
+ tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
fi
+
+ sudo install carlfw/carl9170.fw /lib/firmware/carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
+ echo "done."
;;
*)
" ${CARLFW_CFLAGS_DEF} ${CARLFW_CFLAGS_EXTRA} ${CARLFW_CFLAGS_AGGRESSIVE} ${CARLFW_CFLAGS_WARNING}")
set_target_properties(carl9170.elf PROPERTIES LINK_FLAGS "-Tcarl9170.lds")
-add_custom_target(
- carl9170.fw ALL
- ${OBJCOPY} --strip-unneeded -O binary -R .sram -R .eeprom -R .fwdsc carl9170.elf carl9170.fw
- DEPENDS carl9170.elf)
-add_custom_target(
- carl9170.dsc ALL
- ${OBJCOPY} --strip-unneeded -O binary -j .fwdsc carl9170.elf carl9170.dsc
- DEPENDS carl9170.elf)
+add_custom_target(firmware ALL)
+add_custom_command(
+ SOURCE carl9170.elf
+ COMMAND ${OBJCOPY}
+ ARGS --strip-unneeded -O binary -R .sram -R .eeprom -R .fwdsc carl9170.elf carl9170.bin
+ TARGET firmware
+ OUTPUTS carl9170.bin)
+
+add_custom_command(
+ SOURCE carl9170.elf
+ COMMAND ${OBJCOPY}
+ ARGS --strip-unneeded -O binary -j .fwdsc carl9170.elf carl9170.dsc
+ TARGET firmware
+ OUTPUTS carl9170.dsc)
+
+add_custom_command(
+ SOURCE firmware
+ TARGET firmware
+ COMMAND cat
+ ARGS "carl9170.bin" "carl9170.dsc" > "carl9170.fw"
+ DEPENDS carl9170.elf carl9170.bin carl9170.dsc
+ OUTPUTS carl9170.fw)
+
+SET_DIRECTORY_PROPERTIES(
+ PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "carl9170.fw")
init_list_head(&fw->desc_list);
- snprintf(filename, sizeof(filename), "%s.dsc", basename);
- err = __carlfw_load(&fw->hdr, filename, "r");
-
- snprintf(filename, sizeof(filename), "%s.fw", basename);
- err = __carlfw_load(&fw->fw, filename, "r");
- if (!err)
- goto found;
-
err = __carlfw_load(&fw->fw, basename, "r");
if (err)
goto err_out;
-found:
if (fw->hdr.name)
hdr_file = &fw->hdr;
else