开发者

Makefile: Perform specific command when one file was updated after another one

I have a makefile which calls some bash scripts and shell commands.

One of those scripts generates a code (say, generated.h) file according to another code file (say source.h) - and I want it to be called only if source.h was updated after generated.h was updated.

(In pseudo code:

if update_time(generated.h) < update_time(source.h)  
  call GenerateCodeFile.sh  
end if

)

How can I do it from with开发者_StackOverflow中文版in a makefile?

Thanks.


generated.h: source.h
    sh GenerateCodeFile.sh

Be aware that that's a literal <TAB> character at the start of the sh line.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜