Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The `./make` shell script kills me. Why not just use Make?


Make is designed to track build dependencies, not to execute programs, so I think the problem is the choice of name.

"just" is a utility designed to execute programs: https://github.com/casey/just#just


Is there any design decision of Make that makes it not suitable for executing programs?


Just knowing the commands and their arguments (environment vars) with make is difficult. Env vars can easily have typos. With just you can actually list out all the commands.


(not strong arguments but some possible explanations)

1) ./make can be more portable e.g. you might use some GNU Make syntax that does not run on BSD and have to insall gmake just to run that

2) Make is not designed to be a command runner and have to manually add .PHONY to everything

3) case looks minimal and flexible enough (although I'm sure sh's confusing syntax can cause a lot of pain for non sh experts like esac wtf)


Those all sound plausible! But...

1) I suspect GNU Make will be installed on any system where node code will run.

2) You don’t have to .PHONY anything that will never be a real file.

3) My bet is the Makefile will be shorter and clearer, but I am of course biased since I’m used to the syntax.


I'm working on the Makefile, but I'm stuck with the `time ./make-production.js` task.

`$ which time

time: shell reserved word`


You could use something like `sh -c 'time ...'` to work around that. (You might need bash instead of sh, it might depend on what sh is on your system.)


Thank you, that worked well. I added it to the post.


And as an added bonus, Make gives you tab autocompletion




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: