summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-07-23 15:48:44 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-07-23 15:48:44 +0200
commit5722c47aa3402f1458da9eec332153a454a540b7 (patch)
treef1bfaa8c89dc39c6b9ae0bf7ff54eb524b1468eb /Makefile
Initial version
Working ping back and forth with specified data, and data arrives at the other party. Currently, the server uses nflog to get the pings, which: 1. requires iptables settings to work; 2. buffers and collects messages for a second. Both are suboptimal, and I believe raw sockets can improve on this.
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 $@ $<