help-make
[Top][All Lists]
Advanced

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

RE: for loop causing error


From: Henry Gessau
Subject: RE: for loop causing error
Date: Mon, 9 Oct 2000 15:19:38 -0400

> I am running make 3.79.1 on Windows NT.  When I run an empty for loop (the
> shell is just cmd.exe) in a target, it generates a make error:
> 
> -----
> clean:
>       for %%i in (*.ilk *.vdb) do $(RM) $(RMFLAGS) "%%i"
> -----

What are the values of RM and RMFLAGS?

The DEL (or ERASE) command that is provided by CMD.EXE is not as makefile
friendly as Unix's rm. I have a wrapper .bat file derived from the one
provided by WindRiver for their Tornado/VxWorks environment for NT:

vxrm.bat
---------------
@echo off
:start
if "%1"=="" goto end
if exist %1 erase /f /q %1 > nul
shift
goto start
:end
---------------

Now you can do this:

-----
RM = vxrm.bat # must be in your PATH

clean:
        $(RM) *.ilk *.vdb
-----

I guess this forces the RMFLAGS to be "/f /q", but I've never needed them
to be anything else, so it hasn't bothered me. Maybe you can change the
erase line in the batch file to:

if exist %1 erase %RMFLAGS% %1 > nul

But I have never tried this.

-- 
Henry




reply via email to

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