ec/google/chromeec: Define ACPI_NOTIFY_CROS_EC_MKBP constant
[coreboot2.git] / util / vgabios / Makefile
blob1baf5ba3874bbfbe3027672f0972fb8ed394691b
1 ##
2 ## SPDX-License-Identifier: GPL-2.0-only
4 # NOTE: You need to add your libpci.a version to CFLAGS below if
5 # pci-userspace.c does not build.
7 # If you are building on AMD64, you have to use /usr/lib64/libpci.a instead of
8 # /usr/lib/...
11 TOP ?= ../..
12 OUT ?= build
14 CC ?= gcc
15 CFLAGS ?= -O2 -g -fomit-frame-pointer
17 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
18 CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra
19 CFLAGS += -Wno-unused-but-set-variable
21 # TODO check host architecture
22 CBCFLAGS = -Wno-sign-compare -Wno-unused-parameter -Wno-format
24 INCLUDES = -Iinclude -I$(OUT)/include
25 INCLUDES += -I$(TOP)/src/device/oprom/include/
26 INCLUDES += -I$(TOP)/src/device/oprom/yabel
27 INCLUDES += -include $(TOP)/src/commonlib/include/commonlib/loglevel.h
28 INCLUDES += -include stdtypes.h -include pci-userspace.h
29 INCLUDES += -include $(TOP)/src/include/kconfig.h
31 CBINCLUDES = -I$(TOP)/src -include include/stdtypes.h -include $(TOP)/src/include/endian.h
32 CBINCLUDES += -include stdio.h -include sys/io.h
34 SOURCE = testbios.c
35 SOURCE += pci-userspace.c
36 SOURCE += device.c
38 X86EMU = x86emu/sys.c x86emu/decode.c x86emu/ops.c x86emu/ops2.c
39 X86EMU += x86emu/prim_ops.c x86emu/fpu.c x86emu/debug.c
41 X86EMU += yabel/interrupt.c
42 X86EMU += yabel/mem.c
43 X86EMU += yabel/io.c
44 X86EMU += yabel/pmm.c
45 X86EMU += yabel/biosemu.c
46 X86EMU += yabel/debug.c
47 #X86EMU += yabel/device.c # For now we need a local copy :-(
51 X86EMU_DIR = $(TOP)/src/device/oprom
52 X86EMU_SOURCE = $(addprefix $(X86EMU_DIR)/, $(X86EMU))
53 OBJECTS:=$(addprefix $(OUT)/,$(SOURCE:.c=.o)) $(addprefix $(OUT)/, $(X86EMU:.c=.o))
55 LIBS=-lpci
57 all: dep testbios
59 $(OBJECTS): includes
61 testbios: $(OBJECTS)
62 printf " LINK $(notdir $@)\n"
63 $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
65 dep: $(SOURCE) $(X86EMU_SOURCE) Makefile
66 $(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCE) > .dependencies
67 $(CC) $(CFLAGS) $(INCLUDES) $(CBCFLAGS) $(CBINCLUDES) -MM $(X86EMU_SOURCE) >> .dependencies
69 # Make all the dummy include files (that are in reality
70 # covered by all the -include statements above)
71 includes:
72 mkdir -p $(OUT)/include/device
73 mkdir -p $(OUT)/include/arch
74 touch $(OUT)/include/device/device.h
75 touch $(OUT)/include/device/pci.h
76 touch $(OUT)/include/device/pci_ops.h
77 touch $(OUT)/include/device/resource.h
78 touch $(OUT)/include/arch/io.h
79 touch $(OUT)/include/timer.h
80 touch $(OUT)/include/types.h
82 clean:
83 rm -f $(OBJECTS) *~ testbios
84 rm -rf $(OUT)
86 distclean: clean
87 rm -f .dependencies
89 $(OUT)/%.o: $(X86EMU_DIR)/%.c
90 printf " CC (x86emu) $(notdir $<)\n"
91 mkdir -p $(dir $@)
92 $(CC) $(CFLAGS) $(CBCFLAGS) $(INCLUDES) $(CBINCLUDES) -c -o $@ $<
94 $(OUT)/%.o: %.c
95 printf " CC $(notdir $<)\n"
96 mkdir -p $(dir $@)
97 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
99 .PHONY: all includes clean distclean
100 .SILENT:
102 -include .dependencies