| 1 |
/* Definitions for specs for GNU Modula-2. |
| 2 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Gaius Mulley. |
| 4 |
|
| 5 |
This file is part of GCC. |
| 6 |
|
| 7 |
GCC is free software; you can redistribute it and/or modify |
| 8 |
it under the terms of the GNU General Public License as published by |
| 9 |
the Free Software Foundation; either version 3, or (at your option) |
| 10 |
any later version. |
| 11 |
|
| 12 |
GCC is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with GCC; see the file COPYING3. If not see |
| 19 |
<http://www.gnu.org/licenses/>. */ |
| 20 |
|
| 21 |
/* This is the contribution to the `default_compilers' array in gcc.c for |
| 22 |
GNU Modula-2. */ |
| 23 |
|
| 24 |
/* A spec for the 'integrated' preprocessor implementation for Modula-2. */ |
| 25 |
#define M2CPP \ |
| 26 |
"%{E|M|MM|fcpp: %{E} %{MF} -fcpp-begin " \ |
| 27 |
" %{!E:-E} %(cpp_unique_options) -traditional-cpp -ansi " \ |
| 28 |
" -fcpp-end %{B*} %{save-temps*} ; \ |
| 29 |
: %{v} %I %{B*} %{save-temps*} } " |
| 30 |
|
| 31 |
#define MDMMD \ |
| 32 |
" %{MD:-MD %{!o:%b.d}%{o*:%.d%*} %{!MT:-MT %b%O} %{MT} %{MQ} %{MF}} " \ |
| 33 |
" %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*} %{!MT:-MT %b%O} %{MT} %{MQ} %{MF}} " |
| 34 |
|
| 35 |
/* We have three modes: |
| 36 |
1. When the preprocessing step is explict and there is no following |
| 37 |
compilation. Here we do a similar process to cc1 -E where most of |
| 38 |
the compilation is short-circuited. |
| 39 |
2. When we are mimicking an integrated preprocessor. Here we use the |
| 40 |
modula-2 'fcpp' to construct a command line for the preprocessor and |
| 41 |
snarf save-temps and dumpdir inputs to try and be consistent. |
| 42 |
3. We can consume a pre-processed modula-2 source. */ |
| 43 |
|
| 44 |
{".mod", "@modula-2", 0, 0, 0}, |
| 45 |
{"@modula-2", |
| 46 |
/* For preprocessing we use cc1 but wrap it in cc1gm2. */ |
| 47 |
"%{E|M|MM:\ |
| 48 |
cc1gm2 " M2CPP " %{!fcpp:-fcpp;:%{fcpp}} %{fm2-pathname*} %i } \ |
| 49 |
%{!E:%{!M:%{!MM:\ |
| 50 |
cc1gm2 " M2CPP MDMMD " %(cc1_options) %{fm2-pathname*} %i %{c} \ |
| 51 |
%{!fsyntax-only:%(invoke_as)} \ |
| 52 |
}}}", 0, 0, 0}, |
| 53 |
{".m2i", "@modula-2-cpp-output", 0, 0, 0}, |
| 54 |
{"@modula-2-cpp-output", |
| 55 |
"%{!M:%{!MM:%{!E: \ |
| 56 |
cc1gm2 %<fcpp %(cc1_options) %{v} %I -fmod=.mod.m2i -fdef=.def.m2i \ |
| 57 |
%{fm2-pathname*} \ |
| 58 |
-fpreprocessed %i %{c} \ |
| 59 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |