What is your vision of ideal build system script?
Posted: Thu Sep 27, 2012 4:00 pm
I'm going to create my very own build system for my project, and I don't want to do it in SCons-style or Waf-style way, i.e. not with build scripts as Python or any other language files. I had few ideas of my own format, few that understood what .c or .cpp file is, few that didn't, few that were just obfuscated versions of Makefile, few that weren't, and I can't really come up with easy to learn and use format for it.
The build system is meant to require Makefile-like files, but providing sane way to call filesystem functions (no moar $(shell) hell), to get current architecture/OS, to access command line switches and allow users to write `if-else` blocks in it. I want something like this:
Those are meant just to show how I'd like to get switch handling and architecture handling done; I know there isn't much in this example, but I want to get some opinions from you.
So: how would your "ideal" Makefile-ish file format look like?
---------
Edit: I know Brendan will say something like "In my perfect world, you don't need build scripts"; yet I'm asking about opinions of us, non-perfect-worlders
The build system is meant to require Makefile-like files, but providing sane way to call filesystem functions (no moar $(shell) hell), to get current architecture/OS, to access command line switches and allow users to write `if-else` blocks in it. I want something like this:
Code: Select all
if (linux and -rose) // we are cross-compiling on Linux for ReaverOS
// command line: build -rose .
{
CXX = /usr/reaver/cross/bin/clang++ // or: load_preset(/usr/reaver/cross) or something like that
}
if (linux and -exclude includes builder)
// command line: build -exclude=builder ., but also build -exclude=builder,kernel,utilities
{
// ...
}
So: how would your "ideal" Makefile-ish file format look like?
---------
Edit: I know Brendan will say something like "In my perfect world, you don't need build scripts"; yet I'm asking about opinions of us, non-perfect-worlders