summaryrefslogtreecommitdiff
path: root/server/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-10-11 08:32:09 +0200
committertomsmeding <tom.smeding@gmail.com>2017-10-11 08:32:09 +0200
commit7549d07933091417b225d094c1648e1382287f93 (patch)
treef533b99745beb808d1cbe226a38e0232076d7b53 /server/Makefile
Initial
Diffstat (limited to 'server/Makefile')
-rw-r--r--server/Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/Makefile b/server/Makefile
new file mode 100644
index 0000000..24cf554
--- /dev/null
+++ b/server/Makefile
@@ -0,0 +1,28 @@
+CC = gcc
+CFLAGS = -Wall -Wextra -std=c11 -g -O2 -fwrapv -I..
+LDFLAGS = -lz
+TARGET = pstat
+
+OBJDIR = obj
+
+.PHONY: all clean
+
+.SUFFIXES:
+
+all: $(TARGET)
+
+clean:
+ @echo "Cleaning"
+ @rm -f $(TARGET)
+ @rm -rf $(OBJDIR)
+
+
+$(OBJDIR)/%.o: %.c $(wildcard *.h)
+ @mkdir -p $(OBJDIR)
+ @echo "CC $<"
+ @$(CC) $(CFLAGS) -c -o $@ $<
+
+$(TARGET): $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard *.c))
+ @make -q -C .. || make -C .. --no-print-directory
+ @echo "LD -o $@"
+ @$(CC) -o $@ $^ $(wildcard ../$(OBJDIR)/*.o) $(LDFLAGS)