5 ms·
I guess the only gripe I have with make is that it has a rigid syntax (that includes tabs). Since what a Makefile eventually is, is a graph, I'd be happy if tha
by fizixer 10y ago
I guess the only gripe I have with make is that it has a rigid syntax (that includes tabs). Since what a Makefile eventually is, is a graph, I'd be happy if that graph is specified as a JSON file, which automatically gets converted into a valid Makefile.
Has anyone attempted that approach? simply put a JSON wrapper around make?
- wtetzner 10y agoI agree that Make's syntax isn't ideal, but JSON doesn't seem like a move in the right direction. If you're going to give Make a new syntax, why not pick a more pleasant syntax?
- hood_syntax 10y agoCurious what you mean by pleasant. JSON is not really "pretty" but it is simple, and powerful imo. Is it the boilerplate that puts you off?
- padator 10y agoYou can use mk, the successor to make, which does not have the TAB requirement (you can use TAB or spaces interchangeably). Regarding JSON, it is more verbose than Make. You need to use quote around strings, commands, everything. Compare: foo.o: foo.c gcc -c foo.c with { 'foo.o' => ['foo.c'; 'gcc -c foo.c'] }
- wtetzner 10y agoYes, the issue is that build scripts are typically written and maintained by humans (as opposed to programs). A more pleasant syntax is one that would be easier to read and maintain. I think if you want a simple serialization format to replace Make's syntax, s-expressions would be a better fit.
- fizixer 10y agoWell, the way I see it, there are only 3 games in town: JSON-style variants (including YAML, arguably), XML, and S-expression variants. XML is definitely not better than JSON IMO. Are you hinting at either S-expression, or something like YAML? (For any other "custom syntax" we're better off sticking to make syntax itself)
- wtetzner 10y agoWell, your 3 games in town are serialization formats. They're great choices if you want tools to manipulate the build scripts. However, in my opinion, from your list only s-expressions make a reasonable syntax that a human would write an maintain. And, if you want that, well :) https://www.gnu.org/software/make/manual/html_node/Guile-Integration.html https://www.gnu.org/software/make/manual/html_node/Guile-Int...
- nihongo 10y agoDoesn't Ant use XML format?
- Scaevolus 10y agoNinja is a fast Make-like build system with a format designed to be generated by higher-level build tools. It was originally written for Chrome, but has been adopted as an output format for CMake and is used for many other projects as well.