Statistics
| Branch: | Revision:

root / libcacard / Makefile @ c2162a8b

History | View | Annotate | Download (2.3 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 92f562ec Anthony Liguori
QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) 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 14015304 Anthony Liguori
QEMU_CFLAGS+=$(GLIB_CFLAGS)
19 14015304 Anthony Liguori
20 44dc0ca3 Alon Levy
libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
21 44dc0ca3 Alon Levy
22 2ac85b93 Robert Relyea
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
23 0fc6b582 Brad
	$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS),"  LINK  $@")
24 44dc0ca3 Alon Levy
25 44dc0ca3 Alon Levy
clean:
26 0f94d6da Alon Levy
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
27 44dc0ca3 Alon Levy
	rm -Rf .libs
28 2ac85b93 Robert Relyea
29 2ac85b93 Robert Relyea
all: vscclient
30 c2162a8b Jan Kiszka
# Dummy command so that make thinks it has done something
31 c2162a8b Jan Kiszka
	@true
32 2ac85b93 Robert Relyea
33 44dc0ca3 Alon Levy
#########################################################################
34 44dc0ca3 Alon Levy
# Rules for building libcacard standalone library
35 44dc0ca3 Alon Levy
36 44dc0ca3 Alon Levy
ifeq ($(LIBTOOL),)
37 44dc0ca3 Alon Levy
libcacard.la:
38 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
39 44dc0ca3 Alon Levy
40 44dc0ca3 Alon Levy
install-libcacard:
41 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
42 44dc0ca3 Alon Levy
else
43 44dc0ca3 Alon Levy
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
44 0fc6b582 Brad
	$(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs),"  lt LINK $@")
45 111a38b0 Robert Relyea
46 0f94d6da Alon Levy
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
47 0f94d6da Alon Levy
	sed -e 's|@LIBDIR@|$(libdir)|' \
48 0f94d6da Alon Levy
		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
49 0f94d6da Alon Levy
	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
50 0f94d6da Alon Levy
		-e 's|@PREFIX@|$(prefix)|' \
51 0f94d6da Alon Levy
		< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc
52 0f94d6da Alon Levy
53 0f94d6da Alon Levy
.PHONY: install-libcacard
54 0f94d6da Alon Levy
55 0f94d6da Alon Levy
install-libcacard: libcacard.pc libcacard.la vscclient
56 44dc0ca3 Alon Levy
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
57 0f94d6da Alon Levy
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
58 0f94d6da Alon Levy
	$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
59 0f94d6da Alon Levy
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
60 3f534581 Brad
	$(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
61 9f4facbc Brad Smith
	$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)"
62 3f534581 Brad
	$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
63 0f94d6da Alon Levy
	for inc in *.h; do \
64 3f534581 Brad
		$(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
65 0f94d6da Alon Levy
	done
66 44dc0ca3 Alon Levy
endif