Makefile.mac 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. CC=gcc
  2. CXX=g++
  3. INCLUDES=-Iext/bin/libcrypto/include -Iext/jsoncpp/include
  4. DEFS=-DZT_ARCH="x86_combined" -DZT_OSNAME="mac" -DZT_TRACE
  5. # Uncomment for a release optimized universal binary build
  6. CFLAGS=-arch i386 -arch x86_64 -Wall -O3 -ftree-vectorize -fstack-protector -pthread -mmacosx-version-min=10.6 -DNDEBUG $(INCLUDES) $(DEFS)
  7. STRIP=strip
  8. # Uncomment for a debug build
  9. #CFLAGS=-Wall -g -pthread -DZT_TRACE -DZT_LOG_STDOUT $(INCLUDES) $(DEFS)
  10. #STRIP=echo
  11. CXXFLAGS=$(CFLAGS) -fno-rtti
  12. # We statically link against libcrypto since Apple has apparently decided
  13. # to deprecate it and may remove it in future OS releases.
  14. LIBS=ext/bin/libcrypto/mac-x86_combined/libcrypto.a
  15. include objects.mk
  16. all: one cli launcher mac-tap
  17. one: $(OBJS)
  18. $(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
  19. $(STRIP) zerotier-one
  20. cli: $(OBJS)
  21. $(CXX) $(CXXFLAGS) -o zerotier-cli cli.cpp $(OBJS) $(LIBS)
  22. $(STRIP) zerotier-cli
  23. selftest: $(OBJS)
  24. $(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.cpp $(OBJS) $(LIBS)
  25. $(STRIP) zerotier-selftest
  26. idtool: $(OBJS)
  27. $(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
  28. $(STRIP) zerotier-idtool
  29. packtool: $(OBJS)
  30. $(CXX) $(CXXFLAGS) -o zerotier-packtool packtool.cpp $(OBJS) $(LIBS)
  31. $(STRIP) zerotier-packtool
  32. mac-tap: FORCE
  33. cd mac-tap/tuntap ; make tap.kext
  34. install-mac-tap: FORCE
  35. mkdir -p /Library/Application\ Support/ZeroTier/One
  36. rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
  37. cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One
  38. chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
  39. launcher: FORCE
  40. $(CC) -Os -arch i386 -arch x86_64 -o zerotier-launcher launcher.c
  41. $(STRIP) zerotier-launcher
  42. launcher-fakebin:
  43. $(CC) $(CFLAGS) -DZEROTIER_FAKE_VERSION_MAJOR=1 -DZEROTIER_FAKE_VERSION_MINOR=2 -DZEROTIER_FAKE_VERSION_REV
  44. $(CC) $(CFLAGS) -DZEROTIER_FAKE_VERSION_MAJOR=1 -DZEROTIER_FAKE_VERSION_MINOR=2 -DZEROTIER_FAKE_VERSION_REV
  45. clean:
  46. rm -rf *.dSYM
  47. rm -f $(OBJS) zerotier-*
  48. cd mac-tap/tuntap ; make clean
  49. FORCE: