2019-07-24 17:17:14 +01:00
|
|
|
BORINGSSL_DIR=/home/hdc/repos/cloudflare/boringssl
|
|
|
|
BORINGSSL_LIB=$(BORINGSSL_DIR)/build.64bitRel/
|
|
|
|
|
|
|
|
CC = clang
|
|
|
|
SRCDIR = src
|
|
|
|
OBJDIR = obj
|
2019-07-29 13:03:43 +01:00
|
|
|
DBG ?= 0
|
2019-07-24 17:17:14 +01:00
|
|
|
|
|
|
|
ifeq ($(DBG),1)
|
|
|
|
DEBUG = -DDEBUG -g -O0
|
|
|
|
else
|
2019-08-19 11:27:42 +01:00
|
|
|
DEBUG = -O3 -g
|
2019-07-24 17:17:14 +01:00
|
|
|
endif
|
|
|
|
|
2019-08-20 11:24:26 +01:00
|
|
|
CFLAGS = -std=c99 -D_POSIX_C_SOURCE=199309L
|
2019-07-24 17:17:14 +01:00
|
|
|
CFLAGS+= $(DEBUG)
|
|
|
|
CFLAGS+= -I$(BORINGSSL_DIR)/ -I$(BORINGSSL_DIR)/include
|
|
|
|
|
|
|
|
LDFLAGS = -L$(BORINGSSL_LIB)/crypto -L$(BORINGSSL_LIB)/ssl
|
|
|
|
LDFLAGS+= -lssl -lcrypto -lpthread
|
|
|
|
|
|
|
|
all: server client
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJDIR)
|
|
|
|
rm -rf client server
|
|
|
|
|
|
|
|
client: common
|
|
|
|
$(CC) -c $(SRCDIR)/client.c -o $(OBJDIR)/client.o $(CFLAGS)
|
|
|
|
$(CC) -o client $(OBJDIR)/client.o $(OBJDIR)/common.o $(LDFLAGS)
|
|
|
|
|
|
|
|
server: common
|
|
|
|
$(CC) -c $(SRCDIR)/server.c -o $(OBJDIR)/server.o $(CFLAGS)
|
|
|
|
$(CC) -o server $(OBJDIR)/server.o $(OBJDIR)/common.o $(LDFLAGS)
|
|
|
|
|
|
|
|
common:
|
|
|
|
mkdir -p $(OBJDIR)
|
|
|
|
$(CC) -c $(SRCDIR)/common.c -o $(OBJDIR)/common.o $(CFLAGS)
|