Statistics
| Branch: | Revision:

root / libcacard / Makefile @ e832341b

History | View | Annotate | Download (2.2 kB)

1
-include ../config-host.mak
2
-include $(SRC_PATH)/rules.mak
3
-include $(SRC_PATH)/Makefile.objs
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 error.o $(trace-obj-y) $(stub-obj-y)
11
QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS))
12

    
13
# libtool will build the .o files, too
14
$(libcacard-obj-y): | $(libcacard-lobj-y)
15

    
16
QEMU_CFLAGS+=-I../
17

    
18
libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
19

    
20
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o cutils.o
21
	$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS),"  LINK  $@")
22

    
23
clean:
24
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc
25
	rm -Rf .libs */.libs
26

    
27
all: libcacard.la libcacard.pc
28
# Dummy command so that make thinks it has done something
29
	@true
30

    
31
#########################################################################
32
# Rules for building libcacard standalone library
33

    
34
ifeq ($(LIBTOOL),)
35
libcacard.la:
36
	@echo "libtool is missing, please install and rerun configure"; exit 1
37

    
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 --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs),"  lt LINK $@")
43

    
44
libcacard_srcpath=$(SRC_PATH)/libcacard
45
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
46
	$(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \
47
		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
48
	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
49
		-e 's|@PREFIX@|$(prefix)|' \
50
		< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\
51
	"  GEN   $@")
52

    
53
.PHONY: install-libcacard
54

    
55
install-libcacard: libcacard.pc libcacard.la vscclient
56
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
57
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
58
	$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
59
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
60
	$(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
61
	$(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)"
62
	$(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
63
	for inc in *.h; do \
64
		$(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
65
	done
66
endif