1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/* This file is part of the nesC compiler.
Copyright (C) 2002 Intel Corporation
The attached "nesC" software is provided to you under the terms and
conditions of the GNU General Public License Version 2 as published by the
Free Software Foundation.
nesC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with nesC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "parser.h"
#include "machine.h"
#include "errors.h"
#include "c-parse.tab.h"
#undef yystype
#include "c-parse.h"
#include "semantics.h"
#include "nesc-gcc.h"
#include "machine/avr.c"
#include "machine/self.c"
#include "machine/keil.c"
#include "machine/sdcc.c"
#include "machine/msp430.c"
#include "machine/env_machine.c"
static machine_spec *machines[] = {
&avr_machine,
&self_machine,
&keil_machine,
&sdcc_machine,
&msp430_machine,
&env_machine,
NULL
};
machine_spec *target = &self_machine;
const char *target_compiler = "gcc";
bool select_target(const char *targetname)
{
machine_spec **scan;
for (scan = machines; *scan; scan++)
if (!strcmp(targetname, (*scan)->machine_name))
{
if (*scan == &env_machine &&
scan_env_machine(&env_machine, "NESC_MACHINE") == FALSE)
{
error("invalid target described in env NESC_MACHINE");
return FALSE;
}
target = *scan;
return TRUE;
}
error("unknown target %s", targetname);
return FALSE;
}
|