Saturday 15 September 2012

makefile - gmake can't find generated sources -


I have a program in which some sources are generated. The relevant part of the makefile is something like this: < Previous> OUTPUT_FILE = libEngine.so CONF_FILES = foo.tgp bar.tgp generated = engine.cfg SRCS = main.cpp foo.cpp bar.cpp OBJ_FILES = $ (SRCS:%. CPP = $ (OBJDIR) /% O) All: $ (OUTPUTIEL) $ (OUTPUTIEL): $ (Generated) $ (OBJIIIILS) & lt; Link command & gt; $ (Generated): $ (conif_IIIELS) generated-P engine $ (conif_IIIls) $ (objdir) /% o:% CPP & lt; Compile command & gt;

creates 'generate' command engine.cfg (a text file), foo.cpp and bar.cpp

when I run it, something Platform, Sometimes , prevents gmake after non-generation and compilation, saying that it does not have any rules to generate objects from generated sources

I think I know what's the problem - GMK has evaluated the dependency before creating the file. However, I do not think how to write it correctly. And I do not even understand why this sometimes fails sometimes.

Edit example code is now completely over (there are many more files and options in the original, of course)

I have decided this way:

  All: $ (generated) $ (obj_IIIIL) $ $ (make) $ (OUTPUDIELE) $ (OUTPUTIEL): $ (Generated) $ (oBJ_III ILS) & lt; Link command & gt;   

And so far so good.

No comments:

Post a Comment