aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f7ac48a838124b78f45cedc950dbe82761a0127e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)

BIN = adjbacklight test
OBJ = $(BIN:=.o)


all: adjbacklight test
$(OBJ): arg.h

.c.o:
	$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)

.o:
	$(CC) -o $@ $< $(LDFLAGS)

check: test
	./test.sh

install: adjbacklight
	mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
	mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1"
	cp -- adjbacklight "$(DESTDIR)$(PREFIX)/bin"
	cp -- adjbacklight.1 "$(DESTDIR)$(MANPREFIX)/man1"

post-install:
	chown -- '0:$(VIDEO_GROUP)' "$(DESTDIR)$(PREFIX)/bin/adjbacklight"
	chmod -- 4754 "$(DESTDIR)$(PREFIX)/bin/adjbacklight"

uninstall:
	-rm -- "$(DESTDIR)$(PREFIX)/bin/adjbacklight"
	-rm -- "$(DESTDIR)$(MANPREFIX)/man1/adjbacklight.1"

clean:
	-rm -rf -- adjbacklight test .testdir *.o *.su

.PHONY: all check install post-install uninstall clean