Goodbye to makefiles, only if you want to
Do you like hand-editing makefiles? Rascal takes the approach that you shouldn't need to learn another language to build, or even leave your source code to specify the build. It should also be easy to tell (by looking at the source code) what platforms it runs on and how to build it for each platform.On the Rascal command line you specify which platform you are targeting in your current build by specifying build-X. The Rascal compiler then searches your source code for
#rascal build(x)to find the build instructions for the desired target build. The build steps follow on the same line in a | delimited list. Rascal will execute each command in order until one of them signals that they have failed by returning a non-zero return code.
// to build and run on desktop windows, use "rascal build-windows-retail" #rascal build(windows-retail) (cl -Ox -EHsc test.cpp /link -out:testme.exe | testme.exe)Calling "rascal build-windows-retail" will compile this into testme.exe and will attempt to run it.
// to build and run on windowsce, use "rascal build-windowsce" #rascal build(windowsce) (cl -Ox -EHsc -DWINDOWSCE test.cpp /link -out:testme.exe | pfile -COPY testme.exe wce:\testme.exe | pfile -RUN wce:\testme.exe)Calling "rascal build-windowsce" will compile this into testme.exe, attempt to copy it to a Windows CE device using a tool called pfile, and then attempt to remotely launch it.
NEXT: Basic Control Statements - if, else, while, do, switch...

