From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH v3 25/29] build: libcacard Makefile cleanups
Date: Thu, 7 Jun 2012 09:40:10 +0200 [thread overview]
Message-ID: <1339054814-20939-26-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1339054814-20939-1-git-send-email-pbonzini@redhat.com>
Build vscclient from toplevel Makefile, limit usage of vpath.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 4 ++++
Makefile.objs | 8 +++++++-
Makefile.target | 6 ------
configure | 12 +++++-------
libcacard/Makefile | 17 ++++++-----------
5 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index a10005a..1d34b95 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,10 @@ libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(t
install-libcacard: libcacard.la
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
endif
+
+vscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) qemu-timer-common.o libcacard/vscclient.o
+ $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
+
######################################################################
qemu-img.o: qemu-img-cmds.h
diff --git a/Makefile.objs b/Makefile.objs
index ae3770a..74110dd 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -198,7 +198,13 @@ $(trace-obj-y): $(GENERATED_HEADERS)
######################################################################
# smartcard
-libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o
+libcacard-y += libcacard/cac.o libcacard/event.o
+libcacard-y += libcacard/vcard.o libcacard/vreader.o
+libcacard-y += libcacard/vcard_emul_nss.o
+libcacard-y += libcacard/vcard_emul_type.o
+libcacard-y += libcacard/card_7816.o
+
+common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
######################################################################
# qapi
diff --git a/Makefile.target b/Makefile.target
index 3dfdf92..555894d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -164,16 +164,10 @@ all-obj-y = $(obj-y)
all-obj-y += $(addprefix ../, $(universal-obj-y))
ifdef CONFIG_SOFTMMU
-
all-obj-y += $(addprefix ../, $(common-obj-y))
all-obj-y += $(addprefix ../libdis/, $(libdis-y))
all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
all-obj-y += $(addprefix ../, $(trace-obj-y))
-
-# libcacard needs qemu-thread support, and besides is only needed by devices
-# so not requires with linux-user / bsd-user targets
-all-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-
else
all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
diff --git a/configure b/configure
index e50ad0b..cd5e8b3 100755
--- a/configure
+++ b/configure
@@ -2927,6 +2927,9 @@ if test "$softmmu" = yes ; then
fi
fi
fi
+if test "$smartcard_nss" = "yes" ; then
+ tools="vscclient\$(EXESUF) $tools"
+fi
# Mac OS X ships with a broken assembler
roms=
@@ -3959,9 +3962,10 @@ DIRS="$DIRS roms/seabios roms/vgabios"
DIRS="$DIRS fsdev ui hw hw/usb"
DIRS="$DIRS qapi qapi-generated"
DIRS="$DIRS qga trace qom"
+DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace"
FILES="Makefile tests/tcg/Makefile qdict-test-data.txt"
FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
-FILES="$FILES tests/tcg/lm32/Makefile"
+FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile"
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
FILES="$FILES pc-bios/spapr-rtas/Makefile"
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
@@ -4005,12 +4009,6 @@ for hwlib in 32 64; do
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
done
-if [ "$source_path" != `pwd` ]; then
- # out of tree build
- mkdir -p libcacard
- symlink "$source_path/libcacard/Makefile" libcacard/Makefile
-fi
-
d=libuser
mkdir -p $d
mkdir -p $d/trace
diff --git a/libcacard/Makefile b/libcacard/Makefile
index c6a896a..fdc2873 100644
--- a/libcacard/Makefile
+++ b/libcacard/Makefile
@@ -2,29 +2,23 @@
-include $(SRC_PATH)/Makefile.objs
-include $(SRC_PATH)/rules.mak
-libcacard_srcpath=$(SRC_PATH)/libcacard
libcacard_includedir=$(includedir)/cacard
-$(call set-vpath, $(SRC_PATH):$(libcacard_srcpath))
-
-# objects linked against normal qemu binaries, not compiled with libtool
-QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y))
+$(call set-vpath, $(SRC_PATH))
# objects linked into a shared library, built with libtool with -fPIC if required
-QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS)))
+QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y)
+QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS))
QEMU_CFLAGS+=-I../
-libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
-
-vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
- $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
+libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
clean:
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
rm -Rf .libs
-all: vscclient
+all: libcacard.la libcacard.pc
# Dummy command so that make thinks it has done something
@true
@@ -41,6 +35,7 @@ else
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
$(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")
+libcacard_srcpath=$(SRC_PATH)/libcacard
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
sed -e 's|@LIBDIR@|$(libdir)|' \
-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
--
1.7.10.1
next prev parent reply other threads:[~2012-06-07 7:42 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 7:39 [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 01/29] build: remove trace-nested-y Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 02/29] build: do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 03/29] build: add rules for nesting Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 04/29] build: move *-user/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 05/29] build: move obj-TARGET-y variables " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 06/29] build: move libobj-y variable " Paolo Bonzini
2012-06-07 21:10 ` Blue Swirl
2012-06-07 23:18 ` Paolo Bonzini
2012-06-08 8:03 ` Andreas Färber
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 07/29] dump: do not compile dump.o for user-mode emulation Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 08/29] dump: change cpu_get_note_size to return ssize_t Paolo Bonzini
2012-06-11 1:52 ` Wen Congyang
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 09/29] dump: remove dumping stuff from cpu-all.h Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 10/29] build: move other target-*/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 11/29] build: move rules for nesting to Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 12/29] build: adapt qom/Makefile and move it " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 13/29] build: move block/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 14/29] build: move net/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 15/29] build: move fsdev/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 16/29] build: move ui/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 17/29] build: move audio/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 18/29] build: move slirp/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 19/29] build: move qapi/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 20/29] build: move qga/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 21/29] build: move target-independent hw/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 22/29] build: convert libhw " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 23/29] build: move per-target hw/ objects " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 24/29] build: move device tree to per-target Makefile.objs Paolo Bonzini
2012-06-07 7:40 ` Paolo Bonzini [this message]
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 26/29] build: limit usage of vpath Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 27/29] build: compile oslib-obj-y once Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 28/29] configure: ensure directory exists when creating symlink Paolo Bonzini
2012-06-12 18:44 ` Andreas Färber
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 29/29] build: do not create directories at configure time Paolo Bonzini
2012-06-07 12:31 ` [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Andreas Färber
2012-06-07 12:47 ` Anthony Liguori
2012-06-07 14:14 ` Paolo Bonzini
2012-06-08 13:59 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339054814-20939-26-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).