aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-03-14 11:05:35 +0100
committertomsmeding <tom.smeding@gmail.com>2017-03-14 11:05:35 +0100
commit54064158d84fc4006e651deb314cde156cc383e8 (patch)
treea534f160fe02b593143e03aaaf52f65513352c90 /Makefile
Register working
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8922662
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+CC = gcc
+CFLAGS = -Wall -Wextra -std=c11 -g -fwrapv
+LDFLAGS = -lsqlite3
+
+TARGETS = tomsg_server
+
+.PHONY: all clean remake
+
+# Clear all implicit suffix rules
+.SUFFIXES:
+
+# Don't delete intermediate files
+.SECONDARY:
+
+all: $(TARGETS)
+
+clean:
+ rm -f $(TARGETS) *.o *.sql.h
+
+remake: clean
+ $(MAKE) all
+
+
+$(TARGETS): $(patsubst %.c,%.o,$(wildcard *.c))
+ $(CC) -o $@ $^ $(LDFLAGS)
+
+%.o: %.c $(wildcard *.h) $(patsubst %.sql,%.sql.h,$(wildcard *.sql))
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+%.sql.h: %.sql
+ xxd -i $^ $@