4 ms·
Make is useful and the concept is sound. However, the implementation is dated. Just off the top of my head, it could be object oriented (rules could be subcla
by m463 7y ago
Make is useful and the concept is sound.
However, the implementation is dated.
Just off the top of my head, it could be object oriented (rules could be subclassed), the language could have more sophisticated statements, it could have debugging, etc
- a3n 7y agoIt could have non-significant whitespace.
- lokedhs 7y agoThat would be great, but significant whitespace doesn't seem to stop all the Python users out there.
- m463 7y agoI will say I like how python uses whitespace syntactically. The whitespace is consistent, makes programs readable and much more compact. make seems to be less consistent. I think it distinguishes between a space and a tab, which isn't clear without editor help.
- a3n 7y agoYeah, I wasn't specific here. Tabs and spaces in Make are different specific things. I also like Python's significant whitespace. It's easy to mess up whitespace in Make and it might not complain about it. Mixed whitespace in Python will either work without problem, or it will tell you when it doesn't. Make's whitespace is unnecessarily clever.
- kjs3 7y agoWhy is old bad? I can't tell you how often one of my team shows me some clever, non-trivial Python script that I solve in a couple of lines of awk/sed/perl. Or a small makefile. Why in the world would I want an OOP make? What do I need 'more sophisticated' in make statements that wouldn't really mean that I needed to be using a different tool that undoubtedly wasn't solving the problem make solves? OK...debugging could be better. Got me there.
- m463 7y agoI've used make extensively. I wish it had a little python in it. After using pathnames in awk/sed/perl I find using os.path in python gets rid of all the special cases due to quoting and escaping. Python has nice lists and dicts and sets too. For OO, I wish rules were a bit like python classes. It would be wonderful for say 10 c files compiling one way, and the 11th having a different option. Or overriding a few options everywhere for the debug build. I also think if rules had some sort of class, maybe the nuts and bolts underneath could be changed. You could be explicit about some things that are very hard with make. For example, what if you could write your own custom "out-of-date" check. Instead of "result must be newer that dependencies", maybe you could do something with checksums or source control or something and say "ok, don't rebuild this, or here is the cached result"
- jacwah 7y ago> It would be wonderful for say 10 c files compiling one way, and the 11th having a different option. You can do this by combining implicit and explicit rules: target: $(OBJ) # default rule %.o: %.c cc -o $@ $^ # special case special.o: special.c specialc -o $@ $^
- Pete_D 7y agoAnother way, with target-specific variables (might be a GNUism): special.o: CFLAGS += -Wno-blah %.o: %.c echo $(CC) $(CFLAGS) -o $@ $<
- teddyh 7y ago> I wish it had a little python in it. GNU Make can have Scheme in it: https://www.gnu.org/software/make/manual/make.html#Guile-Integration https://www.gnu.org/software/make/manual/make.html#Guile-Int...
- kjs3 7y agoOK...I can see where you're coming from. The pathname thing doesn't bother me probably because the quoting and escaping is muscle memory after 30 years, but fair point and an easy source of sometime hard to find mistakes. The 11th file thing as pointed out below can be worked around easily, but yeah mixing implicit and explicit rules isn't 'elegant'. Dunno know if 'subclassing' the rule or whatever is the answer; maybe if there's a lot of exceptions. Interesting to think about. I think the answer to your last example is one of 1) 'Unix philosophy' the problem by invoking separate scripts/tools to set things up for what 'make' expects so you get the result you want ("if the checksum of the source file changes, 'touch' it to make sure it gets rebuilt" or something) or 2) maybe 'make' isn't the right tool, because it's definitely not always the right tool. Because that's really the key: right tool, and 'it's old' by itself is rarely the reason not to use a tool.
- boris 7y agoThis ("the conceptual model is sound but the implementation could be improved") is pretty much the basis for build2: https://build2.org/build2/doc/build2-build-system-manual.xhtml#intro https://build2.org/build2/doc/build2-build-system-manual.xht...