summaryrefslogtreecommitdiff
path: root/Makefile
blob: 150c5c42470605cd7f9fcef470767bba35654f94 (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
CC ?= gcc
CFLAGS ?= -ansi -Wall -Werror
OBJ = roll.o
BIN = roll
PREFIX ?= /usr

prog: $(OBJ)
	$(CC) $(CFLAGS) $(OBJ) -o $(BIN)

%.o: %.c
	$(CC) $(CFLAGS) -c $<

install: prog
	mkdir -p ${PREFIX}/bin
	install -m 755 -o root -g root -s ${BIN} ${PREFIX}/bin

format:
	clang-format -i *.c

clean:
	rm *.o
	rm $(BIN)

.PHONY: install format clean