make-linux.mk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. CC=gcc
  2. CXX=g++
  3. INCLUDES=
  4. DEFS=
  5. LIBS=
  6. # Uncomment for a release optimized build
  7. CFLAGS=-Wall -O3 -fno-unroll-loops -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
  8. STRIP=strip --strip-all
  9. # Uncomment for a debug build
  10. #CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE $(DEFS)
  11. #STRIP=echo
  12. # Uncomment for gprof profile build
  13. #CFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
  14. #STRIP=echo
  15. CXXFLAGS=$(CFLAGS) -fno-rtti
  16. include objects.mk
  17. all: one
  18. one: $(OBJS)
  19. $(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
  20. $(STRIP) zerotier-one
  21. ln -sf zerotier-one zerotier-cli
  22. ln -sf zerotier-one zerotier-idtool
  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. file2lz4c: ext/lz4/lz4hc.o FORCE
  30. $(CXX) $(CXXFLAGS) -o file2lz4c file2lz4c.cpp node/Utils.cpp node/Salsa20.cpp ext/lz4/lz4hc.o
  31. installer: one FORCE
  32. ./buildinstaller.sh
  33. clean:
  34. rm -rf $(OBJS) file2lz4c zerotier-* zt1-*-install installer-build build-ZeroTierUI-*
  35. FORCE: