summaryrefslogtreecommitdiff
path: root/Makefile
blob: ca910b35f46c44c2d99219c358411c1eb50de842 (plain)
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
CC      ?= cc
CFLAGS  += -std=c11 -pedantic -Wall -Wextra -Os
LDFLAGS += -s

PREFIX  ?= /usr
BINDIR   = $(PREFIX)/bin
MANDIR   = $(PREFIX)/share/man

all: stik

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

# setuid root, runnable by root and the group plugdev only; stik also
# checks plugdev membership itself
install: all
	install -Dm4750 -o root -g plugdev stik $(DESTDIR)$(BINDIR)/stik
	install -Dm0644 stik.8 $(DESTDIR)$(MANDIR)/man8/stik.8

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/stik
	rm -f $(DESTDIR)$(MANDIR)/man8/stik.8

lint:
	mandoc -Tlint stik.8

clean:
	rm -f stik

.PHONY: all clean install uninstall lint