like that. We could use functions like "Compile("main.c")" instead of steadily repeating "$(CC) $(CFLAGS) main.c" or "Link("program")" instead of "$(LD) $(LDFLAGS) <all object files> -o program".
Anyone can add support for a new compiler, yet I don't know how.
Code:
AddCompiler("very-strange-compiler",
optimize_a_bit="§optimizealittle",
optimize_much="§speedisallimportant",
debug="§iwilluseadebugger",
output="§iwannausefile $output")
Where "$output" is a placeholder.
And if a version is different, we should be able to replace something.
Code:
AddVersion("very-strange-compiler", "999.999",
profile="§helpmespeedupmycode")
Then, we use simply:
Code:
Compile("file.c", optimize=a_bit, profile=yes)
...
Link(strip=yes)
and this will result in an error if "very-strange-compiler" is being used in a version < 999.999, since it didn't support profiling.
Of course there are some problems like detecting the correct version etc. but it would be more portable and easy-to-use.