#
CC = gcc
-CFLAGS = -Wall -Ix86emu/include -O2 -g
+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
-INTOBJS = int10.o int15.o int16.o int1a.o inte6.o
-OBJECTS = testbios.o helper_exec.o helper_mem.o $(INTOBJS)
+INCLUDES = -Iinclude -I../../src/devices/oprom/include/
-LIBS = x86emu/src/x86emu/libx86emu.a
+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)
# user space pci is the only option right now.
-OBJECTS += pci-userspace.o
+OBJS += pci-userspace.o
+
+LIBS=-lpci
all: testbios
-testbios: $(OBJECTS) $(LIBS)
- $(CC) -o testbios $(OBJECTS) $(LIBS) -lpci
-
-helper_exec.o: helper_exec.c test.h
+testbios: $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
-x86emu/src/x86emu/libx86emu.a:
- $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux
+helper_exec.o: helper_exec.c test.h
clean:
- $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux clean
rm -f *.o *~ testbios
-distclean: clean
- $(MAKE) -C x86emu/src/x86emu/ -f makefile.linux clean
+%.o: ../../src/devices/oprom/x86emu/%.c
+ $(CC) $(CFLAGS) $(INCLUDES) -include stdio.h -c -o $@ $^
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
+