diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 0000000..826ee43 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,37 @@ +## Build Instructions for various platforms + +### Linux + + - `make static_lib` + - `make tests` + +### macOS + + - `make static_lib` + - `make macos_framework` + - `make tests` + +### iOS + + - `make ios_framework` + +### FreeBSD + + - `make static_lib` + - `make tests` + +### Windows + + - [Prebuilt Binaries\Libraries Here]() + + Otherwise, + + - Set up [mingw-w64](https://mingw-w64.org/doku.php) + - Install a copy of [MSYS](http://www.mingw.org/wiki/MSYS) + - Run `msys.bat` (should be in the base directory of your MSYS installation) + - Tell it where your `mingw-64` installation is + - `make static_lib` + - `make tests` + + This will output binaries to `build/mingw-w64` + diff --git a/README.md b/README.md index ec9fab7..d4421ad 100644 --- a/README.md +++ b/README.md @@ -19,44 +19,31 @@ Pre-Built Binaries Here: [zerotier.com/download.shtml](https://zerotier.com/down ``` #include "libzt.h" -char *str = "welcome to the machine"; -char *nwid = "c7cd7c9e1b0f52a2"; +char *str = "welcome to the machine"; +char *nwid = "c7cd7c9e1b0f52a2"; // network to join +char *pasth = "zt1" // path where this node's keys and configs will be stored -zts_simple_start("./zt", nwid); -fd = zts_socket(AF_INET, SOCK_STREAM, 0); +zts_simple_start(path, nwid); +int fd = zts_socket(AF_INET, SOCK_STREAM, 0); zts_connect(fd, (const struct sockaddr *)addr, sizeof(addr)); zts_write(fd, str, strlen(str)); zts_close(fd); ``` -Bindings for [other languages and platforms](examples). +Bindings for various [LANGUAGES](examples) *** -### Building +### Building (linux, macos, bsd, win, ios) -All build targets will output to `build/`. + Complete instructions here [PLATFORMS](BUILDING.md) + All build targets will output to `build/` -### Static Library - - `make static_lib` - -### iOS App Framework - - `make ios_app_framework` - -### macOS App Framework - - `make macos_app_framework` + - Static Library (linux, mac, win, bsd): `make static_lib` + - iOS App Framework: `make ios_app_framework` + - macOS App Framework: `make macos_app_framework` *** -### Using Language Bindings - - `SDK_LANG_JNI=1`: Enable JNI bindings for Java (produces a shared library) - - `SDK_LANG_CSHARP=1` - - `SDK_LANG_PYTHON=1` - - `SDK_LANG_GO=1` - -### Debugging flags - - `SDK_DEBUG=1` - For debugging libzt - - `ZT_DEBUG=1` - For debugging the ZeroTier core protocol - -### Tests +### Testing and Debugging - See [TESTING.md](TESTING.md) \ No newline at end of file diff --git a/TESTING.md b/TESTING.md index 101a38c..a0b9792 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,5 +1,9 @@ ## Testing via [selftest.cpp](test/selftest.cpp) +### Enabling debug output + - `SDK_DEBUG=1` - For debugging libzt + - `ZT_DEBUG=1` - For debugging the ZeroTier core protocol + After building the static library, you can run: - `make tests` diff --git a/examples/README.md b/examples/README.md index 9b78b98..efb6b2f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1 +1,7 @@ -Language bindings \ No newline at end of file +Language bindings + +### Using Language Bindings + - `SDK_LANG_JNI=1`: Enable JNI bindings for Java (produces a shared library) + - `SDK_LANG_CSHARP=1` + - `SDK_LANG_PYTHON=1` + - `SDK_LANG_GO=1` \ No newline at end of file