[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Newbie problems?
From: |
Greg Chicares |
Subject: |
Re: Newbie problems? |
Date: |
Sat, 08 Nov 2003 12:24:03 -0500 |
Andy Voelkel wrote:
>
> I've been trying to migrate from OPUS make to GNU make [...]
>
> Problem #1:
>
> I've got an implicit rule definition:
>
> %.obj:%.c
> cl500 $(COPT) -fr$(OBJDIR) -i\progs\c54x\ -cg -i$(INCDIR) $<
>
> The -fr flag tells the DSP compiler to put the object files in
> $(OBJDIR). When I run this rule from OPUS make, it works fine. When I
> run it from gmake, the object files are put in the current directory
> instead of $(OBJDIR). [...]
I'll guess that $(OBJDIR) uses backslash '\' rather than
forward slash '/'. Maybe make is trying to interpret '\'
as a *nix escape character instead of a msw path separator.
Try using forward slashes instead--many msw compilers
accept that. Or maybe you could double the backslashes
if c1500 doesn't work that way.
Even better, follow rule 3 here
http://make.paulandlesley.org/rules.html
as explained in more detail here
http://make.paulandlesley.org/vpath.html
> Problem #2:
>
> So in order to work around problem #1, I rewrote the rule:
>
> %.obj:%.c
> cl500 $(COPT) -i\progs\c54x\ -cg -i$(INCDIR) $<
> move $@ $(OBJDIR)
>
> When I try running this, I get the following message from gmake:
>
> move ppm.obj ..\..\obj\ppm
> process_begin: CreateProcess((null), move ppm.obj ..\..\obj\ppm, ...)
> failed. make (e=2): The system cannot find the file specified.
> gmake: *** [ppm.obj] Error 2
Looks like make is unaware of the 'move' command.
Try giving it an explicit path, like
MOVE = /4dos/move.exe
$(MOVE) $@ $(OBJDIR)
> Problem #3:
>
> So now I try:
>
> %.obj:%.c
> cl500 $(COPT) -i\progs\c54x\ -cg -i$(INCDIR) $<
> ren $@ $(OBJDIR)
>
> Now the error message changes:
>
> ren ppm.obj ..\..\obj\ppm
> The syntax of the command is incorrect.
>
> The only difference between this and the previous scenario is that if I
> trying saying "ren ppm.obj ..\..\obj\ppm" to 4NT, it works,
> but if I try saying it to cmd.exe, it says:
>
> The syntax of the command is incorrect.
So that error message comes from CMD.EXE, not from make.
> This is probably because "ren" under 4NT is smarter than under cmd.exe.
> Perhaps there is a clue here, in that it seems that the subshell that
> is invoked under 4NT in this case may not be a 4NT shell. That's odd,
> because COMSPEC is set so that subshells should be 4NT.
If $(SHELL) is defined, that might be overriding $(COMSPEC).
After spending a lot of time wrestling with differences
among various 'DOS' shells, I converted all my makefiles
to use a *nix shell running under msw, and life has been
much easier since then. The MSYS bash environment from
www.mingw.org
is worth looking at if you want to try this.
- Newbie problems?, Andy Voelkel, 2003/11/08
- Re: Newbie problems?,
Greg Chicares <=