Makefile as an executable script with shebang?
问题 Is it possible to create an executable script that would be interpreted by make? I tried this: #!/usr/bin/env make --makefile=/dev/stdin main: @echo Hello! but it does not work - hangs until press Ctrl-c . 回答1: #!/usr/bin/make -f main: @echo Hello World! Is normally all you need in a standard make file. The filename is implicitly passed as the last argument. /dev/stdin here is (usually) the tty. You can do the whole env thing if there's a reason to, but often there's no need. ajw@rapunzel:~