]> git.sur5r.net Git - sysbacklight/commitdiff
Add install target (#3)
authorlichtstrahlreiter <lichti@posteo.de>
Thu, 29 Nov 2018 08:51:46 +0000 (08:51 +0000)
committerJakob Haufe <sur5r@sur5r.net>
Thu, 29 Nov 2018 08:51:46 +0000 (08:51 +0000)
Add install target

This target installs sysbacklight for all users with setuid as the README suggests, supporting 'PREFIX' and 'DESTDIR' with 'PREFIX = /usr/local' as default.

Makefile

index 35969737b79bced1ee04e8442729d370f940b6e5..9b582efcb222e32c1dc476b20604db74260a9162 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 CFLAGS?=$(shell pkg-config --cflags libsysfs) -Wall -std=c99
 LDFLAGS?=$(shell pkg-config --libs libsysfs)
 CFLAGS?=$(shell pkg-config --cflags libsysfs) -Wall -std=c99
 LDFLAGS?=$(shell pkg-config --libs libsysfs)
+PREFIX ?= /usr/local
 
 all: sysbacklight
 
 
 all: sysbacklight
 
@@ -9,6 +10,11 @@ sysbacklight: sysbacklight.o
 %.o: %.c
        $(CC) -c -o $@ $(CFLAGS) $<
 
 %.o: %.c
        $(CC) -c -o $@ $(CFLAGS) $<
 
+install:
+       install -m 4755 sysbacklight $(DESTDIR)$(PREFIX)/bin 
+
+
+
 clean:
        rm -f sysbacklight sysbacklight.o
 
 clean:
        rm -f sysbacklight sysbacklight.o