1

I have a Makefile that looks like this:

RENDER_HTML=jupyter nbconvert --execute --to html
MATE40001_TARGETS=$(wildcard MATE40001/notes/*.ipynb)

.phony: all
all:    MATE40001

.phony: variables
variables:
    @echo MATE40001_TARGETS:
    @echo ${MATE40001_TARGETS} | sed 's/ /\n/' | sed 's/MATE/\tMATE/'

.phony: MATE40001
MATE40001:  ${MATE40001_TARGETS}
    mkdir -p $@/html/
    ${RENDER_HTML} $^
    mv $@/notes/*.html $@/html/

.phony: clean
clean:
    rm -rf */html/ *~ */notes/*.html

When I run:

make
make clean 
make
make MATE40001

I get the following output:

...
<normal output>
...
rm -rf */html/ *~ */notes/*.html
make: Nothing to be done for 'all'.
make: 'MATE40001' is up to date.

As far as I understand, make is looking for the file MATE40001 which exists as a folder and then stops because there are no updated files. However I do not want this to happen, and I thought that adding .phony: MATE40001 would stop this problem.

What do I need to add/change to fix this issue?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
d-man
  • 476
  • 4
  • 24

1 Answers1

0

from comment by @G.M.

Use .PHONY instead of .phony

d-man
  • 476
  • 4
  • 24