lib.mk 2.51 KB
Newer Older
1
libkres_SOURCES := \
2 3
	lib/cache/api.c \
	lib/cache/cdb_lmdb.c \
4
	lib/cache/entry_list.c \
5 6 7 8
	lib/cache/entry_pkt.c \
	lib/cache/entry_rr.c \
	lib/cache/knot_pkt.c \
	lib/cache/nsec1.c \
9
	lib/cache/nsec3.c \
10
	lib/cache/peek.c \
11 12 13 14 15 16 17
	lib/dnssec.c \
	lib/dnssec/nsec.c \
	lib/dnssec/nsec3.c \
	lib/dnssec/signature.c \
	lib/dnssec/ta.c \
	lib/generic/lru.c \
	lib/generic/map.c \
18
	lib/generic/queue.c \
19
	lib/generic/trie.c \
20 21 22 23 24 25 26 27 28
	lib/layer/cache.c \
	lib/layer/iterate.c \
	lib/layer/validate.c \
	lib/module.c \
	lib/nsrep.c \
	lib/resolve.c \
	lib/rplan.c \
	lib/utils.c \
	lib/zonecut.c
Marek Vavruša's avatar
Marek Vavruša committed
29

30
libkres_HEADERS := \
31 32 33 34 35 36 37 38
	lib/cache/api.h \
	lib/cache/cdb_api.h \
	lib/cache/cdb_lmdb.h \
	lib/cache/impl.h \
	lib/defines.h \
	lib/dnssec.h \
	lib/dnssec/nsec.h \
	lib/dnssec/nsec3.h \
39
	lib/dnssec/signature.h \
40 41 42 43 44
	lib/dnssec/ta.h \
	lib/generic/array.h \
	lib/generic/lru.h \
	lib/generic/map.h \
	lib/generic/pack.h \
45
	lib/generic/queue.h \
46
	lib/generic/trie.h \
47 48 49 50 51 52 53 54
	lib/layer.h \
	lib/layer/iterate.h \
	lib/module.h \
	lib/nsrep.h \
	lib/resolve.h \
	lib/rplan.h \
	lib/utils.h \
	lib/zonecut.h
Marek Vavruša's avatar
Marek Vavruša committed
55 56

# Dependencies
57
libkres_DEPEND := $(contrib)
58
libkres_CFLAGS := -fPIC $(lmdb_CFLAGS)
59
libkres_LIBS := $(contrib_TARGET) $(libknot_LIBS) $(libdnssec_LIBS) $(lmdb_LIBS) \
60
				$(libuv_LIBS) $(gnutls_LIBS)
61
libkres_TARGET := -L$(abspath lib) -lkres
Marek Vavruša's avatar
Marek Vavruša committed
62

63
ifeq ($(ENABLE_COOKIES),yes)
64
libkres_SOURCES += \
65
	lib/cookies/alg_containers.c \
66 67
	lib/cookies/alg_sha.c \
	lib/cookies/helper.c \
68
	lib/cookies/lru_cache.c \
69
	lib/cookies/nonce.c
70 71

libkres_HEADERS += \
72 73 74 75
	lib/cookies/alg_containers.h \
	lib/cookies/alg_sha.h \
	lib/cookies/control.h \
	lib/cookies/helper.h \
76
	lib/cookies/lru_cache.h \
77
	lib/cookies/nonce.h
78

79
libkres_LIBS += $(nettle_LIBS)
80 81
endif

Marek Vavruša's avatar
Marek Vavruša committed
82
# Make library
83
ifeq ($(BUILDMODE), static)
84
$(eval $(call make_static,libkres,lib,yes))
85 86 87 88 89 90 91 92 93 94 95
else
$(eval $(call make_lib,libkres,lib,yes,$(ABIVER)))
endif

# Generate pkg-config file
libkres.pc:
	@echo 'prefix='$(PREFIX) > $@
	@echo 'exec_prefix=$${prefix}' >> $@
	@echo 'libdir='$(LIBDIR) >> $@
	@echo 'includedir='$(INCLUDEDIR) >> $@
	@echo 'Name: libkres' >> $@
96
	@echo 'Description: Knot Resolver library' >> $@
Marek Vavrusa's avatar
Marek Vavrusa committed
97
	@echo 'URL: https://www.knot-resolver.cz' >> $@
98
	@echo 'Version: $(VERSION)' >> $@
99 100 101
	@echo 'Libs: -L$${libdir} -lkres' >> $@
	@echo 'Cflags: -I$${includedir}' >> $@
libkres-pcinstall: libkres.pc libkres-install
102 103
	$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)
	$(INSTALL)    -m 644 $< $(DESTDIR)$(PKGCONFIGDIR)
104 105

# Targets
106
lib: $(libkres)
107
lib-install: libkres-install libkres-pcinstall
108
lib-clean: libkres-clean
109

110
.PHONY: lib lib-install lib-clean libkres.pc