blob: 8ec4d41fc5b5658fdb939bad97a0cf718d2cdb7b [file] [log] [blame]
Thomas Heijligen6efdfb32021-10-12 15:16:46 +02001/*
2 * This file is part of the flashrom project.
3 *
4 * Copyright (C) 2011 Carl-Daniel Hailfinger
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16/*
17 * This file determines the target architecture. It should only be used
18 * by the Makefile
19 */
20
21#if defined (__i386__) || defined (__x86_64__) || defined(__amd64__)
22 #define __FLASHROM_ARCH__ "x86"
23#elif defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips)
24 #define __FLASHROM_ARCH__ "mips"
25#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || \
26 defined(__ppc__) || defined(__ppc64__) || defined(_M_PPC) || defined(_ARCH_PPC) || \
27 defined(_ARCH_PPC64) || defined(__ppc)
28 #define __FLASHROM_ARCH__ "ppc"
29#elif defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_ARM) || defined(_M_ARM) || defined(__arm) || \
30 defined(__aarch64__)
31 #define __FLASHROM_ARCH__ "arm"
32#elif defined (__sparc__) || defined (__sparc)
33 #define __FLASHROM_ARCH__ "sparc"
34#elif defined (__alpha__)
35 #define __FLASHROM_ARCH__ "alpha"
36#elif defined (__hppa__) || defined (__hppa)
37 #define __FLASHROM_ARCH__ "hppa"
38#elif defined (__m68k__)
39 #define __FLASHROM_ARCH__ "m68k"
40#elif defined (__riscv)
41 #define __FLASHROM_ARCH__ "riscv"
42#elif defined (__sh__)
43 #define __FLASHROM_ARCH__ "sh"
44#elif defined(__s390__) || defined(__s390x__) || defined(__zarch__)
45 #define __FLASHROM_ARCH__ "s390"
46#elif defined(__arc__)
47 #define __FLASHROM_ARCH__ "arc"
48#else
49 #define __FLASHROM_ARCH__ "unknown"
50#endif
51__FLASHROM_ARCH__