Statistics
| Branch: | Revision:

root / libcacard / Makefile @ b6fc675b

History | View | Annotate | Download (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
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
35
	$(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs),"  lt LINK $@")
36

    
37
libcacard_srcpath=$(SRC_PATH)/libcacard
38
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
39
	$(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \
40
		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
41
	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
42
		-e 's|@PREFIX@|$(prefix)|' \
43
		< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\
44
	"  GEN   $@")
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
	$(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
54
	$(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)"
55
	$(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
56
	for inc in *.h; do \
57
		$(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
58
	done