Re:Show HN: My C compiler compiled itself
by anyfoo on Wednesday December 04, 2024 @01:53PM
(#42320667)
I did mention that in other comments, including the C preprocessor helping. make is completely language agnostic, so it cannot “guess” header dependencies. In make, you get the dependencies you specify (whether manual or generated), that’s what I wanted to show.
[ Parent
| on HN ]
Re:Show HN: My C compiler compiled itself
by peterfirefly on Wednesday December 04, 2024 @06:01PM
(#42323002)
Make makes the easy part easy but the rest quite hard -- which I think you agree with.
It sure would be nice to have something like this:
codegen/codegen.o: !codegen/codegen.c
$(CC) -c $(CFLAGS) -o $@ $<
'!' would run $(CC) with -MD to extract the header dependencies. Doing that back in 1995 would have increased the value and usability of GNU make immensely (and greatly reduced the need for all the other complexity it has).