nut-debian/tools/Makefile.am

77 lines
2.9 KiB
Makefile
Raw Normal View History

2012-01-24 12:22:33 +02:00
# TODO: remove redundancies!
2010-03-26 01:20:59 +02:00
2012-06-01 16:55:19 +03:00
# XXX this does not work with Automake!!!
#
# In fact the very concept is entirely antithetical to Automake.
#
# SUBDIRS are explicitly a listing of all the directories that make
# must recurse into BEFORE processing the current directory.
#
# These python scripts must be moved into a sub-directory, and _only_
# executed IF they need to be, and all the nut-scanner sources need
# to be moved out of a sub-directory into this directory.
#
# Anyway, for the time being, we force build in ./ before nut-scanner,
# to have nutscan-{usb,snmp}.h built before going into the nut-scanner
# sub-directory
2011-09-29 21:14:46 +03:00
SUBDIRS = . nut-scanner
2015-04-30 16:53:36 +03:00
EXTRA_DIST = nut-usbinfo.pl nut-recorder.sh nut-ddl-dump.sh \
2016-07-18 03:11:41 +03:00
gitlog2changelog.py nut-snmpinfo.py driver-list-format.sh
2011-09-29 21:14:46 +03:00
all: nut-scanner-deps
2012-06-01 16:55:19 +03:00
# XXX these rules are all bogus! They cause un-named target files to
# always be rebuilt! None of that is ever the right way to use make,
# and especially not Automake. Explicit filenames and their exact
# dependencies need to be properly listed.
2011-09-29 21:14:46 +03:00
nut-scanner-deps:
@if python -c 1; then \
echo "Regenerating the SNMP helper files."; \
$(top_srcdir)/tools/nut-snmpinfo.py; \
else \
echo "----------------------------------------------------------------------"; \
echo "Warning: Python is not available."; \
echo "Skipping the SNMP helper files regeneration."; \
echo "----------------------------------------------------------------------"; \
fi
@if perl -e 1; then \
echo "Regenerating the USB helper files."; \
$(top_srcdir)/tools/nut-usbinfo.pl; \
else \
echo "----------------------------------------------------------------------"; \
echo "Warning: Perl is not available."; \
echo "Skipping the USB helper files regeneration."; \
echo "----------------------------------------------------------------------"; \
fi
2011-01-26 11:35:08 +02:00
2011-09-29 21:14:46 +03:00
# call the USB info script upon "make dist", and if Perl is present
# call the SNMP info script upon "make dist", and if Python is present
# and call both for building nut-scanner
2016-07-18 03:11:41 +03:00
# Also ensure that data/driver.list is well formatted
2010-03-26 01:20:59 +02:00
dist-hook:
2011-09-29 21:14:46 +03:00
@if python -c 1; then \
echo "Regenerating the SNMP helper files."; \
$(distdir)/nut-snmpinfo.py; \
else \
echo "----------------------------------------------------------------------"; \
echo "Warning: Python is not available."; \
echo "Skipping the SNMP helper files regeneration."; \
echo "----------------------------------------------------------------------"; \
fi
2011-01-26 11:35:08 +02:00
@if perl -e 1; then \
2010-03-26 01:20:59 +02:00
echo "Regenerating the USB helper files."; \
$(distdir)/nut-usbinfo.pl; \
else \
echo "----------------------------------------------------------------------"; \
echo "Warning: Perl is not available."; \
echo "Skipping the USB helper files regeneration."; \
echo "----------------------------------------------------------------------"; \
fi
2011-09-29 21:14:46 +03:00
2016-07-18 03:11:41 +03:00
@$(distdir)/driver-list-format.sh;
2011-09-29 21:14:46 +03:00
.PHONY: nut-scanner-deps nut-scanner-snmp-deps nut-scanner-usb-deps