summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan Wolff <janw@mailbox.org>2021-07-08 20:31:34 +0200
committerJan Wolff <janw@mailbox.org>2021-07-08 20:31:34 +0200
commit16399fab9e592cf1e12f1fd56c11f12ae9bc575f (patch)
treee428891a59451187c8ce1866332701973fc0cf3a /Makefile
initial commit
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..7055763
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+CC ?= gcc
+CFLAGS ?= -std=c99 -Wall -Werror
+OBJ = wakeup.o
+BIN = wakeup
+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