Makefile 1.43 KB
Newer Older
1 2
libcacard_includedir=$(includedir)/cacard

3
TOOLS += vscclient$(EXESUF)
4 5

# objects linked into a shared library, built with libtool with -fPIC if required
6
libcacard-obj-y = $(libcacard-y)
7
libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y))
8

9 10 11
# libtool will build the .o files, too
$(libcacard-obj-y): | $(libcacard-lobj-y)

12
all: libcacard.la libcacard.pc
13

14
vscclient$(EXESUF): libcacard/vscclient.o libcacard.la
15
	$(call LINK,$^)
16

17 18 19
#########################################################################
# Rules for building libcacard standalone library

20
libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \
21
	-export-symbols $(SRC_PATH)/libcacard/libcacard.syms
22
libcacard.la: $(libcacard-lobj-y)
23
	$(call LINK,$^)
24

25
libcacard.pc: $(SRC_PATH)/libcacard/libcacard.pc.in
Blue Swirl's avatar
Blue Swirl committed
26
	$(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \
27 28
		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
29
		-e 's|@PREFIX@|$(prefix)|' $< > libcacard.pc,\
Blue Swirl's avatar
Blue Swirl committed
30
	"  GEN   $@")
31 32 33

.PHONY: install-libcacard

34 35
install: install-libcacard
install-libcacard: libcacard.pc libcacard.la
36
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
37 38
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
	$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
39 40
	$(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)"
	$(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
41 42
	for inc in $(SRC_PATH)/libcacard/*.h; do \
		$(INSTALL_DATA) $$inc "$(DESTDIR)$(libcacard_includedir)"; \
43
	done