aboutsummaryrefslogtreecommitdiff
path: root/util/vgabios/Makefile
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2015-09-28 13:12:04 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-10-25 21:33:32 +0100
commit850e7d48845ed78bc50f9d0d8caae8132d2ba38d (patch)
tree0ae333e7192debc5a8166d0dcd595969546f9a3b /util/vgabios/Makefile
parent3acece23621eb27abcce34a212344a12d80de500 (diff)
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 <stefan.reinauer@coreboot.org> Change-Id: If3e4399b1b0e947433b97caa29962ef66ea2993d Reviewed-on: http://review.coreboot.org/11736 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/vgabios/Makefile')
-rw-r--r--util/vgabios/Makefile52
1 files changed, 37 insertions, 15 deletions
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