The last weekend I decided to upgrade my computer and got out in a rush to get the required components. I bought a new MB, CPU, cooler, 2GB RAM, Graphic Card and a silence power supply unit.
After getting the hardware running, I sadly recognized that installing all the software I need for working in my different projects actually took much more time. So much time, that the complete weekend was wasted getting the software installation prepared for the next week.
Absorbed in getting all the software running, I downloaded a new cygwin and sadly, again, the automake and autoconf tools did not work. Well, I require to build some libraries which depend heavily on them. And by now I was not able to use GNUmake, SCons or jam for many reasons.
Recognizing that most of these make tools simply don’t suite my needs and that I have spent so many times configuring other tools to build libraries, I remembered that I always wanted to create a makefile tool. Being pragmatic, I came up with the following example for a project file:
/** Live C# make file for libclever **/ // project specific includes configuration("base") .includes("libsmart/smart"); // note: resolveCPreprocessorDependencies is a predefined call // platform independent file types filetype("CSource", "<strong>.c"); filetype("CPPSource", "</strong>.cpp"); // setup implicit dependencies for file types // classify dependent files as CHeader, so that dependency rule applies // recursivly dependencies(set("CSource", "CPPSource", "CHeader"), Builtin.Scanner.CPreprocessorDependencies, "CHeader"); platform("msvc") // everything compiled on msvc additionally uses the following includes. .includes(importSet("INCLUDE")) // platform dependent file types .filetype("Object", "<strong>.obj") .filetype("Library", "</strong>.lib") .translator(set("CSource", "CPPSource"), "Object", delegate(Configuration conf, string src, string out) { return string.Format( "cl.exe {0} {1} {2}", conf.format("-D{0}={1}"), src, out); }) .aggregator("Object", "Library", delegate(Configuration conf, string[] src, string out) { return string.Format( "lib.exe {0} {1}", out, string.Join(src, " ")); } ); configuration("debug") .prototype("base") .define("DEBUG"); configuration("release") .prototype("base"); library("libclever") .subdirs("clever", "finance"); // define valid buildsets buildset("all") .build("msvc", "debug") .build("msvc", "release"); // subdir("tools");
Wouldn’t this be fine project configuration? Actually, after I while I was able to create some code that compiled a simplified configuration into a C# method body.
Of course, the makefile tool will take some of my spare days (I don’t have) to be in the state to be usable, but nevertheless, the initial idea to (mis)use C# for the configuration specification looks promising (of course inspired by SCons). Favoring formalisms over code, I see lots of applications I don’t want to tell you right now ;)
May call this C# script?
happy scripting!, and stay tuned ;)
yours armin