BlastDV
BlastDV

Reputation: 143

Makefile fails to run properly on Windows

I'm trying to run my makefile but for some reason, make is not even able to run a simple "cls", all I get is:

make all_w

process_begin: CreateProcess(NULL, cls, ...) failed. make (e=2): El sistema no puede encontrar el archivo especificado. make: * [all_w] Error 2

Here's my makefile:

all_l:
    make clean_all_l
    make lexer
    make lexerpiece_l

all_w:  
    cls
    # make clean_all_w
    # make parser
    # make lexer
    # make parserpiece_w

lexerpiece_l:
    gcc lex.yy.c -o lexerpiece_l -lfl -lm
    @echo Done

lexerpiece_w:
    gcc lex.yy.c -o lexerpiece_w -lfl -lm
    @echo Done

parserpiece_w:
    gcc lua_parser.tab.c lex.yy.c -lfl -lm -o parserpiece_w
    @echo Done

clean:  
    $(info Limpiando el Proyecto)
    -del lexerpiece.exe
    -del parserpiece.exe
    @echo Done

clean_all_w:
    $(info Realizando limpieza profunda)
    #cls
    -del lex.yy.c
    #-del lua_parser.tab.c
    #-del lua_parser.tab.h
    #-del lexerpiece_w.exe
    #-del parserpiece_w.exe
    #cls

clean_all_l:
    $(info Realizando limpieza profunda)
    -rm lex.yy.c
    -rm lexerpiece
    clear

#Esto corre FLEX y crea el nuevo lexer
lexer: 
    flex lua_lexer.l
    @echo Lexer creado

#Esto corre BISON y crea el nuevo parser
parser:
    bison -d lua_parser.y
    @echo Parser creado

#Esto correra FLEX sobre un archivo de testing
lexer_test:
    flex test.l
    @echo Lexer de prueba creado

Of course, I have updated the $PATH variable.

Any thoughts?

Upvotes: 0

Views: 2207

Answers (1)

Rubén Pozo
Rubén Pozo

Reputation: 1083

I was having the same problem trying to make with msys2. I have fixed adding this line of code to makefile:

SHELL=CMD

Additional information about this variable in GNU make manual

Upvotes: 1

Related Questions