X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/39b65c2e315ad5565e22b98ea2a4498ec2edfad2..a456d59c20fb959c431069cee0f94d5b4628a198:/Makefile.target diff --git a/Makefile.target b/Makefile.target index c0af5ecb31..b66b699243 100644 --- a/Makefile.target +++ b/Makefile.target @@ -27,7 +27,6 @@ VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H #CFLAGS+=-Werror LIBS= -DYNGEN=../dyngen$(EXESUF) # user emulator name ifndef TARGET_ARCH2 TARGET_ARCH2=$(TARGET_ARCH) @@ -74,7 +73,7 @@ PROGS=$(QEMU_PROG) # We require -O2 to avoid the stack setup prologue in EXIT_TB OP_CFLAGS := -O2 -g -fno-strict-aliasing -OP_CFLAGS += -Wall -Wundef -Wendif-labels -Wwrite-strings +OP_CFLAGS += -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls # cc-option # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) @@ -97,12 +96,6 @@ HELPER_CFLAGS= ifeq ($(ARCH),i386) HELPER_CFLAGS+=-fomit-frame-pointer OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer -# op.c and helper.c need this on 32-bit x86 system to avoid -# a compiler spill error. This can probably go away -# once the SSE ops have been converted to TCG -ifeq ($(HAVE_GT_GCC_3_3), true) -I386_CFLAGS=-march=i586 -mtune=i686 -endif endif ifeq ($(ARCH),ppc) @@ -183,18 +176,17 @@ CFLAGS+=-I/opt/SUNWspro/prod/include/cc endif endif +kvm.o: CFLAGS+=$(KVM_CFLAGS) +kvm-all.o: CFLAGS+=$(KVM_CFLAGS) + all: $(PROGS) ######################################################### # cpu emulator library LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\ translate.o host-utils.o -ifdef CONFIG_DYNGEN_OP -exec.o: dyngen-opc.h -LIBOBJS+=op.o -endif # TCG code generator -LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o +LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH) ifeq ($(ARCH),sparc64) CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc @@ -264,35 +256,15 @@ endif # libqemu -ifdef CONFIG_DYNGEN_OP -OPC_H = gen-op.h dyngen-opc.h op.h -endif - libqemu.a: $(LIBOBJS) rm -f $@ $(AR) rcs $@ $(LIBOBJS) -translate.o: translate.c cpu.h $(OPC_H) - -translate-all.o: translate-all.c cpu.h $(OPC_H) - -tcg/tcg.o: cpu.h $(OPC_H) - -tcg/tcg-dyngen.o: $(OPC_H) +translate.o: translate.c cpu.h -tcg/tcg-runtime.o: $(OPC_H) +translate-all.o: translate-all.c cpu.h -op.h: op.o $(DYNGEN) - $(DYNGEN) -o $@ $< - -dyngen-opc.h: op.o $(DYNGEN) - $(DYNGEN) -c -o $@ $< - -gen-op.h: op.o $(DYNGEN) - $(DYNGEN) -g -o $@ $< - -op.o: op.c - $(CC) $(OP_CFLAGS) $(CPPFLAGS) $(I386_CFLAGS) -c -o $@ $< +tcg/tcg.o: cpu.h machine.o: machine.c $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< @@ -302,7 +274,7 @@ machine.o: machine.c op_helper.o: op_helper.c $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $< -cpu-exec.o: cpu-exec.c $(OPC_H) +cpu-exec.o: cpu-exec.c $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ######################################################### @@ -394,6 +366,12 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld endif endif +# profiling code +ifdef TARGET_GPROF +LDFLAGS+=-p +CFLAGS+=-p +endif + OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \ elfload.o linuxload.o uaccess.o LIBS+= $(AIOLIBS) @@ -469,15 +447,129 @@ $(QEMU_PROG): $(OBJS) endif #CONFIG_DARWIN_USER +######################################################### +# BSD user emulator target + +ifdef CONFIG_BSD_USER + +VPATH+=:$(SRC_PATH)/bsd-user +CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) + +ifdef CONFIG_STATIC +LDFLAGS+=-static +endif + +ifeq ($(ARCH),i386) +ifdef TARGET_GPROF +USE_I386_LD=y +endif +ifdef CONFIG_STATIC +USE_I386_LD=y +endif +ifdef USE_I386_LD +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +else +# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object +# that the kernel ELF loader considers as an executable. I think this +# is the simplest way to make it self virtualizable! +LDFLAGS+=-Wl,-shared +endif +endif + +ifeq ($(ARCH),x86_64) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),ppc) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),ppc64) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),s390) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),sparc) +# -static is used to avoid g1/g3 usage by the dynamic linker +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static +endif + +ifeq ($(ARCH),sparc64) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),alpha) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),ia64) +LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),arm) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),m68k) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +endif + +ifeq ($(ARCH),mips) +ifeq ($(WORDS_BIGENDIAN),yes) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +else +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld +endif +endif + +ifeq ($(ARCH),mips64) +ifeq ($(WORDS_BIGENDIAN),yes) +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld +else +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld +endif +endif + +OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o +OBJS+= uaccess.o + +OBJS+= libqemu.a + +ifdef CONFIG_GDBSTUB +OBJS+=gdbstub.o +endif + +# Note: this is a workaround. The real fix is to avoid compiling +# cpu_signal_handler() in cpu-exec.c. +signal.o: signal.c + $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + +$(QEMU_PROG): $(OBJS) ../libqemu_user.a + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + +endif #CONFIG_BSD_USER + ######################################################### # System emulator target ifndef CONFIG_USER_ONLY -OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o -OBJS+=fw_cfg.o aio.o buffered_file.o +OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o +# virtio has to be here due to weird dependency between PCI and virtio-net. +# need to fix this properly +OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o +OBJS+=fw_cfg.o +ifdef CONFIG_KVM +OBJS+=kvm.o kvm-all.o +endif ifdef CONFIG_WIN32 OBJS+=block-raw-win32.o else +ifdef CONFIG_AIO +OBJS+=posix-aio-compat.o +endif OBJS+=block-raw-posix.o endif @@ -507,6 +599,7 @@ SOUND_HW += ac97.o endif ifdef CONFIG_ADLIB SOUND_HW += fmopl.o adlib.o +adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0 endif ifdef CONFIG_GUS SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o @@ -545,7 +638,7 @@ ifeq ($(TARGET_BASE_ARCH), i386) OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o -OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o +OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE endif ifeq ($(TARGET_BASE_ARCH), ppc) @@ -562,7 +655,15 @@ OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o # NewWorld PowerMac OBJS+= unin_pci.o ppc_chrp.o # PowerPC 4xx boards -OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o +OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o +OBJS+= ppc440.o ppc440_bamboo.o +ifdef FDT_LIBS +OBJS+= device_tree.o +LIBS+= $(FDT_LIBS) +endif +ifdef CONFIG_KVM +OBJS+= kvm_ppc.o +endif endif ifeq ($(TARGET_BASE_ARCH), mips) OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o @@ -610,7 +711,7 @@ OBJS+= pflash_cfi01.o gumstix.o OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o OBJS+= omap2.o omap_dss.o soc_dma.o -OBJS+= palm.o tsc210x.o +OBJS+= omap_sx1.o palm.o tsc210x.o OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o OBJS+= tsc2005.o bt-hci-csr.o OBJS+= mst_fpga.o mainstone.o @@ -619,7 +720,8 @@ CPPFLAGS += -DHAS_AUDIO endif ifeq ($(TARGET_BASE_ARCH), sh4) OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o -OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o +OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o +OBJS+= ide.o endif ifeq ($(TARGET_BASE_ARCH), m68k) OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o @@ -646,10 +748,12 @@ endif ifndef CONFIG_DARWIN ifndef CONFIG_WIN32 ifndef CONFIG_SOLARIS +ifndef CONFIG_AIX LIBS+=-lutil endif endif endif +endif ifdef TARGET_GPROF vl.o: CFLAGS+=-p LDFLAGS+=-p @@ -689,7 +793,7 @@ endif $(CC) $(CPPFLAGS) -c -o $@ $< clean: - rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o + rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o rm -f *.d */*.d tcg/*.o install: all