summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
commita239f9feadd015fa91d391df01365dcade8ce503 (patch)
tree979554817c2069a525e94e2ad5f6346b53e19eb5 /Makefile
parent9f2fccfdc2eae83efbde1e3ae94a2cc220537983 (diff)
Threaded communication (icmpd)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 5 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index b1de31f..eadce97 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
CC = gcc
-CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv
+CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv -pthread
+LDFLAGS = -pthread
-TARGETS = server client
+TARGETS = server client serverd clientd
SOURCES = $(filter-out $(patsubst %,%.c,$(TARGETS)),$(wildcard *.c))
OBJECTS = $(patsubst %.c,%.o,$(SOURCES))
@@ -14,11 +15,8 @@ clean:
rm -f $(TARGETS) *.o
-server: server.o $(OBJECTS)
- $(CC) $(CFLAGS) $^ -o $@
-
-client: client.o $(OBJECTS)
- $(CC) $(CFLAGS) $^ -o $@
+$(TARGETS): %: %.o $(OBJECTS)
+ $(CC) $^ -o $@ $(LDFLAGS)
%.o: %.c $(wildcard *.h)
$(CC) $(CFLAGS) -c -o $@ $<