How do I use dependencies in a makefile without calling a target?

Posted by rassie on Stack Overflow See other posts from Stack Overflow or by rassie
Published on 2010-03-17T13:58:51Z Indexed on 2010/03/17 14:01 UTC
Read the original article Hit count: 229

Filed under:
|

I'm using makefiles to convert an internal file format to an XML file which is sent to other colleagues. They would make changes to the XML file and send it back to us (Don't ask, this needs to be this way ;)). I'd like to use my makefile to update the internal files when this XML changes.

So I have these rules:

%.internal: $(DATAFILES)
       # Read changes from XML if any
       # Create internal representation here

%.xml: %.internal
       # Convert to XML here

Now the XML could change because of the workflow described above. But since no data files have changed, make would tell me that file.internal is up-to-date. I would like to avoid making %.internal target phony and a circular dependency on %.xml obviously doesn't work.

Any other way I could force make to check for changes in the XML file and re-build %.internal?

© Stack Overflow or respective owner

Related posts about makefile

Related posts about make