2013-10-28 19:53:40 +00:00
|
|
|
CC=clang
|
|
|
|
CXX=clang++
|
2013-07-04 20:56:19 +00:00
|
|
|
|
2015-01-07 01:16:54 +00:00
|
|
|
INCLUDES=-I/usr/local/include
|
2013-12-11 21:14:10 +00:00
|
|
|
DEFS=
|
2013-12-13 21:49:46 +00:00
|
|
|
LIBS=
|
2015-04-15 21:54:37 +00:00
|
|
|
ARCH_FLAGS=-arch x86_64
|
2013-07-04 20:56:19 +00:00
|
|
|
|
2014-10-24 15:48:44 +00:00
|
|
|
include objects.mk
|
2015-04-09 01:47:06 +00:00
|
|
|
OBJS+=osdep/OSXEthernetTap.o
|
2015-04-15 21:54:37 +00:00
|
|
|
#TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o
|
2014-10-24 15:48:44 +00:00
|
|
|
|
2014-01-10 05:15:00 +00:00
|
|
|
# Disable codesign since open source users will not have ZeroTier's certs
|
2014-01-07 21:06:34 +00:00
|
|
|
CODESIGN=echo
|
2014-01-10 05:15:00 +00:00
|
|
|
CODESIGN_CERT=
|
2014-01-07 21:06:34 +00:00
|
|
|
|
|
|
|
ifeq ($(ZT_OFFICIAL_RELEASE),1)
|
2014-10-24 15:48:44 +00:00
|
|
|
# For use by ZeroTier Networks -- sign with developer cert
|
2014-01-07 21:06:34 +00:00
|
|
|
ZT_AUTO_UPDATE=1
|
|
|
|
DEFS+=-DZT_OFFICIAL_RELEASE
|
|
|
|
CODESIGN=codesign
|
2014-01-10 05:15:00 +00:00
|
|
|
CODESIGN_CERT="Developer ID Application: ZeroTier Networks LLC (8ZD9JUCZ4V)"
|
2014-01-07 21:06:34 +00:00
|
|
|
endif
|
2014-10-24 15:48:44 +00:00
|
|
|
|
2013-12-11 21:14:10 +00:00
|
|
|
ifeq ($(ZT_AUTO_UPDATE),1)
|
2013-12-31 19:22:54 +00:00
|
|
|
DEFS+=-DZT_AUTO_UPDATE
|
2013-12-11 21:14:10 +00:00
|
|
|
endif
|
|
|
|
|
2015-01-14 00:45:23 +00:00
|
|
|
# Build with ZT_ENABLE_NETCONF_MASTER=1 to build with NetworkConfigMaster enabled
|
|
|
|
ifeq ($(ZT_ENABLE_NETCONF_MASTER),1)
|
|
|
|
DEFS+=-DZT_ENABLE_NETCONF_MASTER
|
2015-03-12 21:03:53 +00:00
|
|
|
LIBS+=-L/usr/local/lib -lsqlite3
|
2015-01-14 00:45:23 +00:00
|
|
|
ARCH_FLAGS=-arch x86_64
|
2015-03-12 21:03:53 +00:00
|
|
|
OBJS+=netconf/SqliteNetworkConfigMaster.o
|
2015-01-14 00:45:23 +00:00
|
|
|
endif
|
|
|
|
|
2014-10-24 15:48:44 +00:00
|
|
|
# Enable SSE-optimized Salsa20 -- all Intel macs support SSE2
|
2014-07-16 00:56:09 +00:00
|
|
|
DEFS+=-DZT_SALSA20_SSE
|
|
|
|
|
2014-08-19 17:09:21 +00:00
|
|
|
ifeq ($(ZT_DEBUG),1)
|
2015-04-10 03:54:00 +00:00
|
|
|
DEFS+=-DZT_TRACE
|
2014-10-12 18:42:49 +00:00
|
|
|
CFLAGS=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
2014-08-19 17:09:21 +00:00
|
|
|
STRIP=echo
|
2014-10-12 18:42:49 +00:00
|
|
|
# The following line enables optimization for the crypto code, since
|
|
|
|
# C25519 in particular is almost UNUSABLE in heavy testing without it.
|
2014-10-14 17:22:27 +00:00
|
|
|
ext/lz4/lz4.o node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
|
2014-08-19 17:09:21 +00:00
|
|
|
else
|
2015-04-15 21:54:37 +00:00
|
|
|
CFLAGS=$(ARCH_FLAGS) -Wall -O3 -flto -fPIE -fvectorize -fstack-protector -pthread -mmacosx-version-min=10.7 -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
|
2014-08-19 17:09:21 +00:00
|
|
|
STRIP=strip
|
|
|
|
endif
|
2013-07-04 20:56:19 +00:00
|
|
|
|
|
|
|
CXXFLAGS=$(CFLAGS) -fno-rtti
|
|
|
|
|
2013-11-08 20:23:48 +00:00
|
|
|
all: one
|
2013-07-04 20:56:19 +00:00
|
|
|
|
2015-04-15 21:54:37 +00:00
|
|
|
one: $(OBJS) one.o
|
|
|
|
$(CXX) $(CXXFLAGS) -o zerotier-one $(OBJS) one.o $(LIBS)
|
2013-07-04 20:56:19 +00:00
|
|
|
$(STRIP) zerotier-one
|
2013-11-19 20:05:14 +00:00
|
|
|
ln -sf zerotier-one zerotier-cli
|
2013-12-04 22:44:28 +00:00
|
|
|
ln -sf zerotier-one zerotier-idtool
|
2013-07-04 20:56:19 +00:00
|
|
|
|
2014-11-20 21:20:16 +00:00
|
|
|
selftest: $(OBJS) selftest.o
|
2014-08-19 17:09:21 +00:00
|
|
|
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
|
2013-07-04 20:56:19 +00:00
|
|
|
$(STRIP) zerotier-selftest
|
|
|
|
|
2015-04-14 20:56:28 +00:00
|
|
|
#testnet: $(TESTNET_OBJS) $(OBJS) testnet.o
|
|
|
|
# $(CXX) $(CXXFLAGS) -o zerotier-testnet testnet.o $(OBJS) $(TESTNET_OBJS) $(LIBS)
|
|
|
|
# $(STRIP) zerotier-testnet
|
2014-10-23 23:46:09 +00:00
|
|
|
|
2014-08-19 17:09:21 +00:00
|
|
|
# Requires that ../Qt be symlinked to the Qt root to use for UI build
|
2015-04-14 20:56:28 +00:00
|
|
|
#mac-ui: FORCE
|
|
|
|
# mkdir -p build-ZeroTierUI-release
|
|
|
|
# cd build-ZeroTierUI-release ; ../../Qt/bin/qmake ../ZeroTierUI/ZeroTierUI.pro ; make -j 4
|
|
|
|
# strip "build-ZeroTierUI-release/ZeroTier One.app/Contents/MacOS/ZeroTier One"
|
|
|
|
# find "build-ZeroTierUI-release/ZeroTier One.app" -type f -name '.DS_Store' -print0 | xargs -0 rm -f
|
|
|
|
# $(CODESIGN) -f -s $(CODESIGN_CERT) "build-ZeroTierUI-release/ZeroTier One.app"
|
|
|
|
# $(CODESIGN) -vvv "build-ZeroTierUI-release/ZeroTier One.app"
|
2013-12-17 06:30:37 +00:00
|
|
|
|
2013-07-04 20:56:19 +00:00
|
|
|
clean:
|
2015-04-15 21:54:37 +00:00
|
|
|
rm -rf *.dSYM build-* *.pkg *.dmg *.o netconf/*.o service/*.o node/*.o osdep/*.o ext/http-parser/*.o ext/lz4/*.o zerotier-* ZeroTierOneInstaller-*
|
2013-07-04 20:56:19 +00:00
|
|
|
|
2014-08-19 17:09:21 +00:00
|
|
|
# For our use -- builds official signed binary, packages in installer and download DMG
|
2014-01-07 22:48:56 +00:00
|
|
|
official: FORCE
|
|
|
|
make -j 4 ZT_OFFICIAL_RELEASE=1
|
|
|
|
./buildinstaller.sh
|
2015-04-15 21:54:37 +00:00
|
|
|
# make mac-dmg ZT_OFFICIAL_RELEASE=1
|
|
|
|
|
|
|
|
#mac-dmg: FORCE
|
|
|
|
# mkdir -p build-ZeroTierOne-dmg
|
|
|
|
# cd build-ZeroTierOne-dmg ; ln -sf /Applications Applications
|
|
|
|
# cp -a "build-ZeroTierUI-release/ZeroTier One.app" build-ZeroTierOne-dmg/
|
|
|
|
# rm -f /tmp/tmp.dmg
|
|
|
|
# hdiutil create /tmp/tmp.dmg -ov -volname "ZeroTier One" -fs HFS+ -srcfolder ./build-ZeroTierOne-dmg
|
|
|
|
# hdiutil convert /tmp/tmp.dmg -format UDZO -o "ZeroTier One.dmg"
|
|
|
|
# $(CODESIGN) -f -s $(CODESIGN_CERT) "ZeroTier One.dmg"
|
|
|
|
# rm -f /tmp/tmp.dmg
|
2014-01-07 22:48:56 +00:00
|
|
|
|
2014-08-19 17:09:21 +00:00
|
|
|
# For those building from source -- installs signed binary tap driver in system ZT home
|
|
|
|
install-mac-tap: FORCE
|
|
|
|
mkdir -p /Library/Application\ Support/ZeroTier/One
|
|
|
|
rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
|
|
|
|
cp -R ext/bin/tap-mac/tap.kext /Library/Application\ Support/ZeroTier/One
|
|
|
|
chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
|
|
|
|
|
2013-07-04 20:56:19 +00:00
|
|
|
FORCE:
|