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