Re-compile a file eachRe-compile file even when not changed

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Re-compile a file eachRe-compile file even when not changed

1,543件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dtesystems on Fri Mar 18 05:02:29 MST 2016
Hi,

I'm using 2 source files (date_time.c/date_time.h) in which a genereate the last re-compilation date and time of my project. This recompile date is then available for the microcontroller for further use.

Problem now is that this file doesn't re-compile as long as it's content isn't changed are a clean build is executed.

Is there a way to mark these files so they will re-compile on each build or some compiler directive I can use?

Thanks!

Tom
0 件の賞賛
返信
5 返答(返信)

1,536件の閲覧回数
lpcware
NXP Employee
NXP Employee
bump
0 件の賞賛
返信

1,536件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Fri Mar 18 08:26:38 MST 2016
LPCXpressop contains a Windows version of touch. So, just use
touch filename.c
0 件の賞賛
返信

1,536件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by miccio on Fri Mar 18 08:22:06 MST 2016
according to this, the way to go seems to be
copy /b filename +,,



Hope it helps
0 件の賞賛
返信

1,536件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dtesystems on Fri Mar 18 07:56:29 MST 2016
Hi Miccio,

That's a step in the good direction. I'm going to look for the Windows equivalent of touch.

Thanks!

Tom
0 件の賞賛
返信

1,536件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by miccio on Fri Mar 18 05:14:26 MST 2016
Hey Tom,

I had a similar requirement some time ago, which I solved by adding the following to Project Properties -> C/C++ Build -> Settings -> Build Steps -> Pre-build steps command:
touch ../date_time.c; touch ../date_time.h


Citing Wikipedia, touch is a standard Unix command-line interface program which is used to update the access date and / or modification date of a file or directory.
In its default usage, it is the equivalent of creating or opening a file and saving it without any change to the file contents.

However, mind that this only works on Linux.
Some POSIX-like environment like Cygwin or MinGW may offer such command, or there may be a similar built-in one.

Good luck
0 件の賞賛
返信