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..84683dd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+CC = gcc
+CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv
+
+TARGETS = server client
+
+SOURCES = $(filter-out $(patsubst %,%.c,$(TARGETS)),$(wildcard *.c))
+OBJECTS = $(patsubst %.c,%.o,$(SOURCES))
+
+.PHONY: all clean
+
+all: $(TARGETS)
+
+clean:
+ rm -f $(TARGETS) *.o
+
+
+server: server.o $(OBJECTS)
+ $(CC) $(CFLAGS) $^ -o $@ -lnetfilter_log
+
+client: client.o $(OBJECTS)
+ $(CC) $(CFLAGS) $^ -o $@
+
+%.o: %.c $(wildcard *.h)
+ $(CC) $(CFLAGS) -c -o $@ $<