Also support the "template" architecture for tests

This commit is contained in:
Pierre Pronchery 2015-07-03 19:00:14 +02:00
parent 490b4a5691
commit bc7ffca6c3
3 changed files with 26 additions and 4 deletions

View File

@ -37,6 +37,7 @@ extern AsmArchPluginDefinition arch_plugin_mipseb;
extern AsmArchPluginDefinition arch_plugin_mipsel;
extern AsmArchPluginDefinition arch_plugin_sparc;
extern AsmArchPluginDefinition arch_plugin_sparc64;
extern AsmArchPluginDefinition arch_plugin_template;
extern AsmArchPluginDefinition arch_plugin_yasep;
extern AsmArchPluginDefinition arch_plugin_yasep16;
extern AsmArchPluginDefinition arch_plugin_yasep32;
@ -63,6 +64,7 @@ static struct
{ "mipsel", NULL },
{ "sparc", NULL },
{ "sparc64", NULL },
{ "template", NULL },
{ "yasep", NULL },
{ "yasep16", NULL },
{ "yasep32", NULL }
@ -100,9 +102,10 @@ AsmArch * arch_new(char const * name)
_arch[13].definition = &arch_plugin_mipsel;
_arch[14].definition = &arch_plugin_sparc;
_arch[15].definition = &arch_plugin_sparc64;
_arch[16].definition = &arch_plugin_yasep;
_arch[17].definition = &arch_plugin_yasep16;
_arch[18].definition = &arch_plugin_yasep32;
_arch[16].definition = &arch_plugin_template;
_arch[17].definition = &arch_plugin_yasep;
_arch[18].definition = &arch_plugin_yasep16;
_arch[19].definition = &arch_plugin_yasep32;
}
for(i = 0; i < sizeof(_arch) / sizeof(*_arch); i++)
if(strcmp(_arch[i].name, name) == 0)

19
tools/arch/template.c Normal file
View File

@ -0,0 +1,19 @@
/* $Id$ */
/* Copyright (c) 2015 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Devel Asm */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define arch_plugin arch_plugin_template
#include "../src/arch/template.c"

View File

@ -7,7 +7,7 @@ dist=Makefile
[libAsm]
type=library
sources=arch.c,arch/amd64.c,arch/arm.c,arch/armeb.c,arch/armel.c,arch/dalvik.c,arch/i386.c,arch/i386_real.c,arch/i486.c,arch/i586.c,arch/i686.c,arch/java.c,arch/mips.c,arch/mipseb.c,arch/mipsel.c,arch/sparc.c,arch/sparc64.c,arch/yasep.c,arch/yasep16.c,arch/yasep32.c,format.c,format/dex.c,format/elf.c,format/elf/elf32.c,format/elf/elf64.c,format/flat.c,format/java.c,format/pe.c,../src/asm.c,../src/code.c,../src/parser.c,../src/token.c
sources=arch.c,arch/amd64.c,arch/arm.c,arch/armeb.c,arch/armel.c,arch/dalvik.c,arch/i386.c,arch/i386_real.c,arch/i486.c,arch/i586.c,arch/i686.c,arch/java.c,arch/mips.c,arch/mipseb.c,arch/mipsel.c,arch/sparc.c,arch/sparc64.c,arch/template.c,arch/yasep.c,arch/yasep16.c,arch/yasep32.c,format.c,format/dex.c,format/elf.c,format/elf/elf32.c,format/elf/elf64.c,format/flat.c,format/java.c,format/pe.c,../src/asm.c,../src/code.c,../src/parser.c,../src/token.c
cflags=-fPIC
[arch.c]