help-make
[Top][All Lists]
Advanced

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

Re: "Batch-Mode" rules with Microsoft compile


From: John Skiff
Subject: Re: "Batch-Mode" rules with Microsoft compile
Date: Tue, 27 Mar 2001 09:22:53 -0500

Paul,

What you suggest does work.  I had an additional item which was making
it fail.  Boiled down I have something like the following:

CXX = Cl
CXXFLAGS = -GR -vmm -D_MT -Zi -Od -D_DEBUG -MTd -GZ -FD

ifndef CCSRC
CCSRC := $(wildcard *.cpp)
endif

ifndef CCOBJ
CCOBJ := $(CCSRC:%.cpp=%.obj)
endif

LINKOPTIONS =/nologo /machine:ix86 

ev_addpath.exe: $(CCOBJ)

$(CCOBJ): $(CCSRC)
        $(CXX) $(CXXFLAGS) -c $?
        link $(LINKOPTIONS) /out:ev_addpath.exe $(CCOBJ)

The purpose of $CCOBJ was to make it possible to force a rebuild by
removing a .obj file.  However if I remove one .obj file then ALL of the
source recompiles.  I guess that there is no way around that.  If you
can think of a way please let me know.

Thanks for helping me to clear this up,
John


"Paul D. Smith" wrote:
> 
> %% John Skiff <address@hidden> writes:
> 
>   js> I've tried everything I can think of get gmake to pass the names
>   js> of all changed files on one line to the compiler but nothing was
>   js> successful.  Can anyone tell me of a way to do this?
> 
> Well, this works fine on UNIX.  I'm not familiar with NT, but if this
> (or the appropriate NT translation thereof) doesn't work maybe you could
> explain what _does_ happen?
> 
>   SRCS  = foo.c bar.c baz.c boz.c
> 
>   all: foo.exe
> 
>   foo.exe: all.os
>           $(CC) $(LDFLAGS) $(SRCS:.c=.o)
> 
>   all.os: $(SRCS)
>           $(CC) $(CFLAGS) -c $?
>           touch $@
> 
> --
> -------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://www.paulandlesley.org/gmake/
>  "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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