2 ## This file is part of the coreboot project.
4 ## Copyright (C) 2007 coresystems GmbH
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; either version 2 of the License, or
9 ## (at your option) any later version.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #X86EMU_INCLUDE = -I $(src)/util/x86emu/include
23 X86EMU_SRC = debug.c decode.c fpu.c ops.c ops2.c prim_ops.c sys.c
24 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_X86EMU),y)
25 BIOSEMU_SRC = biosemu.c
28 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_YABEL),y)
29 BIOSEMU_SRC = biosemu.c debug.c device.c mem.c io.c interrupt.c
30 #TODO: add vbe.c, currently not needed...
33 #PH: TODO: remove the compat files??
34 BIOSEMU_SRC += compat/functions.c
35 X86EMU_INCLUDE += -I $(src)/util/x86emu/yabel
36 X86EMU_INCLUDE += -I $(src)/util/x86emu
37 #TODO: remove these, these are .h files from slof, to make the merge easier...
38 X86EMU_INCLUDE += -I $(src)/util/x86emu/yabel/compat
40 REALMODE_SRC = x86.c x86_asm.S
42 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_X86EMU),y)
43 LIBX86EMU_SRC=$(patsubst %,x86emu/%,$(X86EMU_SRC)) $(BIOSEMU_SRC)
46 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_YABEL),y)
47 LIBX86EMU_SRC=$(patsubst %,x86emu/%,$(X86EMU_SRC)) $(patsubst %,yabel/%,$(BIOSEMU_SRC))
50 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_REALMODE),y)
51 LIBX86EMU_SRC=$(REALMODE_SRC)
54 LIBX86EMU_OBJS = $(patsubst %.c,$(obj)/util/x86emu/%.o,$(LIBX86EMU_SRC))
56 PCIROM_SRC += $(patsubst %,$(src)/util/x86emu/%,$(LIBX86EMU_SRC))
59 $(obj)/util/x86emu/libx86emu.a: $(LIBX86EMU_OBJS) $(src)/.config
60 @printf " AR $(subst $(shell pwd)/,,$(@))\n"
61 $(Q)rm -f $@ # otherwise we always add to the archive
62 $(Q)$(AR) qcs $@ $(LIBX86EMU_OBJS)
65 # This rule is also valid for all subdirectories
68 $(obj)/util/x86emu/%.o: $(src)/util/x86emu/%.c
69 @printf " CC $(subst $(shell pwd)/,,$(@))\n"
70 $(Q)mkdir -p $(dir $@)
71 $(Q)$(CC) -Werror $(INITCFLAGS) $(X86EMU_INCLUDE) -I$(src)/util/x86emu/include -c $< -o $@