forked from uNetworking/uWebSockets
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
33 lines (22 loc) · 742 Bytes
/
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
W = -Wall
OPT = -O2 -g -I/usr/local/include
STD = -std=c++17
CXXFLAGS = $(STD) $(OPT) $(W) -fPIC $(XCXXFLAGS)
INCS = -Isrc/
SRCS = src/Extensions.cpp src/Group.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp src/Epoll.cpp src/Room.cpp
OBJS := $(SRCS:.cpp=.o)
.PHONY: clean all install
all: libuWS.a libuWS.so
clean:
rm -f src/*.o libuWS.a libuWS.so
install:
$(eval PREFIX ?= /usr/local)
cp libuWS.a libuWS.so $(PREFIX)/lib/
mkdir -p $(PREFIX)/include/uWS
cp src/*.h $(PREFIX)/include/uWS/
%.o : %.cpp %.d Makefile
$(CXX) $(CXXFLAGS) $(INCS) -c $< -o $@
libuWS.a: $(OBJS)
$(AR) rs $@ $(OBJS)
libuWS.so: $(OBJS)
$(CXX) $(LDFLAGS) -shared -o $@ $(OBJS)