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
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
35 SOURCE
+= pci-userspace.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
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
))
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)
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
83 rm -f
$(OBJECTS
) *~ testbios
89 $(OUT
)/%.o
: $(X86EMU_DIR
)/%.c
90 printf
" CC (x86emu) $(notdir $<)\n"
92 $(CC
) $(CFLAGS
) $(CBCFLAGS
) $(INCLUDES
) $(CBINCLUDES
) -c
-o
$@
$<
95 printf
" CC $(notdir $<)\n"
97 $(CC
) $(CFLAGS
) $(INCLUDES
) -c
-o
$@
$<
99 .PHONY
: all includes
clean distclean
102 -include .dependencies