How to force clean and rebuild when make file changes Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

How to force clean and rebuild when make file changes

Post by babazaroni »

I set defines in the make file, but forget I need to clean the project before building.

Is there a way to make xtimecomposer do this for me automatically when the make file changes?
View Solution
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1164
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

What version of tools are you using?

From tools version 14, the Makefile itself is part of the dependancy checking. So touching this file will force a complete recompile, since everything depends on the make file.

Xtimecomposer just calls xmake underneath, so it will be the same in the GUI as the command line.

I am not aware of a way of configuring Xtimecomposer to specifically depend on an additional file, so if you wish to use a pre-14 tools version, then you will need to clean before building after changing your make file.
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

Post by babazaroni »

Thanks for the info. I'm using 13 and 14 on various projects, and the mistakes have happened on 13 only. Seems like there should be a way to make the make file depend on itself and do a clean. I guess I'll have to dive into make mechanisms and figure it out.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

I've had a quick play with this and the best solution I could come up with is patching your TOOLS_FOLDER/build/xcommon/module_xcommon/build/Makefile.common1

and add the following line:
$(OBJ_FILES) : Makefile

on line 668 (after line):
OBJ_FILES := $(foreach x,$(SOURCE_FILES),$(call TO_OBJ,$(call TO_BUILD_DIR,$x)))

That seemed to do what you want, of having a rebuild of sources whenever the Makefile is touched.