Search code examples
nmake

where is the doc about @if exist for NMAKE


I can use @if exist to test a file does exist or not, but did not find the document via Google. For example, in my makefile for nmake ;

clean: 
    @if exist $(BIN_DIR) rmdir /S /Q $(BIN_DIR)
    @if exist $(OBJ_DIR) rmdir /S /Q $(OBJ_DIR)

Solution

  • You won't find any documentation regarding "@if exist" in nmake documentation. These are plain shell commands.

    So just open a cmd window and at the prompt enter "help if". By the way the "@" sign suppresses the echo in a shell script.

    Thats's why most of .bat scripts start with "@echo off".