make-freebsd.mk 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. CC=cc
  2. CXX=c++
  3. INCLUDES=
  4. DEFS=
  5. LIBS=
  6. include objects.mk
  7. OBJS+=osdep/BSDEthernetTap.o
  8. # "make official" is a shortcut for this
  9. ifeq ($(ZT_OFFICIAL_RELEASE),1)
  10. DEFS+=-DZT_OFFICIAL_RELEASE
  11. endif
  12. # "make debug" is a shortcut for this
  13. ifeq ($(ZT_DEBUG),1)
  14. DEFS+=-DZT_TRACE
  15. CFLAGS=-Wall -g -pthread $(INCLUDES) $(DEFS)
  16. LDFLAGS=
  17. STRIP=echo
  18. # The following line enables optimization for the crypto code, since
  19. # C25519 in particular is almost UNUSABLE in heavy testing without it.
  20. ext/lz4/lz4.o node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
  21. else
  22. CFLAGS=-Wall -O3 -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
  23. LDFLAGS=-pie -Wl,-z,relro,-z,now
  24. STRIP=strip --strip-all
  25. endif
  26. CXXFLAGS=$(CFLAGS) -fno-rtti
  27. all: one
  28. one: $(OBJS) one.o
  29. $(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one $(OBJS) one.o $(LIBS)
  30. $(STRIP) zerotier-one
  31. ln -sf zerotier-one zerotier-idtool
  32. ln -sf zerotier-one zerotier-cli
  33. selftest: $(OBJS) selftest.o
  34. $(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
  35. $(STRIP) zerotier-selftest
  36. # No installer on FreeBSD yet
  37. #installer: one FORCE
  38. # ./buildinstaller.sh
  39. clean:
  40. rm -rf *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-*
  41. debug: FORCE
  42. make -j 4 ZT_DEBUG=1
  43. #official: FORCE
  44. # make -j 4 ZT_OFFICIAL_RELEASE=1
  45. # ./buildinstaller.sh
  46. FORCE: