qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6379] Consolidate linker rules (Avi Kivity)
@ 2009-01-21 18:13 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-01-21 18:13 UTC (permalink / raw)
  To: qemu-devel

Revision: 6379
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6379
Author:   aliguori
Date:     2009-01-21 18:13:02 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
Consolidate linker rules (Avi Kivity)

Use generic rules where posssible, and a LINK macro where not.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/Makefile
    trunk/Makefile.target
    trunk/rules.mak

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-01-21 18:12:52 UTC (rev 6378)
+++ trunk/Makefile	2009-01-21 18:13:02 UTC (rev 6379)
@@ -188,11 +188,11 @@
 ######################################################################
 
 qemu-img$(EXESUF): qemu-img.o qemu-tool.o osdep.o $(BLOCK_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
 
 qemu-nbd$(EXESUF):  qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
 
+qemu-img$(EXESUF) qemu-nbd$(EXESUF): LIBS += -lz
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
 	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

Modified: trunk/Makefile.target
===================================================================
--- trunk/Makefile.target	2009-01-21 18:12:52 UTC (rev 6378)
+++ trunk/Makefile.target	2009-01-21 18:13:02 UTC (rev 6379)
@@ -355,7 +355,7 @@
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
-	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
+	$(LINK)
 ifeq ($(ARCH),alpha)
 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
 # the address space (31 bit so sign extending doesn't matter)
@@ -390,7 +390,7 @@
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
 $(QEMU_PROG): $(OBJS)
-	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
+	$(LINK)
 
 endif #CONFIG_DARWIN_USER
 
@@ -494,7 +494,7 @@
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
-	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
+	$(LINK)
 
 endif #CONFIG_BSD_USER
 
@@ -719,8 +719,10 @@
 main.o: CFLAGS+=-p
 endif
 
+$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
+
 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
+	$(LINK)
 
 endif # !CONFIG_USER_ONLY
 

Modified: trunk/rules.mak
===================================================================
--- trunk/rules.mak	2009-01-21 18:12:52 UTC (rev 6378)
+++ trunk/rules.mak	2009-01-21 18:13:02 UTC (rev 6379)
@@ -8,3 +8,7 @@
 %.o: %.m
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
+LINK = $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+%$(EXESUF): %.o
+	$(LINK)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-21 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 18:13 [Qemu-devel] [6379] Consolidate linker rules (Avi Kivity) Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).