blob: e66c045f01093f776f7d58e50de48e408ce77486 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
|
.POSIX:
.SUFFIXES: .c .o
BIN = rf
VERSION = 0.0.3
OBJS = rf.o
MANPAGE = rf.1
CC = cc
DEPS = config.h
LIBS =
INC =
CFLAGS := ${CFLAGS}
CFLAGS += -std=c99 \
-Wpedantic \
-Wall \
-Werror=format-security \
-Werror=implicit-function-declaration \
-O2 \
-fstack-protector-strong \
-fpie \
-D_FORTIFY_SOURCE=2 \
-D_DEFAULT_SOURCE \
-DVERSION='"$(VERSION)"' \
-DNAME='"$(BIN)"' \
$(INC) $(LIBS)
PREFIX ?= /usr/local
build: $(BIN)
$(BIN): $(OBJS)
$(CC) $(BIN).c $(CFLAGS) -o $(BIN)
debug: $(OBJS)
$(CC) $(BIN).c $(CFLAGS) -g -o $(BIN)
test: clean debug
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) ^$
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) ^$$
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) rf
static: $(OBJS)
$(CC) $(BIN).c $(CFLAGS) -static -o $(BIN)
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
install: build
install -Dm755 $(BIN) $(DESTDIR)$(PREFIX)/bin/
install -Dm444 $(MANPAGE) $(DESTDIR)$(PREFIX)/man/man1/$(MANPAGE)
clean:
rm -vf $(BIN) *.o
|