|
From: | CARTER-HITCHIN, David, GBM |
Subject: | RE: Help with odd dependency |
Date: | Thu, 8 Mar 2007 10:38:53 -0000 |
From: address@hidden [mailto:address@hidden On Behalf Of Smith, Matthew X
Sent: 07 March 2007 16:59
To: address@hidden
Subject: RE: Help with odd dependencyAnyone?:(Matt
From: address@hidden [mailto:address@hidden On Behalf Of Smith, Matthew X
Sent: Friday, March 02, 2007 9:50 AM
To: address@hidden
Subject: Help with odd dependencyFirst of all, I'm using Mingw32-make version 3.80.
The CodeWarrior compiler we are using has this really odd quirk when it spits out a dependency file for a precompiled header. Their precompiled headers have a .mch extension, and yet the dependency that is generated by the compiler has a target of a .o file. For example, in the file Math.d I have:
Math.o: Math.pch \
foo.h \
bar.h \
.
.
.But the precompiled file generated is actually named Math_Debug.mch, Math_Release.mch, etc.
So, what I've done is a bit of hackery. I created a rule which makes the .mch file dependent on the .o file, then I have a rule which says how to build the .o file, and then read in the above .d file to fill in the dependencies. The final hack is to then copy the generated .mch file to .o to satisfy the rule.
Math_Debug.mch: Math.o
Math.o: %.o:
@compile the .mch file
@copy Math_Debug.mch Math.o-include Math.d
Now, the theory is that when I read in the above .d file (this is done at the end of the makefile), the dependencies for the Math.o file will fill out the rule. By and large this seems to work, but I'm wondering if there is a better way of accomplishing this? It seems so roundabout and convoluted that I really don't trust it much. I'm actually to the point where I'm thinking that I run a perl script to parse the generated dependency file for the precompiled header and change the Math.o to Math_Debug.mch.
Any ideas?
Thanks.
Matt Smith
*********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: www.rbs.com www.rbsgc.com www.rbsmarkets.com ***********************************************************************************
[Prev in Thread] | Current Thread | [Next in Thread] |