Comment

Comment by moonchild

> The Makefile abstraction is "run this command when the output files don't exist or are older than the input files." You manually specify every tool to be run and all of its arguments.

> The BUILD file abstraction is something like "I am declaring a C library with these sources and headers."

This is wrong. Even ninja has generic rules. Here's an example of a minimal makefile:

  OBJ = src/a.o src/b.o src/c.o
  libfoo.so: $(OBJ)
          $(CC) -shared -o libfoo.so $(OBJ)
> When the tool is in charge, it has more control and can sandbox each build step so that undeclared dependencies simply won't be available in the sandbox.

There's no reason this shouldn't be possible with make; it just hasn't been implemented so. Do bazel/buck/please actually do this? As far as I know tup is the only tool that actually verifies inputs/outputs of rules, and it needs FUSE to do so.

> For example, unless you implement your own header scanning (or manually list your header dependencies) "make" won't know to rebuild a source file when a header changes.

At least with GNU make, it's very easy:

  CFLAGS += -MMD
  -include $(patsubst %.o,%.d,$(OBJ))
True, it's a bit of a footgun, but by no means difficult.

Make has problems, but the ones you listed aren't they.

parent moonchild 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton