Makefile.linux 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. CC=gcc
  2. CXX=g++
  3. INCLUDES=-Iext/bin/libcrypto/include
  4. ARCH=$(shell uname -m)
  5. DEFS=-DZT_ARCH="$(ARCH)" -DZT_OSNAME="linux" -DZT_TRACE
  6. # Uncomment for a release optimized build
  7. #CFLAGS=-Wall -O3 -fno-unroll-loops -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. CXXFLAGS=$(CFLAGS) -fno-rtti
  13. # We statically link against libcrypto because RedHat-derived distributions do
  14. # not ship the elliptic curve algorithms. If we didn't we'd have to build
  15. # separate binaries for the RedHat and Debian universes to distribute via
  16. # auto-update. This way we get one Linux binary for all systems of a given
  17. # architecture.
  18. LIBS=ext/bin/libcrypto/linux-$(ARCH)/libcrypto.a -lm -ldl
  19. include objects.mk
  20. all: one cli
  21. one: $(OBJS)
  22. $(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
  23. $(STRIP) zerotier-one
  24. cli: $(OBJS)
  25. $(CXX) $(CXXFLAGS) -o zerotier-cli cli.cpp $(OBJS) $(LIBS)
  26. $(STRIP) zerotier-cli
  27. selftest: $(OBJS)
  28. $(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.cpp $(OBJS) $(LIBS)
  29. $(STRIP) zerotier-selftest
  30. idtool: $(OBJS)
  31. $(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
  32. $(STRIP) zerotier-idtool
  33. clean:
  34. rm -f $(OBJS) zerotier-*