]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Makefile: fix install_udev target by s/TARGETS/MAKECMDGOALS/
authorFlorian Schmaus <flo@geekplace.eu>
Thu, 20 Oct 2022 08:48:54 +0000 (10:48 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Thu, 20 Oct 2022 09:19:56 +0000 (11:19 +0200)
A Gentoo user reported [1] that the 'install_udev' target would
install a systemd-flavored udev rules, despite the 'systemd' target
not being selected. Replacing 'TARGETS' with 'MAKECMDGOALS' in the
Makefile rule fixes this .

I am not sure where the TARGETS variable origniates from, but GNU make
uses MAKECMDGOALS (FreeBSD make uses .TARGETS, i.e., with a leading
dot). So if further portability between make variants is required,
then this needs to be adjusted.

1: https://bugs.gentoo.org/803545#c3
Fixes: ae1f18a06039 ("udev rule: Dynamically call either systemd or autorandr directly depending on whether systemd unit is available")
Makefile

index f51aa0f05a7928db4e4797a448b270712bc5078f..99e17ba0ae31d05d4cd2d646c4380cc22fb84919 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -129,7 +129,7 @@ endif
 install_udev:
        $(if $(UDEV_RULES_DIR),,$(error UDEV_RULES_DIR is not defined))
        mkdir -p ${DESTDIR}/${UDEV_RULES_DIR}/
-       echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(TARGETS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
+       echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(MAKECMDGOALS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
        @echo
        @echo "To activate the udev rules, run this command as root:"
        @echo "    udevadm control --reload-rules"