Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ bindings)
echo ""
./autogen.sh
#./configure
./configure --with-cgi=auto --with-serial=auto --with-dev=auto
./configure --with-cgi=auto --with-serial=auto --with-dev=auto --with-doc=skip
$MAKE all && $MAKE check
;;
*)
Expand Down
12 changes: 9 additions & 3 deletions clients/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ EXTRA_DIST =
# 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:
@cd $(@D) && $(MAKE) -s $(@F)

# by default, link programs in this directory with libcommon.a
LDADD = ../common/libcommon.la libupsclient.la $(NETLIBS)
LDADD = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS)
if WITH_SSL
LDADD += $(LIBSSL_LIBS)
endif
Expand Down Expand Up @@ -45,7 +51,7 @@ upslog_SOURCES = upslog.c upsclient.h upslog.h
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h

upssched_SOURCES = upssched.c upssched.h
upssched_LDADD = ../common/libcommon.la ../common/libparseconf.la $(NETLIBS)
upssched_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)

upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
Expand All @@ -56,7 +62,7 @@ upsstats_cgi_SOURCES = upsstats.c upsclient.h status.h upsstats.h \

# not LDADD.
libupsclient_la_SOURCES = upsclient.c upsclient.h
libupsclient_la_LIBADD = ../common/libcommonclient.la
libupsclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
if WITH_SSL
libupsclient_la_LIBADD += $(LIBSSL_LIBS)
endif
Expand Down
5 changes: 5 additions & 0 deletions common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ libparseconf_la_SOURCES = parseconf.c
# 'dist', and is only required for actual build, in which case
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
# be built before anything else
common.c: $(top_builddir)/include/nut_version.h

$(top_builddir)/include/nut_version.h:
@cd $(@D) && $(MAKE) -s $(@F)

libcommon_la_SOURCES = common.c state.c str.c upsconf.c
libcommonclient_la_SOURCES = common.c state.c str.c
# ensure inclusion of local implementation of missing systems functions
Expand Down
10 changes: 8 additions & 2 deletions drivers/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Network UPS Tools: drivers

# Make sure out-of-dir dependencies exist (especially when dev-building parts):
$(top_builddir)/common/libcommon.la \
$(top_builddir)/common/libparseconf.la \
$(top_builddir)/clients/libupsclient.la:
@cd $(@D) && $(MAKE) -s $(@F)

# by default, link programs in this directory with libcommon.la
# (libtool version of the static lib, in order to access LTLIBOBJS)
#FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON
LDADD_COMMON = ../common/libcommon.la ../common/libparseconf.la
LDADD_COMMON = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la
LDADD_DRIVERS = libdummy.la $(LDADD_COMMON)
LDADD_DRIVERS_SERIAL = libdummy_serial.la $(LDADD_DRIVERS) $(SERLIBS)

Expand Down Expand Up @@ -155,7 +161,7 @@ riello_ser_LDADD = $(LDADD) -lm
# dummy
dummy_ups_SOURCES = dummy-ups.c
dummy_ups_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/clients
dummy_ups_LDADD = $(LDADD_DRIVERS) ../clients/libupsclient.la
dummy_ups_LDADD = $(LDADD_DRIVERS) $(top_builddir)/clients/libupsclient.la
if WITH_SSL
dummy_ups_CFLAGS += $(LIBSSL_CFLAGS)
dummy_ups_LDADD += $(LIBSSL_LIBS)
Expand Down
7 changes: 6 additions & 1 deletion server/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Network UPS Tools: server

# Make sure out-of-dir dependencies exist (especially when dev-building parts):
$(top_builddir)/common/libcommon.la \
$(top_builddir)/common/libparseconf.la:
@cd $(@D) && $(MAKE) -s $(@F)

# 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.
Expand All @@ -10,7 +15,7 @@ endif
if WITH_SSL
AM_CFLAGS += $(LIBSSL_CFLAGS)
endif
LDADD = ../common/libcommon.la ../common/libparseconf.la $(NETLIBS)
LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
if WITH_WRAP
LDADD += $(LIBWRAP_LIBS)
endif
Expand Down
9 changes: 9 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ nutlogtest_LDADD = $(top_builddir)/common/libcommon.la
getvaluetest_SOURCES = getvaluetest.c $(top_srcdir)/drivers/hidparser.c
getvaluetest_LDADD = $(top_builddir)/common/libcommon.la

# Make sure out-of-dir dependencies exist (especially when dev-building parts):
$(top_builddir)/common/libcommon.la:
@cd $(@D) && $(MAKE) -s $(@F)

### Optional tests which can not be built everywhere
# List of src files for CppUnit tests
CPPUNITTESTSRC = example.cpp nutclienttest.cpp
Expand All @@ -43,6 +47,11 @@ cppunittest_LDFLAGS = $(CPPUNIT_LIBS)
cppunittest_LDADD = $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la
cppunittest_SOURCES = $(CPPUNITTESTSRC) $(CPPUNITTESTERSRC)

# Make sure out-of-dir C++ dependencies exist (especially when dev-building
# only some parts of NUT):
$(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la:
@cd $(@D) && $(MAKE) -s $(@F)

else !HAVE_CPPUNIT
# Just redistribute test source into tarball

Expand Down
21 changes: 17 additions & 4 deletions tools/nut-scanner/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ BUILT_SOURCES = $(NUT_SCANNER_DEPS)
$(NUT_SCANNER_DEPS):
cd ..; $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps

# Make sure out-of-dir dependencies exist (especially when dev-building parts):
$(top_builddir)/common/libcommon.la:
@cd $(@D) && $(MAKE) -s $(@F)

# do not hard depend on '../include/nut_version.h', since it blocks
# 'dist', and is only required for actual build, in which case
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
# be built before anything else
$(top_srcdir)/common/common.c nut-scanner.c: $(top_builddir)/include/nut_version.h

$(top_builddir)/include/nut_version.h:
@cd $(@D) && $(MAKE) -s $(@F)

# Only build nut-scanner, and its library, if libltdl was found (required!)
if WITH_LIBLTDL
bin_PROGRAMS = nut-scanner
Expand All @@ -22,9 +35,9 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \
nutscan-device.c nutscan-ip.c nutscan-display.c \
nutscan-init.c scan_usb.c scan_snmp.c scan_xml_http.c \
scan_avahi.c scan_eaton_serial.c nutscan-serial.c \
../../drivers/serial.c \
../../drivers/bcmxcp_ser.c \
../../common/common.c ../../common/str.c
$(top_srcdir)/drivers/serial.c \
$(top_srcdir)/drivers/bcmxcp_ser.c \
$(top_srcdir)/common/common.c $(top_srcdir)/common/str.c
libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS)
#
# Below we set API versions of public libraries
Expand All @@ -38,7 +51,7 @@ libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL

nut_scanner_SOURCES = nut-scanner.c
nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include
nut_scanner_LDADD = ../../common/libcommon.la libnutscan.la
nut_scanner_LDADD = $(top_builddir)/common/libcommon.la libnutscan.la

if WITH_SSL
libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS)
Expand Down