help-make
[Top][All Lists]
Advanced

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

Re: gmake on windows help


From: Eli Zaretskii
Subject: Re: gmake on windows help
Date: Mon, 23 Apr 2007 11:33:34 +0300

> From: Vinay Ramdas Revankar <address@hidden>
> Date: Mon, 23 Apr 2007 11:02:04 +0530
> 
>     Please can any one tell me how to change the directory in the
> Makefile .I am using gmake to build a libray on windows-xp.
> i tread this but it is not working.
> 
> 
> obje=D:\project\obj
> lib=D:\project\lib
> target=MSM.lib
> src:=$(wildcard D:\project\MSM\src/*.c)
> 
> 
> $(lib)\$(target) : $(src)
>     cd $(obje)
>     armcc -c -O0 -g --cpu ARM1136J-S --apcs /inter --dwarf2  $(src)

Try this instead:

$(lib)\$(target) : $(src)
        cd $(obje) && armcc -c -O0 -g --cpu ARM1136J-S --apcs /inter --dwarf2  
$(src)

The problem here is that each command line is executed in a separate
shell, so `cd' does not affect the compilation command.

Btw, I would generally advise against using backslashes in gmake
Makefiles.  Use forward slashes instead, because backslashes are
treated as escape characters in some Makefile contexts, and using them
will almost certainly get you in trouble at some point.  By contrast,
forward slashes are supported by Windows filesystems as well (but you
may need to take them in quotes on some command lines).




reply via email to

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