Created
May 23, 2017 00:15
-
-
Save IanBoyanZhang/c5620b0255a50989894113eb22fa7655 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPP_SHARED := -std=c++11 -O3 -I src -shared -fPIC src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp src/uUV.cpp | |
CPP_EXPERIMENTAL := -DUSE_MICRO_UV | |
CPP_OPENSSL_OSX := -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include | |
CPP_OSX := -stdlib=libc++ -mmacosx-version-min=10.7 -undefined dynamic_lookup $(CPP_OPENSSL_OSX) | |
default: | |
make `(uname -s)` | |
Linux: | |
$(CXX) $(CPPFLAGS) $(CFLAGS) $(CPP_SHARED) -s -o libuWS.so | |
Darwin: | |
$(CXX) $(CPPFLAGS) $(CFLAGS) $(CPP_SHARED) $(CPP_OSX) -o libuWS.dylib | |
.PHONY: install | |
install: | |
make install`(uname -s)` | |
.PHONY: installLinux | |
installLinux: | |
if [ -d "/usr/lib64" ]; then cp libuWS.so /usr/lib64/; else cp libuWS.so /usr/lib/; fi | |
mkdir -p /usr/include/uWS | |
cp src/*.h /usr/include/uWS/ | |
.PHONY: installDarwin | |
installDarwin: | |
cp libuWS.dylib /usr/local/lib/ | |
mkdir -p /usr/local/include/uWS | |
cp src/*.h /usr/local/include/uWS/ | |
.PHONY: clean | |
clean: | |
rm -f libuWS.so | |
rm -f libuWS.dylib | |
.PHONY: tests | |
tests: | |
$(CXX) $(CPP_OPENSSL_OSX) -std=c++11 -O3 tests/main.cpp -Isrc -o testsBin -lpthread -luWS -lssl -lcrypto -lz -luv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment