Revision 4fb240a4 Makefile

b/Makefile
11 11
BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
12 12
BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
13 13

  
14
CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
14
CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
15
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
16
CPPFLAGS += -DQEMU_TOOL
15 17
LIBS=
16 18
ifdef CONFIG_STATIC
17 19
BASE_LDFLAGS += -static
......
24 26

  
25 27
LIBS+=$(AIOLIBS)
26 28

  
27
all: $(TOOLS) $(DOCS) recurse-all
29
all: libqemu_common.a $(TOOLS) $(DOCS) recurse-all 
28 30

  
29 31
subdir-%: dyngen$(EXESUF)
30 32
	$(MAKE) -C $(subst subdir-,,$@) all
31 33

  
32 34
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
33 35

  
34
qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c block-parallels.c
35
	$(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
36
######################################################################
37
# libqemu_common.a: target indepedent part of system emulation. The
38
# long term path is to suppress *all* target specific code in case of
39
# system emulation, i.e. a single QEMU executable should support all
40
# CPUs and machines.
36 41

  
42
OBJS+=cutils.o readline.o console.o 
43
#OBJS+=block.o block-raw.o
44
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 block-qcow2.o block-parallels.o
45

  
46
ifdef CONFIG_WIN32
47
OBJS+=tap-win32.o
48
endif
49

  
50
AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
51
ifdef CONFIG_SDL
52
AUDIO_OBJS += sdlaudio.o
53
endif
54
ifdef CONFIG_OSS
55
AUDIO_OBJS += ossaudio.o
56
endif
57
ifdef CONFIG_COREAUDIO
58
AUDIO_OBJS += coreaudio.o
59
endif
60
ifdef CONFIG_ALSA
61
AUDIO_OBJS += alsaaudio.o
62
endif
63
ifdef CONFIG_DSOUND
64
AUDIO_OBJS += dsoundaudio.o
65
endif
66
ifdef CONFIG_FMOD
67
AUDIO_OBJS += fmodaudio.o
68
audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
69
endif
70
AUDIO_OBJS+= wavcapture.o
71
OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
72

  
73
ifdef CONFIG_SDL
74
OBJS+=sdl.o x_keymap.o
75
endif
76
OBJS+=vnc.o d3des.o
77

  
78
ifdef CONFIG_COCOA
79
OBJS+=cocoa.o
80
endif
81

  
82
ifdef CONFIG_SLIRP
83
CPPFLAGS+=-I$(SRC_PATH)/slirp
84
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
85
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
86
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
87
OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
88
endif
89

  
90
cocoa.o: cocoa.m
91
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
92

  
93
sdl.o: sdl.c keymaps.c sdl_keysym.h
94
	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
95

  
96
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
97
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
98

  
99
audio/sdlaudio.o: audio/sdlaudio.c
100
	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
101

  
102
libqemu_common.a: $(OBJS)
103
	rm -f $@ 
104
	$(AR) rcs $@ $(OBJS)
105

  
106
######################################################################
107

  
108
qemu-img$(EXESUF): qemu-img.o block.o block-raw.o libqemu_common.a
109
	$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
110

  
111
%.o: %.c
112
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
113

  
114
# dyngen host tool
37 115
dyngen$(EXESUF): dyngen.c
38 116
	$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
39 117

  
40 118
clean:
41 119
# avoid old build problems by removing potentially incorrect old files
42 120
	rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
43
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
121
	rm -f *.o *.d *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
122
	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
44 123
	$(MAKE) -C tests clean
45 124
	for d in $(TARGET_DIRS); do \
46 125
	$(MAKE) -C $$d $@ || exit 1 ; \
......
180 259
ifneq ($(wildcard .depend),)
181 260
include .depend
182 261
endif
262

  
263
# Include automatically generated dependency files
264
-include $(wildcard *.d audio/*.d slirp/*.d)

Also available in: Unified diff