-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 729 Bytes
/
Makefile
File metadata and controls
40 lines (29 loc) · 729 Bytes
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
.POSIX:
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
# Use system flags
GR_CFLAGS = $(CFLAGS) -Wall -Wextra -Werror -pedantic -std=c99
GR_LDFLAGS = $(LDFLAGS) -static -s
BIN = git-restrict
MAN = $(BIN).1
OBJ = $(BIN:=.o)
all: $(BIN)
.c.o:
$(CC) -c $(GR_CFLAGS) $<
$(BIN): $(OBJ)
$(CC) $(OBJ) $(GR_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 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
rm -f $(DESTDIR)$(MANPREFIX)/man1/$(MAN)
test: all
@./test.sh
.PHONY: all clean install uninstall test