help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd make question


From: Marcus A Martin
Subject: Odd make question
Date: Tue, 9 Jan 2001 19:56:26 -0500

I am working on a gmake makefile set that needs to compile on several
platforms using the native compiler of each host platform. This includes
several differant unix boxes, each with its own set of problems. However, I
am also required to get this make system to work on an M$ machine using
cygwin. I have stumbled, tripped and staggered but percivered and finally
got it to work with M$ - mostly.

I do not know if you are familiar with the ins and out of the M$ compilers,
but as with any process that occurs on a M$ machine starting and stopping is
expensive. As such, the M$ compiler has batch rules that allow you to pass
multiple c/cpp files to the compiler and it compiles them all as a single
process. While this is natively handled in M$'s nmake, I have yet to find a
simple way to handle this in gmake.

What I need to do is be able to pass only the source files that have been
changed into the compile command. So far I have only found a way to add in
all or none. The gmake structure is basicly this this:

SOURCE = foo.c bar.c

$(OBJS): $(SOURCES)
        $(CC) $^

foobar.a : $(OBJS)
        $(SHARED_LIB_LINKER) $(OBJS) $(OUTFILE)

In theory, the $^ should only get source files that have been changed since
the last compile, but it always evaluates to null. If I replace it with
$(SOURCES) I can pass all the source files to the M$ compiler like I want,
but it will always recompile everything.

Does anyone know how to handle this case?

I can always just let it compile 1 file at a time using basic suffix rules
or pattern rules, but this is very time consumming on a M$ machine.

Marcus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]