From 850e7d48845ed78bc50f9d0d8caae8132d2ba38d Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 28 Sep 2015 13:12:04 -0700 Subject: vgabios: fix compilation after x86emu changes This utility links in coreboot code, and has been broken for a while again after removing some hacks from coreboot. I hadn't realized how bad it was broken last time, and since most of this stuff is still in a pretty bad shape, I decided to throw all of the changes together. Signed-off-by: Stefan Reinauer Change-Id: If3e4399b1b0e947433b97caa29962ef66ea2993d Reviewed-on: http://review.coreboot.org/11736 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/vgabios/Makefile | 52 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) (limited to 'util/vgabios/Makefile') diff --git a/util/vgabios/Makefile b/util/vgabios/Makefile index 366606ced4..520779c142 100644 --- a/util/vgabios/Makefile +++ b/util/vgabios/Makefile @@ -6,35 +6,57 @@ # /usr/lib/... # -CC = gcc -CFLAGS = -O2 -g -fomit-frame-pointer +TOP ?= ../.. + +CC ?= gcc +CFLAGS ?= -O2 -g -fomit-frame-pointer + CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -CFLAGS += -Wstrict-aliasing -Wshadow -Wextra +CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra + +# TODO check host architecture +CBCFLAGS = -DCONFIG_ARCH_X86=1 -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-parameter -INCLUDES = -Iinclude -I../../src/device/oprom/include/ -I../../src --include include/stdtypes.h +INCLUDES = -Iinclude -I$(TOP)/src/device/oprom/include/ +CBINCLUDES = -I$(TOP)/src --include include/stdtypes.h +CBINCLUDES += --include $(TOP)/src/commonlib/include/commonlib/loglevel.h +CBINCLUDES += -include stdio.h -INTOBJS = int10.o int15.o int16.o int1a.o inte6.o -X86EMUOBJS = sys.o decode.o ops.o ops2.o prim_ops.o fpu.o debug.o -OBJS = testbios.o helper_exec.o helper_mem.o $(INTOBJS) $(X86EMUOBJS) +SOURCE = int10.c int15.c int16.c int1a.c inte6.c testbios.c +SOURCE += helper_exec.c helper_mem.c pci-userspace.c -# user space pci is the only option right now. -OBJS += pci-userspace.o +X86EMU = sys.c decode.c ops.c ops2.c prim_ops.c fpu.c debug.c +X86EMU_DIR = $(TOP)/src/device/oprom/x86emu +X86EMU_SOURCE = $(addprefix $(X86EMU_DIR)/, $(X86EMU)) +OBJECTS:=$(SOURCE:.c=.o) $(X86EMU:.c=.o) LIBS=-lpci -all: testbios +all: dep testbios -testbios: $(OBJS) +testbios: $(OBJECTS) + printf " LINK $(notdir $@)\n" $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -helper_exec.o: helper_exec.c test.h +dep: $(SOURCE) $(X86EMU_SOURCE) Makefile + $(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCE) > .dependencies + $(CC) $(CFLAGS) $(INCLUDES) $(CBCFLAGS) $(CBINCLUDES) -MM $(X86EMU_SOURCE) >> .dependencies clean: rm -f *.o *~ testbios -%.o: ../../src/device/oprom/x86emu/%.c - $(CC) $(CFLAGS) $(INCLUDES) -include stdio.h -c -o $@ $^ +distclean: clean + rm -f .dependencies + +%.o: $(X86EMU_DIR)/%.c + printf " CC (x86emu) $(notdir $<)\n" + $(CC) $(CFLAGS) $(CBCFLAGS) $(INCLUDES) $(CBINCLUDES) -c -o $@ $< %.o: %.c + printf " CC $(notdir $<)\n" $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< + +.PHONY: all clean distclean +.SILENT: + +-include .dependencies -- cgit v1.2.3