aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 1f59519e6fc4d4ea888821f17755695f5c5c97b1 (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
31
32
33
34
35
36
37
PREFIX = /usr/local

CFLAGS = -std=c99 -Wall -Wextra -pedantic -O0 -ggdb

BIN = rpt
SRC = rpt.c
OBJ = rpt.o

MAN_SRC = rpt.1
MAN_PAGE = rpt.1.gz

.PHONY: all compile man clean install uninstall

all: compile man

compile: $(BIN)

$(BIN): $(OBJ)
	cc $^ -o $@

%.o: %.c
	cc $(CFLAGS) -c $< -o $@

man: $(MAN_PAGE)

%.1.gz: %.1
	gzip -9 -c $< > $@

clean:
	rm -f $(BIN) $(OBJ) $(MAN_PAGE)

install: compile man
	cp -f $(BIN) $(PREFIX)/bin
	cp -f $(MAN_PAGE) $(PREFIX)/share/man/man1

uninstall:
	rm -f $(PREFIX)/bin/$(BIN) $(PREFIX)/share/man/man1/$(MAN_PAGE)