summaryrefslogtreecommitdiff
path: root/util/vgabios/Makefile
blob: 520779c1424378c3da68174359a85b68f36976b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# NOTE: You need to add your libpci.a version to CFLAGS below if
# pci-userspace.c does not build.
#
# If you are building on AMD64, you have to use /usr/lib64/libpci.a instead of
# /usr/lib/...
#

TOP     ?= ../..

CC      ?=  gcc
CFLAGS  ?= -O2 -g -fomit-frame-pointer

CFLAGS  += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
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$(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

SOURCE  = int10.c int15.c int16.c int1a.c inte6.c testbios.c
SOURCE += helper_exec.c helper_mem.c pci-userspace.c

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: dep testbios

testbios: $(OBJECTS)
	printf "    LINK  $(notdir $@)\n"
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

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

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