niedzielski/shebang

make command does not work : Makefile:2: *** missing separator. Stop.

sebma opened this issue · 2 comments

sebma commented

Hi,

If I copy your demo/make to a demo/Makefile file and run :

cd demo
make all
Makefile:2: *** missing separator.  Stop.

I would like to be able to use both ways to build, that is to say :
./Makefile and make

Can you help me ?

@sebma, hello! This demo does not support the use case you've described. As it's currently written, the top is interpreted by the shell and the bottom is interpreted by Make. If you wanted to add this functionality by building on the existing implementation you would need to:

  • Provide a means for exec make -f- "$@" << 'eof' to be interpreted functionally the same in shell but as a comment or no-op in Make. Offhandedly, I don't know a hack to do this.
  • Duplicate any top command line options in the bottom. Make supports setting many (but not all, I think) command line options in the makefile itself so hopefully this wouldn't be the blocker.

Some but not all of the demos do support whole-script interpretation by their interpreter, such as the Python demo, so that may be where the confusion came from. I've updated the readme to clarify that this isn't always the case.

sebma commented

@niedzielski Thanks for your explation :)