nut/drivers/Makefile.am

257 lines
8.7 KiB
Makefile
Raw Normal View History

2010-03-25 23:20:59 +00:00
# Network UPS Tools: drivers
2011-01-26 09:35:08 +00:00
# by default, link programs in this directory with libcommon.la
# (libtool version of the static lib, in order to access LTLIBOBJS)
2010-03-25 23:20:59 +00:00
#FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON
2011-01-26 09:35:08 +00:00
LDADD_COMMON = ../common/libcommon.la ../common/libparseconf.la
2010-03-25 23:20:59 +00:00
LDADD_DRIVERS = $(LDADD_COMMON) main.o dstate.o
LDADD_HAL_DRIVERS = $(LDADD_COMMON) libnuthalmain.a
LDADD_DRIVERS_SERIAL = $(LDADD_DRIVERS) $(SERLIBS) serial.o
# most targets are drivers, so make this the default
LDADD = $(LDADD_DRIVERS_SERIAL)
# 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_HAL
AM_CFLAGS += $(LIBHAL_CFLAGS)
endif
if WITH_USB
AM_CFLAGS += $(LIBUSB_CFLAGS)
endif
if WITH_SNMP
AM_CFLAGS += $(LIBNETSNMP_CFLAGS)
endif
2012-01-24 10:22:33 +00:00
if WITH_NEON
2010-03-25 23:20:59 +00:00
AM_CFLAGS += $(LIBNEON_CFLAGS)
endif
if WITH_LIBPOWERMAN
AM_CFLAGS += $(LIBPOWERMAN_CFLAGS)
endif
2011-09-29 18:14:46 +00:00
if WITH_IPMI
AM_CFLAGS += $(LIBIPMI_CFLAGS)
endif
2010-03-25 23:20:59 +00:00
2011-09-29 18:14:46 +00:00
SERIAL_DRIVERLIST = bcmxcp belkin belkinunv bestfcom \
2010-03-25 23:20:59 +00:00
bestfortress bestuferrups bestups dummy-ups etapro everups \
2011-01-26 09:35:08 +00:00
gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys \
2012-08-12 21:39:31 +00:00
oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino \
2010-03-25 23:20:59 +00:00
safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel \
2011-09-29 18:14:46 +00:00
blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old
2010-03-25 23:20:59 +00:00
SNMP_DRIVERLIST = snmp-ups
2011-01-26 09:35:08 +00:00
USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
2010-03-25 23:20:59 +00:00
blazer_usb richcomm_usb
USB_DRIVERLIST = $(USB_LIBUSB_DRIVERLIST)
HAL_DRIVERLIST = hald-addon-usbhid-ups hald-addon-bcmxcp_usb \
2011-01-26 09:35:08 +00:00
hald-addon-tripplite_usb hald-addon-blazer_usb
2010-03-25 23:20:59 +00:00
NEONXML_DRIVERLIST = netxml-ups
2012-08-12 21:39:31 +00:00
MACOSX_DRIVERLIST = macosx-ups
2010-03-25 23:20:59 +00:00
# distribute all drivers, even ones that are not built by default
2012-08-12 21:39:31 +00:00
EXTRA_PROGRAMS = $(SERIAL_DRIVERLIST) $(SNMP_DRIVERLIST) $(USB_DRIVERLIST) $(NEONXML_DRIVERLIST) $(MACOSX_DRIVERLIST)
2010-03-25 23:20:59 +00:00
# construct the list of drivers to build
if SOME_DRIVERS
driverexec_PROGRAMS = $(DRIVER_BUILD_LIST)
else
driverexec_PROGRAMS =
if WITH_SERIAL
driverexec_PROGRAMS += $(SERIAL_DRIVERLIST)
endif
if WITH_SNMP
driverexec_PROGRAMS += $(SNMP_DRIVERLIST)
endif
if WITH_USB
driverexec_PROGRAMS += $(USB_LIBUSB_DRIVERLIST)
endif
if WITH_HAL
halexecdir = $(HAL_CALLOUTS_PATH)
halexec_PROGRAMS = $(HAL_DRIVERLIST)
endif
2012-01-24 10:22:33 +00:00
if WITH_NEON
2010-03-25 23:20:59 +00:00
driverexec_PROGRAMS += $(NEONXML_DRIVERLIST)
endif
if WITH_LIBPOWERMAN
driverexec_PROGRAMS += powerman-pdu
endif
2011-09-29 18:14:46 +00:00
if WITH_IPMI
driverexec_PROGRAMS += nut-ipmipsu
endif
2012-08-12 21:39:31 +00:00
if WITH_MACOSX
driverexec_PROGRAMS += $(MACOSX_DRIVERLIST)
endif
2010-03-25 23:20:59 +00:00
else
driverexec_PROGRAMS += skel
endif
# always build upsdrvctl
driverexec_PROGRAMS += upsdrvctl
# ==========================================================================
# Driver build details
# upsdrvctl: the all-singing all-dancing driver control program
upsdrvctl_SOURCES = upsdrvctl.c
upsdrvctl_LDADD = $(LDADD_COMMON)
# serial drivers: all of them use standard LDADD and CFLAGS
2011-09-29 18:14:46 +00:00
apcsmart_SOURCES = apcsmart.c apcsmart_tabs.c
apcsmart_old_SOURCES = apcsmart-old.c
2010-03-25 23:20:59 +00:00
bcmxcp_SOURCES = bcmxcp.c bcmxcp_ser.c
2011-01-26 09:35:08 +00:00
bcmxcp_LDADD = $(LDADD) -lm
2010-03-25 23:20:59 +00:00
belkin_SOURCES = belkin.c
belkinunv_SOURCES = belkinunv.c
bestfcom_SOURCES = bestfcom.c
bestuferrups_SOURCES = bestuferrups.c
bestups_SOURCES = bestups.c
blazer_ser_SOURCES = blazer.c blazer_ser.c
blazer_ser_LDADD = $(LDADD) -lm
etapro_SOURCES = etapro.c
everups_SOURCES = everups.c
gamatronic_SOURCES = gamatronic.c
genericups_SOURCES = genericups.c
isbmex_SOURCES = isbmex.c
isbmex_LDADD = $(LDADD) -lm
ivtscd_SOURCES = ivtscd.c
liebert_SOURCES = liebert.c
2011-01-26 09:35:08 +00:00
liebert_esp2_SOURCES = liebert-esp2.c
2010-03-25 23:20:59 +00:00
masterguard_SOURCES = masterguard.c
metasys_SOURCES = metasys.c
2012-08-12 21:39:31 +00:00
oldmge_shut_SOURCES = mge-shut.c hidparser.c
2010-03-25 23:20:59 +00:00
mge_utalk_SOURCES = mge-utalk.c
microdowell_SOURCES = microdowell.c
oneac_SOURCES = oneac.c
optiups_SOURCES = optiups.c
powercom_SOURCES = powercom.c
powercom_LDADD = $(LDADD) -lm
powerpanel_SOURCES = powerpanel.c powerp-bin.c powerp-txt.c
powerpanel_LDADD = $(LDADD) -lm
rhino_SOURCES = rhino.c
rhino_LDADD = $(LDADD) -lm
safenet_SOURCES = safenet.c
solis_SOURCES = solis.c
tripplite_SOURCES = tripplite.c
tripplite_LDADD = $(LDADD) -lm
tripplitesu_SOURCES = tripplitesu.c
upscode2_SOURCES = upscode2.c
upscode2_LDADD = $(LDADD) -lm
victronups_SOURCES = victronups.c
# non-serial drivers: these use custom LDADD and/or CFLAGS
# dummy
dummy_ups_SOURCES = dummy-ups.c
dummy_ups_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/clients
dummy_ups_LDADD = $(LDADD_DRIVERS) ../clients/libupsclient.la
if WITH_SSL
dummy_ups_CFLAGS += $(LIBSSL_CFLAGS)
2011-01-26 09:35:08 +00:00
dummy_ups_LDADD += $(LIBSSL_LIBS)
2010-03-25 23:20:59 +00:00
endif
# Clone drivers
clone_SOURCES = clone.c
clone_outlet_SOURCES = clone-outlet.c
# sample skeleton driver
skel_SOURCES = skel.c
skel_LDADD = $(LDADD_DRIVERS)
# USB
USBHID_UPS_SUBDRIVERS = apc-hid.c belkin-hid.c cps-hid.c explore-hid.c \
2011-01-26 09:35:08 +00:00
liebert-hid.c mge-hid.c powercom-hid.c tripplite-hid.c idowell-hid.c
2010-03-25 23:20:59 +00:00
usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
usb-common.c $(USBHID_UPS_SUBDRIVERS)
2011-01-26 09:35:08 +00:00
usbhid_ups_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
2010-03-25 23:20:59 +00:00
tripplite_usb_SOURCES = tripplite_usb.c libusb.c usb-common.c
2011-01-26 09:35:08 +00:00
tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
2010-03-25 23:20:59 +00:00
bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
2011-01-26 09:35:08 +00:00
bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
2010-03-25 23:20:59 +00:00
blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
2011-01-26 09:35:08 +00:00
blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
2010-03-25 23:20:59 +00:00
richcomm_usb_SOURCES = richcomm_usb.c usb-common.c
2011-01-26 09:35:08 +00:00
richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
2010-03-25 23:20:59 +00:00
# HID-over-serial
2012-08-12 21:39:31 +00:00
mge_shut_SOURCES = usbhid-ups.c libshut.c libhid.c hidparser.c mge-hid.c
2010-03-25 23:20:59 +00:00
# per-target CFLAGS are necessary here
2012-08-12 21:39:31 +00:00
mge_shut_CFLAGS = $(AM_CFLAGS) -DSHUT_MODE
mge_shut_LDADD = $(LDADD)
2010-03-25 23:20:59 +00:00
# SNMP
snmp_ups_SOURCES = snmp-ups.c apc-mib.c baytech-mib.c compaq-mib.c eaton-mib.c \
2011-01-26 09:35:08 +00:00
ietf-mib.c mge-mib.c netvision-mib.c powerware-mib.c raritan-pdu-mib.c \
2012-01-24 10:22:33 +00:00
bestpower-mib.c cyberpower-mib.c
2011-01-26 09:35:08 +00:00
snmp_ups_LDADD = $(LDADD_DRIVERS) $(LIBNETSNMP_LIBS)
2010-03-25 23:20:59 +00:00
# HAL
hald_addon_usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
$(USBHID_UPS_SUBDRIVERS)
2011-01-26 09:35:08 +00:00
hald_addon_usbhid_ups_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
2010-03-25 23:20:59 +00:00
hald_addon_tripplite_usb_SOURCES = tripplite_usb.c libusb.c
2011-01-26 09:35:08 +00:00
hald_addon_tripplite_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
2010-03-25 23:20:59 +00:00
hald_addon_bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c
2011-01-26 09:35:08 +00:00
hald_addon_bcmxcp_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
hald_addon_blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c
hald_addon_blazer_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
2010-03-25 23:20:59 +00:00
# NEON XML/HTTP
netxml_ups_SOURCES = netxml-ups.c mge-xml.c
2011-01-26 09:35:08 +00:00
netxml_ups_LDADD = $(LDADD_DRIVERS) $(LIBNEON_LIBS)
2010-03-25 23:20:59 +00:00
# Powerman
powerman_pdu_SOURCES = powerman-pdu.c
2011-01-26 09:35:08 +00:00
powerman_pdu_LDADD = $(LDADD) $(LIBPOWERMAN_LIBS)
2010-03-25 23:20:59 +00:00
2011-09-29 18:14:46 +00:00
# IPMI PSU
nut_ipmipsu_SOURCES = nut-ipmipsu.c
if WITH_FREEIPMI
nut_ipmipsu_SOURCES += nut-libfreeipmi.c
endif
nut_ipmipsu_LDADD = $(LDADD) $(LIBIPMI_LIBS)
2012-08-12 21:39:31 +00:00
# Mac OS X metadriver
macosx_ups_LDADD = $(LDADD_DRIVERS)
macosx_ups_LDFLAGS = $(LDFLAGS) -framework IOKit -framework CoreFoundation
macosx_ups_SOURCES = macosx-ups.c
2010-03-25 23:20:59 +00:00
# ----------------------------------------------------------------------
# List of header files. The purpose of this list is not dependency
# tracking (which is automatic), but to ensure these files are
# distributed by "make dist".
2011-09-29 18:14:46 +00:00
dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h \
2011-01-26 09:35:08 +00:00
bcmxcp_io.h belkin.h belkin-hid.h bestpower-mib.h blazer.h cps-hid.h dstate.h \
dstate-hal.h dummy-ups.h eaton-mib.h explore-hid.h gamatronic.h genericups.h \
2010-03-25 23:20:59 +00:00
hidparser.h hidtypes.h ietf-mib.h libhid.h libshut.h libusb.h liebert-hid.h \
2011-01-26 09:35:08 +00:00
main.h main-hal.h mge-hid.h mge-mib.h mge-shut.h mge-utalk.h \
2011-09-29 18:14:46 +00:00
mge-xml.h microdowell.h netvision-mib.h netxml-ups.h nut-ipmi.h oneac.h \
2010-03-25 23:20:59 +00:00
powercom.h powerpanel.h powerp-bin.h powerp-txt.h powerware-mib.h raritan-pdu-mib.h \
safenet.h serial.h snmp-ups.h solis.h tripplite.h tripplite-hid.h \
2011-09-29 18:14:46 +00:00
upshandler.h usb-common.h usbhid-ups.h powercom-hid.h compaq-mib.h idowell-hid.h \
2012-01-24 10:22:33 +00:00
apcsmart.h apcsmart_tabs.h apcsmart-old.h cyberpower-mib.h
2010-03-25 23:20:59 +00:00
# Define a dummy library so that Automake builds rules for the
# corresponding object files. This library is not actually built,
EXTRA_LIBRARIES = libdummy.a
libdummy_a_SOURCES = main.c dstate.c serial.c
# the nuthalmain library combines the code for main-hal.c and
# dstate-hal.c. It is necessary for Automake-technical reasons,
# because per-object CFLAGS can only be specified for libraries, not
# for object files. This library is used during the build process,
# and is not meant to be installed.
EXTRA_LIBRARIES += libnuthalmain.a
libnuthalmain_a_SOURCES = main-hal.c dstate-hal.c usb-common.c
MOSTLYCLEANFILES = libnuthalmain.a