user3748883
user3748883

Reputation: 339

Simple Makefile doesn't clean

I have this Makefile:

default:
    mv presentacion.pdf /tmp
    pdflatex presentacion.tex

clean:
    rm -f *.{aux,log,nav,out,snm,toc}

The order make works well but when I try to do a make clean the shell outputs:

rm -f *.{aux,log,nav,out,snm,toc}

And does not remove the files. What's wrong in the code?

Upvotes: 1

Views: 83

Answers (2)

oliv
oliv

Reputation: 13249

You can let make add the prefix to your files (instead of bash), by using addprefix:

PREFIXES := aux log nav out snm toc
FILES := $(addprefix *., $(PREFIXES))

default:
        mv presentacion.pdf /tmp
        pdflatex presentacion.tex

clean:
        rm -f $(FILES)

Upvotes: 0

DAXaholic
DAXaholic

Reputation: 35358

Try to set the shell to bash in your makefile (according docs)

SHELL=/bin/bash

default:
    mv presentacion.pdf /tmp
    pdflatex presentacion.tex

clean:
    rm -f *.{aux,log,nav,out,snm,toc}

Upvotes: 1

Related Questions