Fix up libpthread linking error with dtls/server-dtls-threaded

Signed-off-by: Liu Qun <517067180@qq.com>
pull/149/head
Liu Qun 2019-05-06 17:17:07 +08:00
parent 87307e2996
commit c08ba4464d
1 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,10 @@ all: $(TARGETS)
debug: CFLAGS+=$(DEBUG_FLAGS) debug: CFLAGS+=$(DEBUG_FLAGS)
debug: all debug: all
# add the -pthread flag and -lpthread lib to any threaded examples
%-threaded: CFLAGS+=-pthread
%-threaded: LIBS+=-lpthread
# build template # build template
%: %.c %: %.c
$(CC) -o $@ $< $(CFLAGS) $(LIBS) $(CC) -o $@ $< $(CFLAGS) $(LIBS)