This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using make to copy a set of files when directory is referenced.

While I using Eclipse, rarely I needed to use the MAKE or when I needed the knowledge he had was enough.

Now I need to do some actions, such as copying files from one directory to another whenever the presence of one or another variable and when the directory is referenced by another rule, clearing the destination before removing the files if another architecture.

Having the presence of a particular variable, such as `__AVR_ATmega328P`, `__AVR_ATmega2560` or `__ARM_xxxx` he must copy some files from `/users/extra/lib/atmega328P` or `/usr/extra/lib/atmega2560`, `/usr/extra/lib/arm/cmsis` respectively, to the `/usrs/extra/workspace/projetoZeta/lib` whenever it is referenced.

It is important to note that the `Rule` that will make this task, is a secondary customization file, as in the master file I have no way to change.

Besides that need it the secondary `Rule`, which makes copies, is automatically called by other `Rule`, without the need to interfere in each primary, where the `/users/extra/workspace/projetoZeta/lib` directory  is referenced, this should be checked and if necessary the copied files.

In the end, do not know how someone could provide me some example? I got to read the manual and even the https://www.gnu.org/software/make/manual/html_node/Echoing.html Echo I have getting use to help me debug what I'm doing at MAKE.

Parents
  • > I've never had problems with symlinks and GCC

    unfortunately you cannot create portable project using symlinks, since they are not available on Windows, so I generally do not recommend this solution.

    Eclipse references to folders and files can be defined in a portable way, using macros with the project/workspace base address; I'm pretty convinced they can be used for the purpose you mentioned, but they just require some attention.

    Carlos, can you point me the tutorial page where Eclipse links are not recommended, to check the content for correctness?

    Liviu

Reply
  • > I've never had problems with symlinks and GCC

    unfortunately you cannot create portable project using symlinks, since they are not available on Windows, so I generally do not recommend this solution.

    Eclipse references to folders and files can be defined in a portable way, using macros with the project/workspace base address; I'm pretty convinced they can be used for the purpose you mentioned, but they just require some attention.

    Carlos, can you point me the tutorial page where Eclipse links are not recommended, to check the content for correctness?

    Liviu

Children