瀏覽代碼

Merge branch 'master' into man-page

Joachim Nilsson 6 年之前
父節點
當前提交
206ded2c00
共有 2 個檔案被更改,包括 12 行新增12 行删除
  1. 11
    11
      Makefile
  2. 1
    1
      README.md

+ 11
- 11
Makefile 查看文件

@@ -1,6 +1,8 @@
1
-PREFIX=$(DESTDIR)/usr
2
-BINDIR=$(PREFIX)/bin
3
-MANDIR=$(PREFIX)/share/man/man1
1
+ifeq ($(PREFIX),)
2
+	PREFIX := /usr
3
+endif
4
+BINDIR=$(DESTDIR)$(PREFIX)/bin
5
+MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1
4 6
 
5 7
 CC=gcc
6 8
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
@@ -9,17 +11,15 @@ light: src/helpers.c src/light.c src/main.c
9 11
 	$(CC) $(CFLAGS) -g -o $@ $^
10 12
 
11 13
 install: light
12
-	mkdir -p $(BINDIR)
13
-	cp -f ./light $(BINDIR)/light
14
-	chown root $(BINDIR)/light
15
-	chmod 4755 $(BINDIR)/light
16
-	mkdir -p $(MANDIR)
17
-	cp -f light.1 $(MANDIR)
14
+	install -dZ $(BINDIR)
15
+	install -DZ -m 4755 ./light -t $(BINDIR)
16
+	install -dZ $(MANDIR)
17
+	install -DZ light.1 -t $(MANDIR)
18 18
 
19 19
 uninstall:
20
-	rm $(BINDIR)/light
20
+	rm -f $(BINDIR)/light
21 21
 	rm -rf /etc/light
22
-	rm $(MANDIR)/light.1.gz
22
+	rm -f $(MANDIR)/light.1.gz
23 23
 
24 24
 clean:
25 25
 	rm -vfr *~ light light.1.gz

+ 1
- 1
README.md 查看文件

@@ -29,7 +29,7 @@ I recommend you go with light-git as you might miss important features and bugfi
29 29
 
30 30
 ### Manual
31 31
 
32
-`make && make install`
32
+`make && sudo make install`
33 33
 
34 34
 **Optional:** If you want to use udev rules instead of suid to manage sysfs permissions, you may skip the `make install` step and instead add something like the following to `/etc/udev/rules.d/90-backlight.rules` after copying your binaries:
35 35
 ```