summaryrefslogtreecommitdiff
path: root/make-mac.mk
diff options
context:
space:
mode:
Diffstat (limited to 'make-mac.mk')
-rw-r--r--make-mac.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/make-mac.mk b/make-mac.mk
index ffaf822d..5987aed5 100644
--- a/make-mac.mk
+++ b/make-mac.mk
@@ -79,6 +79,18 @@ one: $(OBJS) service/OneService.o one.o
$(CODESIGN) -f -s $(CODESIGN_APP_CERT) zerotier-one
$(CODESIGN) -vvv zerotier-one
+netcon: $(OBJS)
+ rm -f *.o
+ # Need to selectively rebuild one.cpp and OneService.cpp with ZT_SERVICE_NETCON and ZT_ONE_NO_ROOT_CHECK defined, and also NetconEthernetTap
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -DZT_SERVICE_NETCON -DZT_ONE_NO_ROOT_CHECK -Iext/lwip/src/include -Iext/lwip/src/include/ipv4 -Iext/lwip/src/include/ipv6 -o zerotier-netcon-service $(OBJS) service/OneService.cpp netcon/NetconEthernetTap.cpp one.cpp -x c netcon/RPC.c $(LDLIBS) -ldl
+ # Build netcon/liblwip.so which must be placed in ZT home for zerotier-netcon-service to work
+ cd netcon ; make -f make-liblwip.mk
+ # Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility
+ cd netcon ; gcc -O2 -Wall -std=c99 -fPIC -fno-common -dynamiclib -flat_namespace -DVERBOSE -D_GNU_SOURCE -DNETCON_INTERCEPT -I. -nostdlib -shared -o libzerotierintercept.so Intercept.c RPC.c -ldl
+ cp netcon/libzerotierintercept.so libzerotierintercept.so
+ ln -sf zerotier-netcon-service zerotier-cli
+ ln -sf zerotier-netcon-service zerotier-idtool
+
selftest: $(OBJS) selftest.o
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
$(STRIP) zerotier-selftest
@@ -92,12 +104,12 @@ mac-dist-pkg: FORCE
# For internal use only
official: FORCE
- make clean
+ make ZT_OFFICIAL_RELEASE=1 clean
make -j 4 ZT_OFFICIAL_RELEASE=1
make ZT_OFFICIAL_RELEASE=1 mac-dist-pkg
clean:
- rm -rf *.dSYM build-* *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-* mkworld
+ rm -rf netcon/*.so *.dSYM build-* *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-* mkworld
# For those building from source -- installs signed binary tap driver in system ZT home
install-mac-tap: FORCE