Preprocessing Frontend for C. More...
Namespaces | |
namespace | ellipsis-gnuc |
Variables | |
Tools | |
Configurable command line tools These can be used to adapt the script to your needs on systems that are not directly POSIX. The only one with importance here should be ELLIPSIS_CC which is used as the real C compiler after preprocessing. | |
CAT = ${CAT:-cat} | |
Command used to dump files to stdout. | |
CP = ${CP:-cp} | |
Command used to copy files. | |
ECHO = ${ECHO:-echo} | |
Echos its arguments to stdout. | |
ELLIPSIS_CC = ${ELLIPSIS_CC:-cc} | |
ELLIPSIS_VERBOSE = ${ELLIPSIS_VERBOSE:-0} | |
Set to 1 to augment verbosity of the script. | |
MKTEMP = ${MKTEMP:-mktemp} | |
Used to create a temporay directory that is destroyed on exit. | |
RM = ${RM:-rm} | |
Delete files, should accept -rf to forcably delete directories recursively. | |
SED = ${SED:-sed} | |
The sed Stream EDitor as it comes with POSIX since the epoch. | |
SORT = ${SORT:-sort} | |
The sort utility as it comes with POSIX since the epoch, should understand the -u option. | |
TMP = ${TMP:-/tmp} | |
The top level directory used for temporary files. | |
Tuning | |
Variables that are used to tune eĿlipsis You should generally not touch these. | |
ELLIPSIS_MARK_LINE | |
ELLIPSIS_MARK_LINE_RETURN | |
ELLIPSIS_MARK_LINE_START | |
ELLIPSIS_ONE_PHASE | |
ELLIPSIS_PRAGMA_FORWARD | |
Preprocessing Frontend for C.
In addition to the ellipsis preprocessor itself, this is used to determine predefined macros of a given compiler tool chain and to then preprocess source files with ellipsis using this knowledge. Thereby you should be able to use all extensions that eĿlipsis provides out of the box. I'd personally particularly recommend
This uses the following features to determine the basic preprocessor configuration of a C compiler, provided in the macro ELLIPSIS_CC. In general you should be able to use this as a first level replacement for your C compiler. For example if you have the make
utility
or
if you want to use clang
instead of gcc
. Obviously, for the above to work the compiler and ellipsis-gnuc.sh should be in your search path for executables. If not, you'd have to adapt that to provide the full path.
Properties that your C compiler should fulfill are as described for the POSIX c17
executable, namely arguments
-E
for preprocessing only-D
for defining macros-U
for undefining macros-I
for include paths-o
for a (single) output pathand the suffixes
.c
for C source files.i
for preprocessed C source filesIn addition it builds on the commonly supported options for compilers that try to be compatible with GNUC,
-dM
to dump macro definitions-v
to dump configuration information.and also implements GNUC's option
-P
to omit line number information in the output-MM
to dump make
dependency information to stdoutOther options such as
-c
to compile to one .o
object file per translation unit-S
to compile to one .x
assembly file per translation unitare just forwarded to the native compiler underneath. In particular, if no such option is present this usually should link all translation units into one executable at the end. If no .c
files are given this just passes all command line arguments through to the "real" compiler. In most case this will then link all object files together.
For -v
, it is assumed that the default include path are listed between lines that read
If no command line option is given, a file with predefined information similar to predefined-clang-14-x86_64-linux-gnu.h
is produced. The name of that file is composed from guesses about the compiler, its primary version, the processor architecture, the OS and the C library.
Otherwise, the mechanism is as follows:
ELLIPSIS_PREDEFINED
to the remaining steps..i
that are located in a temporary directory..i
file(s).-E
option had been given, the compiler is called with the modified argument list.-E
option had been given, the result is either dumped to stdout, or into a file specified with the -o
option.Thereby the compiler should not see any arguments they don't know about, they operate in the same directory as before and they should not try to preprocess the .i files, again.
There are some special rules that apply:
linux
, are not transferred.-
option reads the source from stdin.-
but not -E
options haven been given, an output has to be specified with -o
-E
no output file may be specified.%%
at the beginning of a line is the same as a #
.Some of preprocessor information was found at