Skip to content

Commit 2918f0a

Browse files
committed
clients/Makefile.am: refactor definitions of LDADD_FULL and LDADD_CLIENT for easier reuse
upsmon is a daemon with systemd notify among other things, and uses the full libcommon upssched should suffice with the client version Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent ebf3105 commit 2918f0a

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

clients/Makefile.am

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@ $(top_builddir)/common/libcommonclient.la \
1212
$(top_builddir)/common/libparseconf.la: dummy
1313
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
1414

15-
# by default, link programs in this directory with
16-
# the more compact libcommonclient.a bundle
17-
LDADD = $(top_builddir)/common/libcommonclient.la libupsclient.la $(NETLIBS)
15+
LDADD_FULL = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS)
16+
if WITH_SSL
17+
LDADD_FULL += $(LIBSSL_LIBS)
18+
endif
19+
20+
LDADD_CLIENT = $(top_builddir)/common/libcommonclient.la libupsclient.la $(NETLIBS)
1821
if WITH_SSL
19-
LDADD += $(LIBSSL_LIBS)
22+
LDADD_CLIENT += $(LIBSSL_LIBS)
2023
endif
2124

25+
# by default, link programs in this directory with
26+
# the more compact libcommonclient.a bundle
27+
LDADD = $(LDADD_CLIENT)
28+
2229
# Avoid per-target CFLAGS, because this will prevent re-use of object
2330
# files. In any case, CFLAGS are only -I options, so there is no harm,
2431
# but only add them if we really use the target.
@@ -62,12 +69,13 @@ upscmd_SOURCES = upscmd.c upsclient.h
6269
upsrw_SOURCES = upsrw.c upsclient.h
6370
upslog_SOURCES = upslog.c upsclient.h upslog.h
6471
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h
72+
upsmon_LDADD = $(LDADD_FULL)
6573
if HAVE_WINDOWS_SOCKETS
6674
message_SOURCES = message.c
6775
endif
6876

6977
upssched_SOURCES = upssched.c upssched.h
70-
upssched_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
78+
upssched_LDADD = $(top_builddir)/common/libcommonclient.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
7179

7280
upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
7381
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)

0 commit comments

Comments
 (0)