Currently we have two command line interfaces
ellipsis
, the preprocessor binarygcc
, clang
and perhaps similar other compilersThe first should be typically used if you process your sources in two steps, the second (currently C only) if you preprocess and then compile in one go.
This binary is a standalone preprocessor that can be used to preprocess a file in one of the supported languages. It is standalone, in the sense that it does not need any headers or configuration files, everything it needs is built into the executable.
Usually you will use this to compile your (programming) text in two phases, the result of the preprocessing stored in an intermediate file or maybe piped into a subsequent phase. For example to tranform markdown files that contain preprocess directives into html
I usually use a pipe such as the following
Being standalone has the advantage of being usable without much prerequesites but also has the disadvantage that there might be platform specific informations that are missing. For C in particular, a preprocessor needs a lot of information, for example
and many more. Such information cannot be made completely available by a generic tool such as ellipsis
.
For the general case we provide a preprocessing mode that allows to process ellipsis-specific constructs in a first step and then pass the result into the usual compiler framework that does the remainder of the preprocessing.
For C we have the reserved the preprocessor token %%
reserved for that purpose, for example
per default ellipsis
will translate this to something like
This mechanism is meant to help you use the specific extensions that are provided by eĿlipsis, but to produce secondary source files that can be compile by a normal C compiler. The latter is particularly important if you want to distribute your sources to others that are then able to compile your project in their specific setting.
To see an example of a project that is built like that, have a look at the sources of ellipsis itself.
The script ellipsis-gnuc.sh provides a direct front end that can be used as a replacement for your C compiler's preprocessor, as long as that C compiler adheres to some extensions that are found in Gnu compilers. It is tested with recent versions of gcc
and clang
. The idea here is that you use this really as if you'd use a normal C compiler (here as you'd do that typically on a POSIX system)
which should produce an object file toto.o
or
(without the -c
) which should produce the executable toto
.
This tries to find a C compiler as cc
somewhere in your executable path. If you want to use another compiler underneath you may provide its name (and path) through the variable ELLIPSIS_CC. For example to use clang
or, if you even want to force as specific version of that compiler: