浏览代码

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
-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
 CC=gcc
7
 CC=gcc
6
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
8
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
9
 	$(CC) $(CFLAGS) -g -o $@ $^
11
 	$(CC) $(CFLAGS) -g -o $@ $^
10
 
12
 
11
 install: light
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
 uninstall:
19
 uninstall:
20
-	rm $(BINDIR)/light
20
+	rm -f $(BINDIR)/light
21
 	rm -rf /etc/light
21
 	rm -rf /etc/light
22
-	rm $(MANDIR)/light.1.gz
22
+	rm -f $(MANDIR)/light.1.gz
23
 
23
 
24
 clean:
24
 clean:
25
 	rm -vfr *~ light light.1.gz
25
 	rm -vfr *~ light light.1.gz

+ 1
- 1
README.md 查看文件

29
 
29
 
30
 ### Manual
30
 ### Manual
31
 
31
 
32
-`make && make install`
32
+`make && sudo make install`
33
 
33
 
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:
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
 ```