Earlier quoted context omitted.
> It actually doesn't know anything at all about how to build C, C++, or any other kind of code. I guess it depends on how you define "know", but there are implicit rules. $ cat foo.c #include int main() { printf("Hello\n"); return 0; } $ cat Makefile foo: foo.c $ make cc -O2 -pipe foo.c -o foo $ ./foo Hello
Fun fact: your Makefile above is redundant. You can delete it entirely, and the implicit rules you're using here continue to work just fine.
The Makefile I use with JavaScript projects
181–190 of 525 posts
Re: The Makefile I use with JavaScript projects
#182Earlier quoted context omitted.
Look at the git makefile: https://github.com/git/git/blob/master/Makefile You know what you have to do to build git? Type make. It's amazing.
If fixing things in this makefile is not your job, then it really is amazing.
Re: The Makefile I use with JavaScript projects
#183Earlier quoted context omitted.
I've been writing Makefiles regularly for maybe 15 years and I always end up on this page every time I need to write a new one: https://www.gnu.org/software/make/manual/html_node/Automatic... $ $* $^ ... Not particularly explicit. You also have the very useful substitution rules, like $(SRC:.c=.o) which are probably more arcane than they ought to be. You can make similar complaints about POSIX shell syntax but at lea…
> $(SRC:.c=.o) I use $(patsubst %.c,%.o,$(SRC)) instead, which I find easier to remember.
Re: The Makefile I use with JavaScript projects
#184Earlier quoted context omitted.
> It's really a workflow automation tool, That's true. > and the UX for that is actually pretty close to what you would want. That is so not true. Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. That's often true for builds (which is why make works reasonably well for builds), but often not true f…
> but often not true for other kinds of workflows. Examples? I mean, there are some broken tools (EDA toolchains are famous for this) that generate multiple files with a single program run, which make can handle only with subtlety and care. But actual tasks that make manages are things that are "expensive" and require checkpointing of state in some sense (if the build was cheap, no one would bother with build tooling…
Anything where the relevant state lives in a database, or is part of a config file, or is an event that doesn't leave a file behind (like sending a notification).
Re: The Makefile I use with JavaScript projects
#185Earlier quoted context omitted.
> It's really a workflow automation tool, That's true. > and the UX for that is actually pretty close to what you would want. That is so not true. Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. That's often true for builds (which is why make works reasonably well for builds), but often not true f…
> Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. I've always wondered whether Make would be seen as less of a grudging necessity, and more of an elegant panacea, if operating systems had gone the route of Plan 9, where everything is— symbolically —a file, even if it's not a file in the sense of "…
How are you going to make the result of a join in a relational database into a file, symbolically or otherwise?
Re: The Makefile I use with JavaScript projects
#186Earlier quoted context omitted.
> It's really a workflow automation tool, That's true. > and the UX for that is actually pretty close to what you would want. That is so not true. Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. That's often true for builds (which is why make works reasonably well for builds), but often not true f…
> Make has deeply woven into it the assumption that the product of workflows are files You're referring to a standard Unix tool, an operating system where EVERYTHING is a file.
Re: The Makefile I use with JavaScript projects
#187Earlier quoted context omitted.
> It's really a workflow automation tool, That's true. > and the UX for that is actually pretty close to what you would want. That is so not true. Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. That's often true for builds (which is why make works reasonably well for builds), but often not true f…
> Make has deeply woven into it the assumption that the product of workflows are files You're referring to a standard Unix tool, an operating system where EVERYTHING is a file.
Re: The Makefile I use with JavaScript projects
#188Earlier quoted context omitted.
If you're able, I'd be very interested in seeing some examples.
Not the OP, doing a bit less that it sounds like the OP is doing, but we built out a relatively handy make-based build system for building a set of images in correct dependency order. Another member of the team subsequently taught make about the reverse dependencies so that you can split jobs across Travis nodes by the top-ish level image they depend on. My favorite addition was the ability to generate a dependency g…
I regret not considering Make for Docker administration months/years ago. I've taken to using bash scripts or, worse, tagged bash comments to recall commonly used complex commands.
Re: The Makefile I use with JavaScript projects
#189Earlier quoted context omitted.
> but often not true for other kinds of workflows. Examples? I mean, there are some broken tools (EDA toolchains are famous for this) that generate multiple files with a single program run, which make can handle only with subtlety and care. But actual tasks that make manages are things that are "expensive" and require checkpointing of state in some sense (if the build was cheap, no one would bother with build tooling…
> Examples? Anything where the relevant state lives in a database, or is part of a config file, or is an event that doesn't leave a file behind (like sending a notification).
To be serious, those are sort of contrived. "Sending a notification" isn't something you want to be managing as state at all. What you probably mean is that you want to send that notification once, on an "official" build. And that requires storing the fact that the notification was sent and a timestamp somewhere (like, heh, a file).
And as for building into a database... that just seems weird to me. I'd be very curious to hear about systems that have successfully done this. As just a general design point, storing clearly derived data (it's build output from "source" files!) in a database is generally considered bad form. It also introduces the idea of an outside dependency on a build, which is also bad form (the "source" code isn't enough anymore, you need a deployed system out there somewhere also).
Re: The Makefile I use with JavaScript projects
#190The concepts behind make are quite good, but the interface it provides is not decidedly not. It reminds me of Git in that respect. I'd think replacing the opaque symbols used everywhere with more descriptive words would be helpful. I don't suppose anyone knows if modern Make versions support alternatives to $@, $%, $?, etc. that can be read rather than memorized?
make -f-
But for the sake of compatibility I wouldn't.