summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..150c5c4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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