aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-05-15 11:51:28 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-06-14 09:34:34 -0500
commit44dc0ca3d22db732a6c4b7f3e59594fc323113f8 (patch)
tree35f6f01236a11a40bca3492a6ccf20104efde637 /Makefile
parent3aa5d2bee8e948deabd7c25a7c6ee963daa56a27 (diff)
libcacard: add libcacard.la target
No flag to configure is required. Instead, added a libcacard.la target that is not built by default, only when requested explicitly via: mkdir build cd build ../configure make libcacard.la make install-libcacard Uses libtool to do actual linking of object files and shared library, and installing. Tested only under linux, but supposed to work on other systems as well. If libtool isn't found you get a message complaining about that, only at build time (since it is not a default target I did not add a message at configure time). New build artifacts: .libs subdirectories (at <buildroot> and <buildroot>/libcacard) *.lo files (at same locations as the respective o files) Added %.lo : %.c rule that uses libtool. Updated clean rule to clean up those artifacts. Added specific rule to call dtrace with libtool wrapper (note that because of a current upstream dtrace bug fixed by systemtap b1568fd85 commit the -fPIC flag isn't actually passed on. still current dtrace+libtool produced object links fine). If libtool is missing any of the following targets will complain and exit 1: any subdir: *.lo root and libcacard: libcacard.la, libcacard-instsall Tested to link and load with all tracing backends.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 19 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 096480bef..b3ffbe240 100644
--- a/Makefile
+++ b/Makefile
@@ -119,6 +119,23 @@ version.o: $(SRC_PATH)/version.rc config-host.mak
version-obj-$(CONFIG_WIN32) += version.o
######################################################################
+# Support building shared library libcacard
+
+.PHONY: libcacard.la install-libcacard
+ifeq ($(LIBTOOL),)
+libcacard.la:
+ @echo "libtool is missing, please install and rerun configure"; exit 1
+
+install-libcacard:
+ @echo "libtool is missing, please install and rerun configure"; exit 1
+else
+libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
+
+install-libcacard: libcacard.la
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
+endif
+######################################################################
qemu-img.o: qemu-img-cmds.h
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o: $(GENERATED_HEADERS)
@@ -149,7 +166,8 @@ clean:
# avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
rm -f qemu-options.def
- rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
+ rm -f *.o *.d *.a *.lo $(TOOLS) TAGS cscope.* *.pod *~ */*~
+ rm -Rf .libs
rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d
rm -f qemu-img-cmds.h
rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp