Click to See Complete Forum and Search --> : nmake problem


denker
March 28th, 2006, 05:23 AM
Hello

I'm writing my first makefile by hand and my problem is that I got some source files .cpp, which is placed in a subfolder for example:

subdir\a.cpp

It is no problem to compile to .obj files (since I have typed all filenames in by hand), but the problem arise, when I need to link, because I use the macro

OBJ = $(SOURCES:.cpp=.obj)

to convert the filenames *.cpp to *.obj, but the compiler places the output (the .obj files) in the root dir, and the .obj files aren't placed in the subdir, which the filenames (the OBJ macro) points to.

All I need is to trim of the path of the .obj files.
Any solution how I should do this??

Otherwise I could compile the relevant .obj files into its source destination, but I would rather like it the other way around.

Best regards and thanks,
Denker