-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (34 loc) · 1.92 KB
/
Copy pathMakefile
File metadata and controls
49 lines (34 loc) · 1.92 KB
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
# cpp-http-server(https://github.com/thomascrmbz/cpp-http-server) library path
HTTP_LIB=../cpp-http-server
all: mkdir library_server library_client
library_client: mkdir http libs bin/websocket_client.o bin/frame.o bin/connection.o
ar -r bin/libWebSocketClient.a bin/websocket_client.o bin/lib/base64.o bin/lib/sha1.o bin/frame.o bin/connection.o
library_server: mkdir http libs bin/websocket_server.o bin/frame.o bin/connection.o
ar -r bin/libWebSocketServer.a bin/websocket_server.o bin/lib/base64.o bin/lib/sha1.o bin/frame.o bin/connection.o
http:
(cd $(HTTP_LIB); make library)
mkdir:
mkdir -p bin
mkdir -p bin/lib
bin/websocket_server.o: src/websocket_server.cpp src/websocket_server.h
g++ --std=c++11 -c src/websocket_server.cpp -I$(HTTP_LIB)/src -o bin/websocket_server.o
bin/websocket_client.o: src/websocket_client.cpp src/websocket_client.h
g++ --std=c++11 -c src/websocket_client.cpp -I$(HTTP_LIB)/src -o bin/websocket_client.o
bin/websocket_client.o: src/websocket_client.cpp src/websocket_client.h
g++ --std=c++11 -c src/websocket_client.cpp -I$(HTTP_LIB)/src -o bin/websocket_client.o
bin/frame.o: src/frame.cpp src/frame.h
g++ --std=c++11 -c src/frame.cpp -o bin/frame.o
bin/connection.o: src/connection.cpp src/connection.h
g++ --std=c++11 -c src/connection.cpp -I$(HTTP_LIB)/src -o bin/connection.o
libs:
g++ --std=c++11 -c src/lib/base64.cpp -o bin/lib/base64.o
g++ --std=c++11 -c src/lib/sha1.cpp -o bin/lib/sha1.o
example: example_server example_client
example_client: all
g++ -c --std=c++11 example_client.cpp -I./src -I$(HTTP_LIB)/src -o bin/example_client.o
g++ --std=c++11 bin/example_client.o -L./bin -lWebSocketClient -L$(HTTP_LIB)/bin -lHTTP -o example_client.out
example_server: all
g++ -c --std=c++11 example_server.cpp -I./src -I$(HTTP_LIB)/src -o bin/example_server.o
g++ --std=c++11 bin/example_server.o -L./bin -lWebSocketServer -L$(HTTP_LIB)/bin -lHTTP -o example_server.out
clean:
rm -rf bin/*