#54 Manually overriding makefile's dependency

open
Tony Reina
2
2012-07-13
2007-01-08
Tony Reina
No

Now that executables are by default being placed in a sub-directory of the projct directory (usually in Output\MingW), it would be nice if we could copy any associated files (e.g. bitmaps) to the output directory too.

This can be done in the makefile using:

filename.png : $(dir $(BIN))filename.png
copy "$?" "$(dir $(BIN))$?"

If the bitmap file is added to the project, we can go to Project->Project Options->Files and check "include in compilation" for the bitmap file. However, the makefile looks like:

filename.png : filename.o
copy "$?" "$(dir $(BIN))$?"

which will work, but is incorrect (since filename.o will never exist).

I'd like to modify the Files dialog to allow the user to manually override the dependency (just like we allow them to manually override the build command).

So we add an edit box to the form which by default is filled with filename.o. If we override the dependency, then the makefile will replace it with whatever we have typed in the box (in our case, we want $(dir $(BIN))filename.png).

Discussion


Anonymous


Cancel   Add attachments