qemu-ga: fixes for win32 build of qemu-ga
[qemu/ar7.git] / libcacard / Makefile
blobc6a896a7397026397a2900ca537b25361eb0b840
1 -include ../config-host.mak
2 -include $(SRC_PATH)/Makefile.objs
3 -include $(SRC_PATH)/rules.mak
5 libcacard_srcpath=$(SRC_PATH)/libcacard
6 libcacard_includedir=$(includedir)/cacard
8 $(call set-vpath, $(SRC_PATH):$(libcacard_srcpath))
10 # objects linked against normal qemu binaries, not compiled with libtool
11 QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y))
13 # objects linked into a shared library, built with libtool with -fPIC if required
14 QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS)))
16 QEMU_CFLAGS+=-I../
18 libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
20 vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
21 $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
23 clean:
24 rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
25 rm -Rf .libs
27 all: vscclient
28 # Dummy command so that make thinks it has done something
29 @true
31 #########################################################################
32 # Rules for building libcacard standalone library
34 ifeq ($(LIBTOOL),)
35 libcacard.la:
36 @echo "libtool is missing, please install and rerun configure"; exit 1
38 install-libcacard:
39 @echo "libtool is missing, please install and rerun configure"; exit 1
40 else
41 libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
42 $(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")
44 libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
45 sed -e 's|@LIBDIR@|$(libdir)|' \
46 -e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
47 -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
48 -e 's|@PREFIX@|$(prefix)|' \
49 < $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc
51 .PHONY: install-libcacard
53 install-libcacard: libcacard.pc libcacard.la vscclient
54 $(INSTALL_DIR) "$(DESTDIR)$(libdir)"
55 $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
56 $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
57 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
58 $(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
59 $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)"
60 $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
61 for inc in *.h; do \
62 $(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
63 done
64 endif