How to make just touched files
« on: March 05, 2017, 10:43:14 am »
Hi
I need to compile or make just the touched files of either the GCS or the FC. How do I go about that please?

filnet

  • *****
  • 113
Re: How to make just touched files
« Reply #1 on: March 05, 2017, 11:51:40 am »
You can't really do that, safely at least...
Changing headers can trigger the need to recompile a bunch of files all over the place.

Note that GCS and firmware compilation is incremental. Only changed files are recompiled.
A full "compile" of GCS with no files changed takes about 30s on my PC. A bit slow but acceptable.

There are a few trick though:
- you can speed up compilation by enabling parallelism (with -j3 for example)
- if you work only on GCS or firmware you can do "make gcs" or "make all_flight" respectively
- if you really now what you are doing, you can specify to compile only a specific GCS directory with the MAKE_DIR option (type "make" and look at the [GCS] section for an example). But this will not work well if you change headers that impact other directories or if you change *.pro file. But still useful when you want to iron out all the compilation errors after a coding stint.

For GCS I use this alias:
alias makegcs='time mingw32-make -j3 --quiet gcs GCS_BUILD_CONF=release'

Re: How to make just touched files
« Reply #2 on: March 05, 2017, 01:31:43 pm »
Thanks that helped a lot. I use this alias to compile with and it only builds the touched files.

alias makesparky2='mingw32-make -j3 --quiet fw_sparky2'.


I gather that there must be a way to run all of this from within Eclipse. I did find some project files under the 'Project' directory. There is also mention of OpenOCD so there must be a way to debug from within Eclipse. I will search a bit more.

P.S. I am more interested in the firmware debug as I intend to create a link between the FC and a Pi based camera system that will give me the ability to do target tracking from the payload camera.