Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NMAKE batch-mode and directories

26 views
Skip to first unread message

Mateusz Loskot

unread,
Mar 27, 2009, 10:19:05 AM3/27/09
to
Hi,

I'd like to utilise Visual C++ 9.0 feature of multiple process build
and use flat /MP + stream all source files to cl.exe in a batch.
Generally, it works.
However, I have problem with handling source files
scattered across directories.
I have a single makefile with single list of .obj files
specified using paths relative to root directory of my
source tree:

OBJ = na\a.obj nb\b.obj nc\c.obj

Original compile target is:

CC = cl.exe

.cpp.obj:
$(CC) $(CFLAGS) /c $*.cpp /Fo$@

This way, all .obj files are generated in subdirectories
corresponsing to .cpp source file.
So, I can link them all this way:

LINK = link.exe
my.lib: $(OBJ)
$(LINK) /lib /out:$(LIBNAME) $(OBJ)

Now, I'd like switch to batch-mode

{$S}.cpp{$O}.obj::
$(CC) $(CFLAGS) -Fd$O\ -c $<

Compilation works, but .obj files go to root directory of
my source tree and linker can not find them, becasue
OBJ list uses dirctories.

I'd like to feed cl.exe in order to benefit from use of /MP compiler
flag - multi process build.

Unfortunately, I'm less fluent with NMAKE than I am with GNU Make,
so I have problems with handling this batch-mode processing.
I'd be thankful if anyone could suggest how to solve it.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

0 new messages