Makefile.mac 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 launcher mac-tap
  17. one: $(OBJS)
  18. $(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
  19. $(STRIP) zerotier-one
  20. selftest: $(OBJS)
  21. $(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.cpp $(OBJS) $(LIBS)
  22. $(STRIP) zerotier-selftest
  23. idtool: $(OBJS)
  24. $(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
  25. $(STRIP) zerotier-idtool
  26. packtool: $(OBJS)
  27. $(CXX) $(CXXFLAGS) -o zerotier-packtool packtool.cpp $(OBJS) $(LIBS)
  28. $(STRIP) zerotier-packtool
  29. mac-tap: FORCE
  30. cd mac-tap/tuntap ; make tap.kext
  31. install-mac-tap: FORCE
  32. mkdir -p /Library/Application\ Support/ZeroTier/One
  33. rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
  34. cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One
  35. chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
  36. launcher: FORCE
  37. $(CC) -Os -arch i386 -arch x86_64 -o zerotier-launcher launcher.c
  38. $(STRIP) zerotier-launcher
  39. launcher-fakebin:
  40. $(CC) $(CFLAGS) -DZEROTIER_FAKE_VERSION_MAJOR=1 -DZEROTIER_FAKE_VERSION_MINOR=2 -DZEROTIER_FAKE_VERSION_REV
  41. $(CC) $(CFLAGS) -DZEROTIER_FAKE_VERSION_MAJOR=1 -DZEROTIER_FAKE_VERSION_MINOR=2 -DZEROTIER_FAKE_VERSION_REV
  42. clean:
  43. rm -rf *.dSYM
  44. rm -f $(OBJS) zerotier-*
  45. cd mac-tap/tuntap ; make clean
  46. FORCE: