root / libcacard / Makefile @ 0f94d6da
History | View | Annotate | Download (2.2 kB)
1 | 111a38b0 | Robert Relyea | -include ../config-host.mak |
---|---|---|---|
2 | 111a38b0 | Robert Relyea | -include $(SRC_PATH)/Makefile.objs |
3 | 111a38b0 | Robert Relyea | -include $(SRC_PATH)/rules.mak |
4 | 111a38b0 | Robert Relyea | |
5 | 0f94d6da | Alon Levy | libcacard_srcpath=$(SRC_PATH)/libcacard |
6 | 0f94d6da | Alon Levy | libcacard_includedir=$(includedir)/cacard |
7 | 0f94d6da | Alon Levy | |
8 | 0f94d6da | Alon Levy | $(call set-vpath, $(SRC_PATH):$(libcacard_srcpath)) |
9 | 111a38b0 | Robert Relyea | |
10 | 44dc0ca3 | Alon Levy | # objects linked against normal qemu binaries, not compiled with libtool |
11 | 44dc0ca3 | Alon Levy | QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(trace-obj-y)) |
12 | 44dc0ca3 | Alon Levy | |
13 | 44dc0ca3 | Alon Levy | # objects linked into a shared library, built with libtool with -fPIC if required |
14 | 44dc0ca3 | Alon Levy | QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS))) |
15 | 111a38b0 | Robert Relyea | |
16 | 111a38b0 | Robert Relyea | QEMU_CFLAGS+=-I../ |
17 | 111a38b0 | Robert Relyea | |
18 | 44dc0ca3 | Alon Levy | libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y))) |
19 | 44dc0ca3 | Alon Levy | |
20 | 2ac85b93 | Robert Relyea | vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o |
21 | 44dc0ca3 | Alon Levy | $(call quiet-command,$(CC) $(libcacard_libs) -lrt -o $@ $^," LINK $@") |
22 | 44dc0ca3 | Alon Levy | |
23 | 44dc0ca3 | Alon Levy | clean: |
24 | 0f94d6da | Alon Levy | rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc |
25 | 44dc0ca3 | Alon Levy | rm -Rf .libs |
26 | 2ac85b93 | Robert Relyea | |
27 | 2ac85b93 | Robert Relyea | all: vscclient |
28 | 2ac85b93 | Robert Relyea | |
29 | 44dc0ca3 | Alon Levy | ######################################################################### |
30 | 44dc0ca3 | Alon Levy | # Rules for building libcacard standalone library |
31 | 44dc0ca3 | Alon Levy | |
32 | 44dc0ca3 | Alon Levy | ifeq ($(LIBTOOL),) |
33 | 44dc0ca3 | Alon Levy | libcacard.la: |
34 | 44dc0ca3 | Alon Levy | @echo "libtool is missing, please install and rerun configure"; exit 1 |
35 | 44dc0ca3 | Alon Levy | |
36 | 44dc0ca3 | Alon Levy | install-libcacard: |
37 | 44dc0ca3 | Alon Levy | @echo "libtool is missing, please install and rerun configure"; exit 1 |
38 | 44dc0ca3 | Alon Levy | else |
39 | 44dc0ca3 | Alon Levy | libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) |
40 | 44dc0ca3 | Alon Levy | $(call quiet-command,libtool --mode=link --quiet --tag=CC $(CC) $(libcacard_libs) -lrt -rpath $(libdir) -o $@ $^," lt LINK $@") |
41 | 111a38b0 | Robert Relyea | |
42 | 0f94d6da | Alon Levy | libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in |
43 | 0f94d6da | Alon Levy | sed -e 's|@LIBDIR@|$(libdir)|' \ |
44 | 0f94d6da | Alon Levy | -e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \ |
45 | 0f94d6da | Alon Levy | -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \ |
46 | 0f94d6da | Alon Levy | -e 's|@PREFIX@|$(prefix)|' \ |
47 | 0f94d6da | Alon Levy | < $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc |
48 | 0f94d6da | Alon Levy | |
49 | 0f94d6da | Alon Levy | .PHONY: install-libcacard |
50 | 0f94d6da | Alon Levy | |
51 | 0f94d6da | Alon Levy | install-libcacard: libcacard.pc libcacard.la vscclient |
52 | 44dc0ca3 | Alon Levy | $(INSTALL_DIR) "$(DESTDIR)$(libdir)" |
53 | 0f94d6da | Alon Levy | $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" |
54 | 0f94d6da | Alon Levy | $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" |
55 | 0f94d6da | Alon Levy | $(INSTALL_DIR) "$(DESTDIR)$(bindir)" |
56 | 0f94d6da | Alon Levy | libtool --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" |
57 | 44dc0ca3 | Alon Levy | libtool --mode=install $(INSTALL_PROG) libcacard.la "$(DESTDIR)$(libdir)" |
58 | 0f94d6da | Alon Levy | libtool --mode=install $(INSTALL_PROG) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" |
59 | 0f94d6da | Alon Levy | for inc in *.h; do \ |
60 | 0f94d6da | Alon Levy | libtool --mode=install $(INSTALL_PROG) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ |
61 | 0f94d6da | Alon Levy | done |
62 | 0f94d6da | Alon Levy | |
63 | 44dc0ca3 | Alon Levy | endif |