Makefile.am 2.69 KB
Newer Older
JINMEI Tatuya's avatar
JINMEI Tatuya committed
1
SUBDIRS = . tests benchmarks
2

3
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
4
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
5
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
6
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
7
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
8
AM_CPPFLAGS += $(BOOST_INCLUDES)
9 10

AM_CXXFLAGS = $(B10_CXXFLAGS)
11

JINMEI Tatuya's avatar
JINMEI Tatuya committed
12 13 14 15
if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

16 17
pkglibexecdir = $(libexecdir)/@PACKAGE@

18
CLEANFILES = *.gcno *.gcda auth.spec spec_config.h
19

20
man_MANS = b10-auth.8
21
EXTRA_DIST = $(man_MANS) b10-auth.xml
22

23 24
if ENABLE_MAN

25 26 27
b10-auth.8: b10-auth.xml
	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml

28 29
endif

30 31
auth.spec: auth.spec.pre
	$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" auth.spec.pre >$@
32

33 34 35
spec_config.h: spec_config.h.pre
	$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@

36 37 38 39 40 41 42 43
# This is a wrapper library solely used for b10-auth.  The ASIO header files
# have some code fragments that would hit gcc's unused-parameter warning,
# which would make the build fail with -Werror (our default setting).
# We don't want to lower the warning level for our own code just for ASIO,
# so as a workaround we extract the ASIO related code into a separate library,
# only for which we accept the unused-parameter warning.
lib_LIBRARIES = libasio_link.a
libasio_link_a_SOURCES = asio_link.cc asio_link.h
44 45
# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
# B10_CXXFLAGS)
46 47 48 49
libasio_link_a_CXXFLAGS = $(AM_CXXFLAGS)
if USE_GXX
libasio_link_a_CXXFLAGS += -Wno-unused-parameter
endif
50 51 52 53
if USE_CLANGPP
# Same for clang++, but we need to turn off -Werror completely.
libasio_link_a_CXXFLAGS += -Wno-error
endif
54
libasio_link_a_CPPFLAGS = $(AM_CPPFLAGS)
55

56
BUILT_SOURCES = spec_config.h 
57
pkglibexec_PROGRAMS = b10-auth
58
b10_auth_SOURCES = auth_srv.cc auth_srv.h
59
b10_auth_SOURCES += change_user.cc change_user.h
60
b10_auth_SOURCES += common.h
61
b10_auth_SOURCES += statistics.cc statistics.h
62
b10_auth_SOURCES += main.cc
JINMEI Tatuya's avatar
JINMEI Tatuya committed
63 64 65 66 67
b10_auth_LDADD =  $(top_builddir)/src/lib/datasrc/libdatasrc.la
b10_auth_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.la
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
68
b10_auth_LDADD += libasio_link.a
JINMEI Tatuya's avatar
JINMEI Tatuya committed
69
b10_auth_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
70
b10_auth_LDADD += $(SQLITE_LIBS)
71

72 73
# TODO: config.h.in is wrong because doesn't honor pkgdatadir
# and can't use @datadir@ because doesn't expand default ${prefix}
74 75 76
b10_authdir = $(DESTDIR)$(pkgdatadir)
b10_auth_DATA = auth.spec