-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (33 loc) · 882 Bytes
/
Makefile
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
40
41
42
43
44
45
# sup: scale user privileges
# See LICENSE file for copyright and license details.
.POSIX:
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
# use system flags
SUP_CFLAGS = ${CFLAGS} -Wall -Werror -pedantic -std=c99
SUP_CPPFLAGS = ${CPPFLAGS}
SUP_LDFLAGS = ${LDFLAGS} -static -s
BIN = sup
MAN = $(BIN).1
OBJ = $(BIN:=.o) sha256.o
all: $(BIN)
$(OBJ): config.h
config.h:
cp config.def.h config.h
.c.o:
$(CC) -c $(SUP_CFLAGS) $(SUP_CPPFLAGS) $<
$(BIN): $(OBJ)
$(CC) $(OBJ) $(SUP_LDFLAGS) -o $@
clean:
rm -f $(BIN) $(OBJ)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1
chmod 4711 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
rm -f $(DESTDIR)$(MANPREFIX)/man1/$(MAN)
.PHONY: all clean install uninstall