From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPhZI-0001id-0u for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:12:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPhZH-0001hc-AC for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:12:47 -0500 Received: from [199.232.76.173] (port=38363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPhZH-0001hP-6b for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:12:47 -0500 Received: from savannah.gnu.org ([199.232.41.3]:55782 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LPhZG-0003L2-RJ for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:12:47 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LPhZF-0002k7-Bd for qemu-devel@nongnu.org; Wed, 21 Jan 2009 18:12:45 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LPhZF-0002k2-65 for qemu-devel@nongnu.org; Wed, 21 Jan 2009 18:12:45 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 21 Jan 2009 18:12:45 +0000 Subject: [Qemu-devel] [6377] Consolidate compiler invocations (Avi Kivity) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6377 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6377 Author: aliguori Date: 2009-01-21 18:12:44 +0000 (Wed, 21 Jan 2009) Log Message: ----------- Consolidate compiler invocations (Avi Kivity) Instead of specifying the compilation command over and over, use a single rule and adjust it as necessary using target specific target overrides. Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/Makefile trunk/Makefile.target Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2009-01-21 18:12:27 UTC (rev 6376) +++ trunk/Makefile 2009-01-21 18:12:44 UTC (rev 6377) @@ -158,23 +158,19 @@ LIBS+=$(VDE_LIBS) cocoa.o: cocoa.m - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< sdl.o: sdl.c keymaps.c sdl_keysym.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $< +sdl.o audio/sdlaudio.o: CFLAGS += $(SDL_CFLAGS) + vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $< +vnc.o: CFLAGS += $(CONFIG_VNC_TLS_CFLAGS) + curses.o: curses.c keymaps.c curses_keys.h - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< -bt-host.o: bt-host.c - $(CC) $(CFLAGS) $(CPPFLAGS) $(CONFIG_BLUEZ_CFLAGS) -c -o $@ $< +bt-host.o: CFLAGS += $(CONFIG_BLUEZ_CFLAGS) -audio/sdlaudio.o: audio/sdlaudio.c - $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $< - libqemu_common.a: $(OBJS) rm -f $@ $(AR) rcs $@ $(OBJS) @@ -195,6 +191,9 @@ %.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< +%.o: %.m + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS) $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS) Modified: trunk/Makefile.target =================================================================== --- trunk/Makefile.target 2009-01-21 18:12:27 UTC (rev 6376) +++ trunk/Makefile.target 2009-01-21 18:12:44 UTC (rev 6377) @@ -219,16 +219,11 @@ tcg/tcg.o: cpu.h -machine.o: machine.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< - # HELPER_CFLAGS is used for all the code compiled with static register # variables -op_helper.o: op_helper.c - $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $< +op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS) -cpu-exec.o: cpu-exec.c - $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +cpu-exec.o: CFLAGS += $(HELPER_CFLAGS) ######################################################### # Linux user emulator target @@ -356,8 +351,7 @@ # 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 $@ $< +signal.o: CFLAGS += $(HELPER_CFLAGS) $(QEMU_PROG): $(OBJS) ../libqemu_user.a $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) @@ -392,8 +386,7 @@ # 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 $@ $< +signal.o: CFLAGS += $(HELPER_CFLAGS) $(QEMU_PROG): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) @@ -497,8 +490,7 @@ # 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 $@ $< +signal.o: CFLAGS += $(HELPER_CFLAGS) $(QEMU_PROG): $(OBJS) ../libqemu_user.a $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)