Statistics
| Branch: | Revision:

root / libcacard / Makefile @ 00c705fb

History | View | Annotate | Download (2.1 kB)

1
-include ../config-host.mak
2
-include $(SRC_PATH)/Makefile.objs
3
-include $(SRC_PATH)/rules.mak
4

    
5
libcacard_includedir=$(includedir)/cacard
6

    
7
$(call set-vpath, $(SRC_PATH))
8

    
9
# objects linked into a shared library, built with libtool with -fPIC if required
10
QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y)
11
QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS))
12

    
13
QEMU_CFLAGS+=-I../
14

    
15
libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
16

    
17
clean:
18
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
19
	rm -Rf .libs
20

    
21
all: libcacard.la libcacard.pc
22
# Dummy command so that make thinks it has done something
23
	@true
24

    
25
#########################################################################
26
# Rules for building libcacard standalone library
27

    
28
ifeq ($(LIBTOOL),)
29
libcacard.la:
30
	@echo "libtool is missing, please install and rerun configure"; exit 1
31

    
32
install-libcacard:
33
	@echo "libtool is missing, please install and rerun configure"; exit 1
34
else
35
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
36
	$(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs),"  lt LINK $@")
37

    
38
libcacard_srcpath=$(SRC_PATH)/libcacard
39
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
40
	sed -e 's|@LIBDIR@|$(libdir)|' \
41
		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
42
	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
43
		-e 's|@PREFIX@|$(prefix)|' \
44
		< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc
45

    
46
.PHONY: install-libcacard
47

    
48
install-libcacard: libcacard.pc libcacard.la vscclient
49
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
50
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
51
	$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
52
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
53
	$(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
54
	$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)"
55
	$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
56
	for inc in *.h; do \
57
		$(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
58
	done
59
endif