From 0e8c9214ba1d4128cf92442cd343bc3733478261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 6 Jan 2010 20:24:05 +0100 Subject: Drop --whole-archive and static libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Juan has contributed a cool Makefile infrastructure that enables us to drop static libraries completely: Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-}, and link those object files directly into the executables. Replace HWLIB by HWDIR, specifying only the directory. Drop --whole-archive and ARLIBS in Makefiles and configure. Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all common objects after generating a target-specific header; add dependency rules to Makefile and Makefile.target instead. v2: - Don't try to include /config.mak for user emulators - Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted by "user_only: compile everything with -fpie" (Kirill A. Shutemov) v3: - Fix dependency modelling for tools - Remove comment on GENERATED_HEADERS obsoleted by this patch Signed-off-by: Andreas Färber Cc: Blue Swirl Cc: Palle Lyckegaard Cc: Ben Taylor Cc: Juan Quintela Cc: Kirill A. Shutemov Cc: Paolo Bonzini Signed-off-by: Blue Swirl --- rules.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rules.mak') diff --git a/rules.mak b/rules.mak index 5d9f684c24..9bcf9af95f 100644 --- a/rules.mak +++ b/rules.mak @@ -14,7 +14,7 @@ MAKEFLAGS += -rR # Flags for dependency generation QEMU_DGFLAGS += -MMD -MP -MT $@ -%.o: %.c $(GENERATED_HEADERS) +%.o: %.c $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") %.o: %.S @@ -23,7 +23,7 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ %.o: %.m $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") -LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TARGET_DIR)$@") +LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@") %$(EXESUF): %.o $(call LINK,$^) -- cgit v1.2.1