-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
121 lines (101 loc) · 4.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
UNAME_S := $(shell uname -s)
# Set the MOZQUIC variables as below.
# notes in NSSHelper.cpp for tls 1.3 draft version and nss branch
#NSS_ROOT=/Users/ekr/dev/nss-dev/nss-sandbox3/
#NSS_PLATFORM=Darwin15.6.0_cc_64_DBG.OBJ
NSS_ROOT ?= $(realpath $(firstword $(wildcard $(CURDIR)/../nss $(CURDIR)/nss)))
NSS_PLATFORM ?= $(realpath $(NSS_ROOT)/../dist/$(shell cat $(NSS_ROOT)/../dist/latest))
NSS_INCLUDE ?= $(realpath $(NSS_ROOT)/../dist/public/nss)
NSS_LIBDIR ?= $(realpath $(NSS_PLATFORM)/lib)
NSPR_INCLUDE ?= $(NSS_PLATFORM)/include/nspr
CC = clang
CXX = clang++
LDFLAGS += -L$(NSS_LIBDIR) -lnss3 -lnssutil3 -lsmime3 -lssl3 -lplds4 -lplc4 -lnspr4 -lstdc++
CXXFLAGS += -std=c++0x -I$(NSS_INCLUDE) -I$(NSPR_INCLUDE)
CFLAGS += -I$(CURDIR) -Wall -Wextra -Werror -Wno-unused-parameter
CFLAGS += -Wno-unused-command-line-argument -Wno-format
CXXFLAGS += -Wno-unused-command-line-argument -Wall -Wextra -Werror -Wno-unused-parameter
CXXFLAGS += -g
CXXFLAGS += -fno-exceptions -fno-rtti -Wno-format
CFLAGS += -g
# For .h dependency management
CXXFLAGS += -MP -MD
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX
endif
OBJS += Ack.o
OBJS += API.o
OBJS += Handshake.o
OBJS += Logging.o
OBJS += MozQuic.o
OBJS += NSSHelper.o
OBJS += Packetization.o
OBJS += Ping.o
OBJS += Sender.o
OBJS += StatelessReset.o
OBJS += Streams.o
OBJS += Timer.o
OBJS += TransportExtension.o
all: client server qdrive-client qdrive-server
-include $(OBJS:.o=.d)
QDRIVESERVEROBJS += tests/qdrive/qdrive-common.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test000.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test001.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test002.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test003.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test004.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test005.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test006.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test007.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test008.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test009.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test010.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test011.o
# 12 was a pong test
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test013.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test014.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test015.o
QDRIVESERVEROBJS += tests/qdrive/qdrive-server-test016.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-common.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test000.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test001.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test002.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test003.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test004.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test005.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test006.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test007.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test008.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test009.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test010.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test011.o
# 12 was a pong test
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test013.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test014.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test015.o
QDRIVECLIENTOBJS += tests/qdrive/qdrive-client-test016.o
sample/server-files.o: sample/server.jpg sample/index.html sample/main.js
ifeq ($(UNAME_S),Darwin)
$(CC) -o ./sample/tmp.o -c ./sample/server-files.c
ld -r -sectcreate binary sampleserver_jpg sample/server.jpg -sectcreate binary sampleindex_html sample/index.html -sectcreate binary samplemain_js sample/main.js -o sample/server-files.o ./sample/tmp.o
else
ld -r -b binary -o $@ $^
endif
client: $(OBJS) sample/client.o
$(CC) $(LDFLAGS) -o $@ $^
server: $(OBJS) sample/server.o sample/server-files.o
$(CC) $(LDFLAGS) -o $@ $^
qdrive-client: $(OBJS) $(QDRIVECLIENTOBJS) tests/qdrive/qdrive-client.o
$(CC) $(LDFLAGS) -o $@ $^
qdrive-server: $(OBJS) $(QDRIVESERVEROBJS) tests/qdrive/qdrive-server.o
$(CC) $(LDFLAGS) -o $@ $^
.PHONY: clean
clean:
rm -f $(OBJS) client server qdrive-client qdrive-server *.d sample/*.o
rm -f tests/qdrive/qdrive-*.o
NSS_CONFIG=$(CURDIR)/sample/nss-config
.PHONY: run-server run-client
run-server: server
MOZQUIC_NSS_CONFIG=$(NSS_CONFIG) LD_LIBRARY_PATH=$(NSS_LIBDIR) ./$<
run-client: client
MOZQUIC_NSS_CONFIG=$(NSS_CONFIG) LD_LIBRARY_PATH=$(NSS_LIBDIR) ./$<