Author Topic: How can I create (when building) hex files in two folders at the same time?  (Read 1489 times)

Offline selevo

  • Single posting newcomer
  • *
  • Posts: 3
My programming program takes a hex file from the folder C: \ proghex
And my projects are in different places and hex files are created inside their folders.
Can I create hex files in two places at once?
In the folder C: \ proghex and as usual in the project folder.

Offline hongwenjun

  • Multiple posting newcomer
  • *
  • Posts: 15
#include <stdio.h>

int main(int argc, char* argv[])
    return 0;

Use the source code above, then set the command line parameters as shown below

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3007
Do you really need the hex file in both folder? Or is it enough in one?

If really both are needed, then you have to copy the files. You can do this with two ways:
1) Squirrel scripting
2) Operating system native copy function

Both have to go in the post build step

Project->Build options->Pre/post build steps->Post build
Then you can
[[IO.CopyFile(_("$(TARGET_OUTPUT_FILE)"), _("C:\hexprog"), true );]]

If you do not need have the hex file in both:
Project->Properties->Build targets->select both targets from the left side->Output file

If you want to use codeblocks to start your programmer and feed the output file directly to the programmer you can use the tools+ plugin to start it directly from codeblocks and feed the outptu file directly

Offline selevo

  • Single posting newcomer
  • *
  • Posts: 3
I will test your idea
Yes, I need in two places that the files would be automatically created and updated in two folders after build projects without  other action hands  .
I have a dumb program for updating firmware, it contains one button and there is nothing more in it, it can only take a hex file from one place and program the controller.
« Last Edit: June 01, 2020, 09:01:33 am by selevo »