Gordons Projects

--> Projects Top-Level GIT

Makefiles: Honour WIRINGPI_SUDO=0
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Sep 2015 17:17:36 +0000 (17:17 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Sep 2015 19:38:20 +0000 (20:38 +0100)
This makes it possible for the caller of ./build to suppress the
chown/chmod of the gpio utility.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
gpio/Makefile

index 095ec48..fa78421 100644 (file)
@@ -73,8 +73,10 @@ tags:        $(SRC)
 install: gpio
        $Q echo "[Install]"
        $Q cp gpio              $(DESTDIR)$(PREFIX)/bin
 install: gpio
        $Q echo "[Install]"
        $Q cp gpio              $(DESTDIR)$(PREFIX)/bin
+ifneq ($(WIRINGPI_SUID),0)
        $Q chown root.root      $(DESTDIR)$(PREFIX)/bin/gpio
        $Q chmod 4755           $(DESTDIR)$(PREFIX)/bin/gpio
        $Q chown root.root      $(DESTDIR)$(PREFIX)/bin/gpio
        $Q chmod 4755           $(DESTDIR)$(PREFIX)/bin/gpio
+endif
        $Q mkdir -p             $(DESTDIR)$(PREFIX)/man/man1
        $Q cp gpio.1            $(DESTDIR)$(PREFIX)/man/man1
 
        $Q mkdir -p             $(DESTDIR)$(PREFIX)/man/man1
        $Q cp gpio.1            $(DESTDIR)$(PREFIX)/man/man1