0

Im trying to run the following makefile:

all:
    chmod +x codeWriter.py
    chmod +x parser.py
    chmod +x vmTranslator.py
    chmod +x VMtranslator


tar:
    tar cvf project7.tar README Makefile *.py VMtranslator

clean:
    rm -f *.tar *.pyc os* sys*

but for some unknown reason im getting those errors:

line 1: all:: command not found
chmod: codeWriter.py: No such file or directory
chmod: parser.py: No such file or directory
chmod: vmTranslator.py: No such file or directory
chmod: VMtranslator: No such file or directory

line 7: tar:: command not found
tar: README: Cannot stat: No such file or directory
tar: Makefile: Cannot stat: No such file or directory
tar: *.py: Cannot stat: No such file or directory
tar: VMtranslator: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.

any idea why?

Thank you!

Itzik984
  • 14,960
  • 27
  • 68
  • 101

2 Answers2

1

It sounds like you tried to run the Makefile as though it were a shell script (perhaps with sh Makefile). Makefiles should neither be run directly, nor even have execute permission (in most cases).

To execute the recipes in a Makefile, run make.

Celada
  • 20,882
  • 4
  • 59
  • 74
0

Try defining a working director as outlined here :

Common GNU makefile directory path

Use that PWD to reference the script files for the calls to chmod.

Community
  • 1
  • 1
dwerner
  • 6,292
  • 4
  • 27
  • 42