8 ms·
Or just with a simple command which is guaranteed to be on most Linux systems already - make. Maybe his Makefiles aren't complex, nor they seem to follow all t
by a5c11 2y ago
Or just with a simple command which is guaranteed to be on most Linux systems already - make.
Maybe his Makefiles aren't complex, nor they seem to follow all the best practices invented by code gurus in sandals, but it works and, what's important, it works
for him.
- hulitu 2y ago> but it works That it what a lot of SW developers forget: your code might be the best in the world, but , if someone is not able to build it, it is useless.
- wruza 2y agoI remember countless times me and forum fellas debugging makefiles written under developers’ assumptions about systems. That is also what lots of developers forget or simply aren’t aware of. Make isn’t a silver bullet for builds. It isn’t even a bullet. Most software gets built from scratch and make’s deps graph makes little to zero sense in this mode. Make is a quirky poor dev tool footgun, jack of all trades master of none.
- kaba0 2y agoMake leaves the actual hard problem behind — setting up the environment correctly. A README file is much more useful.
- weinzierl 2y agoThere was a time when people would have said the same about make. The shell is the simple command that is guaranteed to be on all Unix systems from the get go. Make is the new kid on the block. If you just want to run commands in the order written down, don't need the topological sorting feature of make and value ubiquity then a shell script is the answer. If you are not stuck in the past and you truly live by the UNIX philosophy of doing one thing and doing it well, a command runner is the answer. The command runner avoids the ton of foot guns both shell scripts (no matter which flavor) and make files have. just also brings a couple of features out of the box that would be very tedious and error prone that replicate in make and shell scripts.
- darby_nine 2y agoRight but writing dependency management (of targets, not package management) in shell seems like a nightmare compared to just leveraging make. Why complicate things? It's dead simple to debug, the interface is dead simple, what's the downside?
- tcfhgj 2y agoIn my PS script solution, I just added a clean option+command. I rewrote my makefile in PS and don't miss anything from make and have no regrets, as it is simpler now.
- boomlinde 2y agoRight, but the original point which started the thread is that "The author is not even using the mtime-based dependency tracking", in which case a plain shell script is very much a viable alternative to make. I don't particularly mind this use of make, but as an article on make it fails to exemplify what I think is its main purpose.
- darby_nine 2y agoI don't think that really matters. Sometimes even basic shell scripts are better modeled with a makefile.
- movedx 2y agoI believe you to be correct. I think it's important that one uses the right tool for the job, regardless of whether or not it's widely adopted or supported.
- kristiandupont 2y ago>Make is the new kid on the block. Make is from 1976. I don't think you can legitimately refer to it as that.
- Ygg2 2y ago
- ReleaseCandidat 2y ago> it works and, what's important, it works for him. Until it doesn't. And then you really have to learn about PHONY targets, why and when there must be a tab and not spaces - good luck with an editor that doesn't treat Makefiles special and is configured to convert tabs to spaces.
- dented42 2y agoBut those are things that he’ll learn about as he keeps using make. And why does it matter that some editors don’t know about makefiles? The one he is using handles them just fine so what’s the problem?
- ReleaseCandidat 2y ago> And why does it matter that some editors don’t know about makefiles? Because it isn't fun checking if the whitespace at the beginning of the line is a tab or spaces. And as said, you must know when to use tabs and/or spaces in rules. For doing such a simple thing as calling some commands, Make has way too many subtle footguns which _will_ bite somebody, someday. The problem (that's not a problém at all, that's a reason to celebrate!) is that most JS devs and users aren't used to Make, compared to e.g. C programmers. To rephrase: as someone writing C, you have to use something like a Makefile, as anything else (like scripts) gets unreadable and -usable quite fast. But if you can get away with a less complex solution, you should really use that instead of Make.
- instig007 2y ago> Because it isn't fun checking if the whitespace at the beginning of the line is a tab or spaces. And as said, you must know when to use tabs and/or spaces in rules. that's why https://editorconfig.org/ https://editorconfig.org/ exists, so that neither you nor your teammates have to think about these things
- ReleaseCandidat 2y ago> neither you nor your teammates have to think about these things You're better off using a Makefile linter. But you must know about the problem before being able to solve it. And error messages like Makefile:2: *** missing separator. Stop. aren't the most helpful.
- unscaled 2y agoOr just use a simple command which ALL Unix system have: sh. If you're using make a glorified task runner, why don't you just create a scripts/ directory with shell scripts to do whatever you want. This is simpler, cleaner and works everywhere. Make doesn't really add anything. I get the feeling that using make this way is an aesthetic preference that has somehow developed with time into a "this is the one true Unix way" cargo cult.
- deepsun 2y agobin/ directory.