nut/clients/Makefile.am

106 lines
3.5 KiB
Makefile
Raw Normal View History

2010-03-25 23:20:59 +00:00
# Network UPS Tools: clients
2022-06-29 10:37:36 +00:00
EXTRA_DIST =
# nutclient.cpp for some legacy reason (maybe initial detached development?)
# optionally includes "common.h" with the NUT build setup - and this option
# was never triggered in fact, not until pushed through command line like this:
AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_srcdir)/include
# Make sure out-of-dir dependencies exist (especially when dev-building parts):
$(top_builddir)/common/libcommon.la \
$(top_builddir)/common/libcommonclient.la \
$(top_builddir)/common/libparseconf.la: dummy
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
2010-03-25 23:20:59 +00:00
# by default, link programs in this directory with libcommon.a
2022-06-29 10:37:36 +00:00
LDADD = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS)
2010-03-25 23:20:59 +00:00
if WITH_SSL
2011-01-26 09:35:08 +00:00
LDADD += $(LIBSSL_LIBS)
2010-03-25 23:20:59 +00:00
endif
# Avoid per-target CFLAGS, because this will prevent re-use of object
# files. In any case, CFLAGS are only -I options, so there is no harm,
# but only add them if we really use the target.
AM_CFLAGS = -I$(top_srcdir)/include
if WITH_SSL
AM_CFLAGS += $(LIBSSL_CFLAGS)
endif
if WITH_CGI
AM_CFLAGS += $(LIBGD_CFLAGS)
endif
bin_PROGRAMS = upsc upslog upsrw upscmd
dist_bin_SCRIPTS = upssched-cmd
sbin_PROGRAMS = upsmon upssched
2022-06-29 10:37:36 +00:00
lib_LTLIBRARIES = libupsclient.la
if HAVE_CXX11
lib_LTLIBRARIES += libnutclient.la
lib_LTLIBRARIES += libnutclientstub.la
endif
2010-03-25 23:20:59 +00:00
if WITH_DEV
2022-06-29 10:37:36 +00:00
include_HEADERS = upsclient.h ../include/parseconf.h nutclient.h nutclientmem.h
2010-03-25 23:20:59 +00:00
endif
if WITH_CGI
cgiexec_PROGRAMS = upsstats.cgi upsimage.cgi upsset.cgi
endif
upsc_SOURCES = upsc.c upsclient.h
upscmd_SOURCES = upscmd.c upsclient.h
upsrw_SOURCES = upsrw.c upsclient.h
upslog_SOURCES = upslog.c upsclient.h upslog.h
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h
upssched_SOURCES = upssched.c upssched.h
2022-06-29 10:37:36 +00:00
upssched_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
2010-03-25 23:20:59 +00:00
upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
upsset_cgi_SOURCES = upsset.c upsclient.h cgilib.c cgilib.h
upsstats_cgi_SOURCES = upsstats.c upsclient.h status.h upsstats.h \
upsimagearg.h cgilib.c cgilib.h
# not LDADD.
libupsclient_la_SOURCES = upsclient.c upsclient.h
2022-06-29 10:37:36 +00:00
libupsclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
2010-03-25 23:20:59 +00:00
if WITH_SSL
2011-01-26 09:35:08 +00:00
libupsclient_la_LIBADD += $(LIBSSL_LIBS)
2010-03-25 23:20:59 +00:00
endif
2013-11-24 15:00:12 +00:00
2022-06-29 10:37:36 +00:00
# Below we set API versions of public libraries
2013-11-24 15:00:12 +00:00
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
2022-06-29 10:37:36 +00:00
# Note that changes here may have to be reflected in packaging (the shared
# object .so names would differ)
# libupsclient version information
libupsclient_la_LDFLAGS = -version-info 6:0:0 -export-symbols-regex ^upscli_
2013-11-24 15:00:12 +00:00
2022-06-29 10:37:36 +00:00
if HAVE_CXX11
# libnutclient version information and build
2013-11-24 15:00:12 +00:00
libnutclient_la_SOURCES = nutclient.h nutclient.cpp
2022-06-29 10:37:36 +00:00
libnutclient_la_LDFLAGS = -version-info 2:0:0
# Needed in not-standalone builds with -DHAVE_NUTCOMMON=1
# which is defined for in-tree CXX builds above:
libnutclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
else
EXTRA_DIST += nutclient.h nutclient.cpp
endif
if HAVE_CXX11
# libnutclientstub version information and build
libnutclientstub_la_SOURCES = nutclientmem.h nutclientmem.cpp
libnutclientstub_la_LDFLAGS = -version-info 1:0:0
libnutclientstub_la_LIBADD = libnutclient.la
else
EXTRA_DIST += nutclientmem.h nutclientmem.cpp
endif
dummy:
MAINTAINERCLEANFILES = Makefile.in .dirstamp
2013-11-24 15:00:12 +00:00
2022-06-29 10:37:36 +00:00
# NOTE: Do not clean ".deps" in SUBDIRS of the main project,
# the root Makefile.am takes care of that!
#clean-local:
# rm -rf $(builddir)/.deps