root / libcacard / Makefile @ 591eca67
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 |
libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) |
11 |
libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) |
12 |
|
13 |
# libtool will build the .o files, too |
14 |
$(libcacard-obj-y): | $(libcacard-lobj-y) |
15 |
|
16 |
QEMU_CFLAGS+=-I../ |
17 |
|
18 |
vscclient: vscclient.o $(libcacard-obj-y) |
19 |
$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") |
20 |
|
21 |
clean: |
22 |
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc |
23 |
rm -Rf .libs */.libs |
24 |
|
25 |
all: libcacard.la libcacard.pc |
26 |
# Dummy command so that make thinks it has done something |
27 |
@true |
28 |
|
29 |
######################################################################### |
30 |
# Rules for building libcacard standalone library |
31 |
|
32 |
libcacard.la: $(libcacard-lobj-y) |
33 |
$(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") |
34 |
|
35 |
libcacard_srcpath=$(SRC_PATH)/libcacard |
36 |
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in |
37 |
$(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \ |
38 |
-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \ |
39 |
-e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \ |
40 |
-e 's|@PREFIX@|$(prefix)|' \ |
41 |
< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\ |
42 |
" GEN $@") |
43 |
|
44 |
.PHONY: install-libcacard |
45 |
|
46 |
install-libcacard: libcacard.pc libcacard.la vscclient |
47 |
$(INSTALL_DIR) "$(DESTDIR)$(libdir)" |
48 |
$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" |
49 |
$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" |
50 |
$(INSTALL_DIR) "$(DESTDIR)$(bindir)" |
51 |
$(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" |
52 |
$(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)" |
53 |
$(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" |
54 |
for inc in *.h; do \ |
55 |
$(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ |
56 |
done |