Annotation of qemu/Makefile.target, revision 1.1.1.1

1.1       root        1: include config.mak
                      2: 
                      3: TARGET_BASE_ARCH:=$(TARGET_ARCH)
                      4: ifeq ($(TARGET_ARCH), x86_64)
                      5: TARGET_BASE_ARCH:=i386
                      6: endif
                      7: ifeq ($(TARGET_ARCH), ppc64)
                      8: TARGET_BASE_ARCH:=ppc
                      9: endif
                     10: ifeq ($(TARGET_ARCH), sparc64)
                     11: TARGET_BASE_ARCH:=sparc
                     12: endif
                     13: TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
                     14: VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
                     15: DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
                     16: ifdef CONFIG_USER_ONLY
                     17: VPATH+=:$(SRC_PATH)/linux-user
                     18: DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
                     19: endif
                     20: CFLAGS=-Wall -O2 -g -fno-strict-aliasing
                     21: #CFLAGS+=-Werror
                     22: LDFLAGS=-g
                     23: LIBS=
                     24: HELPER_CFLAGS=$(CFLAGS)
                     25: DYNGEN=../dyngen$(EXESUF)
                     26: # user emulator name
                     27: ifeq ($(TARGET_ARCH),arm)
                     28:   ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
                     29:     QEMU_USER=qemu-armeb
                     30:   else
                     31:     QEMU_USER=qemu-arm
                     32:   endif
                     33: else
                     34:   QEMU_USER=qemu-$(TARGET_ARCH)
                     35: endif
                     36: # system emulator name
                     37: ifdef CONFIG_SOFTMMU
                     38: ifeq ($(TARGET_ARCH), i386)
                     39: QEMU_SYSTEM=qemu$(EXESUF)
                     40: else
                     41: QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF)
                     42: endif
                     43: else
                     44: QEMU_SYSTEM=qemu-fast
                     45: endif
                     46: 
                     47: ifdef CONFIG_USER_ONLY
                     48: PROGS=$(QEMU_USER)
                     49: else
                     50: PROGS+=$(QEMU_SYSTEM)
                     51: ifndef CONFIG_SOFTMMU
                     52: CONFIG_STATIC=y
                     53: endif
                     54: endif # !CONFIG_USER_ONLY
                     55: 
                     56: ifdef CONFIG_STATIC
                     57: LDFLAGS+=-static
                     58: endif
                     59: 
                     60: ifeq ($(ARCH),i386)
                     61: CFLAGS+=-fomit-frame-pointer
                     62: OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
                     63: ifeq ($(HAVE_GCC3_OPTIONS),yes)
                     64: OP_CFLAGS+= -falign-functions=0 -fno-gcse
                     65: else
                     66: OP_CFLAGS+= -malign-functions=0
                     67: endif
                     68: 
                     69: ifdef TARGET_GPROF
                     70: USE_I386_LD=y
                     71: endif
                     72: ifdef CONFIG_STATIC
                     73: USE_I386_LD=y
                     74: endif
                     75: ifdef USE_I386_LD
                     76: LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld
                     77: else
                     78: # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
                     79: # that the kernel ELF loader considers as an executable. I think this
                     80: # is the simplest way to make it self virtualizable!
                     81: LDFLAGS+=-Wl,-shared
                     82: endif
                     83: endif
                     84: 
                     85: ifeq ($(ARCH),x86_64)
                     86: OP_CFLAGS=$(CFLAGS) -falign-functions=0
                     87: LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
                     88: endif
                     89: 
                     90: ifeq ($(ARCH),ppc)
                     91: CFLAGS+= -D__powerpc__
                     92: OP_CFLAGS=$(CFLAGS)
                     93: LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
                     94: endif
                     95: 
                     96: ifeq ($(ARCH),s390)
                     97: OP_CFLAGS=$(CFLAGS)
                     98: LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld
                     99: endif
                    100: 
                    101: ifeq ($(ARCH),sparc)
                    102: CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
                    103: LDFLAGS+=-m32
                    104: OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
                    105: HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
                    106: # -static is used to avoid g1/g3 usage by the dynamic linker
                    107: LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
                    108: endif
                    109: 
                    110: ifeq ($(ARCH),sparc64)
                    111: CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
                    112: LDFLAGS+=-m64
                    113: OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
                    114: endif
                    115: 
                    116: ifeq ($(ARCH),alpha)
                    117: # -msmall-data is not used because we want two-instruction relocations
                    118: # for the constant constructions
                    119: OP_CFLAGS=-Wall -O2 -g
                    120: # Ensure there's only a single GP
                    121: CFLAGS += -msmall-data
                    122: LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld
                    123: endif
                    124: 
                    125: ifeq ($(ARCH),ia64)
                    126: CFLAGS += -mno-sdata
                    127: OP_CFLAGS=$(CFLAGS)
                    128: LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
                    129: endif
                    130: 
                    131: ifeq ($(ARCH),arm)
                    132: OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer
                    133: LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
                    134: endif
                    135: 
                    136: ifeq ($(ARCH),m68k)
                    137: OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
                    138: LDFLAGS+=-Wl,-T,m68k.ld
                    139: endif
                    140: 
                    141: ifeq ($(HAVE_GCC3_OPTIONS),yes)
                    142: # very important to generate a return at the end of every operation
                    143: OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
                    144: endif
                    145: 
                    146: ifeq ($(CONFIG_DARWIN),yes)
                    147: OP_CFLAGS+= -mdynamic-no-pic
                    148: LIBS+=-lmx
                    149: endif
                    150: 
                    151: #########################################################
                    152: 
                    153: DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
                    154: LIBS+=-lm
                    155: ifndef CONFIG_USER_ONLY
                    156: LIBS+=-lz
                    157: endif
                    158: ifdef CONFIG_WIN32
                    159: LIBS+=-lwinmm -lws2_32 -liphlpapi
                    160: endif
                    161: 
                    162: # profiling code
                    163: ifdef TARGET_GPROF
                    164: LDFLAGS+=-p
                    165: main.o: CFLAGS+=-p
                    166: endif
                    167: 
                    168: OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o 
                    169: ifeq ($(TARGET_ARCH), i386)
                    170: OBJS+= vm86.o
                    171: endif
                    172: ifeq ($(TARGET_ARCH), arm)
                    173: OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
                    174: nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
                    175:  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
                    176: endif
                    177: SRCS:= $(OBJS:.o=.c)
                    178: OBJS+= libqemu.a
                    179: 
                    180: # cpu emulator library
                    181: LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
                    182:         translate.o op.o 
                    183: ifdef CONFIG_SOFTFLOAT
                    184: LIBOBJS+=fpu/softfloat.o
                    185: else
                    186: LIBOBJS+=fpu/softfloat-native.o
                    187: endif
                    188: DEFINES+=-I$(SRC_PATH)/fpu
                    189: 
                    190: ifeq ($(TARGET_ARCH), i386)
                    191: LIBOBJS+=helper.o helper2.o
                    192: ifeq ($(ARCH), i386)
                    193: LIBOBJS+=translate-copy.o
                    194: endif
                    195: endif
                    196: 
                    197: ifeq ($(TARGET_ARCH), x86_64)
                    198: LIBOBJS+=helper.o helper2.o
                    199: endif
                    200: 
                    201: ifeq ($(TARGET_BASE_ARCH), ppc)
                    202: LIBOBJS+= op_helper.o helper.o
                    203: endif
                    204: 
                    205: ifeq ($(TARGET_ARCH), mips)
                    206: LIBOBJS+= op_helper.o helper.o
                    207: endif
                    208: 
                    209: ifeq ($(TARGET_BASE_ARCH), sparc)
                    210: LIBOBJS+= op_helper.o helper.o
                    211: endif
                    212: 
                    213: ifeq ($(TARGET_BASE_ARCH), arm)
                    214: LIBOBJS+= op_helper.o
                    215: endif
                    216: 
                    217: # NOTE: the disassembler code is only needed for debugging
                    218: LIBOBJS+=disas.o 
                    219: ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
                    220: USE_I386_DIS=y
                    221: endif
                    222: ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
                    223: USE_I386_DIS=y
                    224: endif
                    225: ifdef USE_I386_DIS
                    226: LIBOBJS+=i386-dis.o
                    227: endif
                    228: ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
                    229: LIBOBJS+=alpha-dis.o
                    230: endif
                    231: ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
                    232: LIBOBJS+=ppc-dis.o
                    233: endif
                    234: ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips)
                    235: LIBOBJS+=mips-dis.o
                    236: endif
                    237: ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
                    238: LIBOBJS+=sparc-dis.o
                    239: endif
                    240: ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
                    241: LIBOBJS+=arm-dis.o
                    242: endif
                    243: 
                    244: ifeq ($(ARCH),ia64)
                    245: OBJS += ia64-syscall.o
                    246: endif
                    247: ifdef CONFIG_GDBSTUB
                    248: OBJS+=gdbstub.o
                    249: endif
                    250: 
                    251: all: $(PROGS)
                    252: 
                    253: $(QEMU_USER): $(OBJS)
                    254:        $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
                    255: ifeq ($(ARCH),alpha)
                    256: # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
                    257: # the address space (31 bit so sign extending doesn't matter)
                    258:        echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
                    259: endif
                    260: 
                    261: # must use static linking to avoid leaving stuff in virtual address space
                    262: VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o
                    263: VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
                    264: 
                    265: SOUND_HW = sb16.o
                    266: AUDIODRV = audio.o noaudio.o wavaudio.o
                    267: ifdef CONFIG_SDL
                    268: AUDIODRV += sdlaudio.o
                    269: endif
                    270: ifdef CONFIG_OSS
                    271: AUDIODRV += ossaudio.o
                    272: endif
                    273: 
                    274: pc.o: DEFINES := -DUSE_SB16 $(DEFINES)
                    275: 
                    276: ifdef CONFIG_ADLIB
                    277: SOUND_HW += fmopl.o adlib.o
                    278: endif
                    279: 
                    280: ifdef CONFIG_FMOD
                    281: AUDIODRV += fmodaudio.o
                    282: audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
                    283: LIBS += $(CONFIG_FMOD_LIB)
                    284: endif
                    285: 
                    286: ifeq ($(TARGET_BASE_ARCH), i386)
                    287: # Hardware support
                    288: VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
                    289: VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
                    290: VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o
                    291: endif
                    292: ifeq ($(TARGET_BASE_ARCH), ppc)
                    293: VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
                    294: VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
                    295: VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
                    296: endif
                    297: ifeq ($(TARGET_ARCH), mips)
                    298: VL_OBJS+= mips_r4k.o dma.o vga.o serial.o ne2000.o i8254.o i8259.o
                    299: #VL_OBJS+= #ide.o pckbd.o fdc.o m48t59.o
                    300: endif
                    301: ifeq ($(TARGET_BASE_ARCH), sparc)
                    302: ifeq ($(TARGET_ARCH), sparc64)
                    303: VL_OBJS+= sun4u.o ide.o ne2000.o pckbd.o vga.o
                    304: VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
                    305: VL_OBJS+= cirrus_vga.o parallel.o
                    306: VL_OBJS+= magic-load.o
                    307: else
                    308: VL_OBJS+= sun4m.o tcx.o lance.o iommu.o m48t08.o magic-load.o slavio_intctl.o slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o
                    309: endif
                    310: endif
                    311: ifdef CONFIG_GDBSTUB
                    312: VL_OBJS+=gdbstub.o 
                    313: endif
                    314: ifdef CONFIG_SDL
                    315: VL_OBJS+=sdl.o
                    316: endif
                    317: ifdef CONFIG_COCOA
                    318: VL_OBJS+=cocoa.o
                    319: COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa
                    320: endif
                    321: ifdef CONFIG_SLIRP
                    322: DEFINES+=-I$(SRC_PATH)/slirp
                    323: SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
                    324: slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
                    325: tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
                    326: VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
                    327: endif
                    328: 
                    329: VL_LDFLAGS=
                    330: # specific flags are needed for non soft mmu emulator
                    331: ifdef CONFIG_STATIC
                    332: VL_LDFLAGS+=-static
                    333: endif
                    334: ifndef CONFIG_SOFTMMU
                    335: VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld 
                    336: endif
                    337: ifndef CONFIG_DARWIN
                    338: ifndef CONFIG_WIN32
                    339: VL_LIBS=-lutil
                    340: endif
                    341: endif
                    342: ifdef TARGET_GPROF
                    343: vl.o: CFLAGS+=-p
                    344: VL_LDFLAGS+=-p
                    345: endif
                    346: 
                    347: ifeq ($(ARCH),ia64)
                    348: VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
                    349: endif
                    350: 
                    351: $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
                    352:        $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
                    353: 
                    354: cocoa.o: cocoa.m
                    355:        $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
                    356: 
                    357: sdl.o: sdl.c keymaps.c sdl_keysym.h
                    358:        $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
                    359: 
                    360: sdlaudio.o: sdlaudio.c
                    361:        $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
                    362: 
                    363: depend: $(SRCS)
                    364:        $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
                    365: 
                    366: # libqemu 
                    367: 
                    368: libqemu.a: $(LIBOBJS)
                    369:        rm -f $@
                    370:        $(AR) rcs $@ $(LIBOBJS)
                    371: 
                    372: translate.o: translate.c gen-op.h opc.h cpu.h
                    373: 
                    374: translate-all.o: translate-all.c opc.h cpu.h
                    375: 
                    376: translate-op.o: translate-all.c op.h opc.h cpu.h
                    377: 
                    378: op.h: op.o $(DYNGEN)
                    379:        $(DYNGEN) -o $@ $<
                    380: 
                    381: opc.h: op.o $(DYNGEN)
                    382:        $(DYNGEN) -c -o $@ $<
                    383: 
                    384: gen-op.h: op.o $(DYNGEN)
                    385:        $(DYNGEN) -g -o $@ $<
                    386: 
                    387: op.o: op.c
                    388:        $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
                    389: 
                    390: helper.o: helper.c
                    391:        $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
                    392: 
                    393: ifeq ($(TARGET_BASE_ARCH), i386)
                    394: op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
                    395: endif
                    396: 
                    397: ifeq ($(TARGET_ARCH), arm)
                    398: op.o: op.c op_template.h
                    399: endif
                    400: 
                    401: ifeq ($(TARGET_BASE_ARCH), sparc)
                    402: op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h
                    403: magic_load.o: elf_op.h
                    404: endif
                    405: 
                    406: ifeq ($(TARGET_BASE_ARCH), ppc)
                    407: op.o: op.c op_template.h op_mem.h
                    408: op_helper.o: op_helper_mem.h
                    409: translate.o: translate.c translate_init.c
                    410: endif
                    411: 
                    412: ifeq ($(TARGET_ARCH), mips)
                    413: op.o: op.c op_template.c op_mem.c
                    414: op_helper.o: op_helper_mem.c
                    415: endif
                    416: 
                    417: mixeng.o: mixeng.c mixeng.h mixeng_template.h
                    418: 
                    419: %.o: %.c
                    420:        $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
                    421: 
                    422: %.o: %.S
                    423:        $(CC) $(DEFINES) -c -o $@ $<
                    424: 
                    425: clean:
                    426:        rm -f *.o  *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
                    427: 
                    428: install: all 
                    429: ifneq ($(PROGS),)
                    430:        install -m 755 -s $(PROGS) "$(bindir)"
                    431: endif
                    432: 
                    433: ifneq ($(wildcard .depend),)
                    434: include .depend
                    435: endif

unix.superglobalmegacorp.com