2005-01-17 12:08:08 +01:00
|
|
|
#
|
|
|
|
# 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/...
|
|
|
|
#
|
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
TOP ?= ../..
|
|
|
|
|
|
|
|
CC ?= gcc
|
|
|
|
CFLAGS ?= -O2 -g -fomit-frame-pointer
|
|
|
|
|
2010-04-16 13:45:16 +02:00
|
|
|
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
2015-09-28 22:12:04 +02:00
|
|
|
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
|
2010-04-16 13:45:16 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
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
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
SOURCE = int10.c int15.c int16.c int1a.c inte6.c testbios.c
|
|
|
|
SOURCE += helper_exec.c helper_mem.c pci-userspace.c
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
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)
|
2010-03-23 16:53:38 +01:00
|
|
|
|
|
|
|
LIBS=-lpci
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
all: dep testbios
|
2004-07-08 19:18:27 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
testbios: $(OBJECTS)
|
|
|
|
printf " LINK $(notdir $@)\n"
|
2010-03-23 16:53:38 +01:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
dep: $(SOURCE) $(X86EMU_SOURCE) Makefile
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCE) > .dependencies
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) $(CBCFLAGS) $(CBINCLUDES) -MM $(X86EMU_SOURCE) >> .dependencies
|
2004-07-08 19:18:27 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *~ testbios
|
|
|
|
|
2015-09-28 22:12:04 +02:00
|
|
|
distclean: clean
|
|
|
|
rm -f .dependencies
|
|
|
|
|
|
|
|
%.o: $(X86EMU_DIR)/%.c
|
|
|
|
printf " CC (x86emu) $(notdir $<)\n"
|
|
|
|
$(CC) $(CFLAGS) $(CBCFLAGS) $(INCLUDES) $(CBINCLUDES) -c -o $@ $<
|
2010-04-16 13:45:16 +02:00
|
|
|
|
|
|
|
%.o: %.c
|
2015-09-28 22:12:04 +02:00
|
|
|
printf " CC $(notdir $<)\n"
|
2010-04-16 13:45:16 +02:00
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
2015-09-28 22:12:04 +02:00
|
|
|
|
|
|
|
.PHONY: all clean distclean
|
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
-include .dependencies
|