biosemu (non-yabel) cleanup
[coreboot.git] / util / x86emu / Makefile
1 ##
2 ## This file is part of the coreboot project.
3 ##
4 ## Copyright (C) 2007 coresystems GmbH
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; either version 2 of the License, or
9 ## (at your option) any later version.
10 ##
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.
15 ##
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
19 ##
20
21 #X86EMU_INCLUDE = -I $(src)/util/x86emu/include  
22
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
26 endif
27
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...
31 #BIOSEMU_SRC +=vbe.c
32 BIOSEMU_SRC +=pmm.c
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
39 endif
40 REALMODE_SRC    = x86.c x86_asm.S
41
42 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_X86EMU),y)
43 LIBX86EMU_SRC=$(patsubst %,x86emu/%,$(X86EMU_SRC)) $(BIOSEMU_SRC)
44 endif
45
46 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_YABEL),y)
47 LIBX86EMU_SRC=$(patsubst %,x86emu/%,$(X86EMU_SRC)) $(patsubst %,yabel/%,$(BIOSEMU_SRC))
48 endif
49
50 ifeq ($(CONFIG_PCI_OPTION_ROM_RUN_REALMODE),y)
51 LIBX86EMU_SRC=$(REALMODE_SRC)
52 endif
53
54 LIBX86EMU_OBJS = $(patsubst %.c,$(obj)/util/x86emu/%.o,$(LIBX86EMU_SRC))
55 # needed for kscope
56 PCIROM_SRC += $(patsubst %,$(src)/util/x86emu/%,$(LIBX86EMU_SRC)) 
57
58
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)
63
64 #
65 # This rule is also valid for all subdirectories
66 #
67
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 $@
72