make-intercept.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #
  2. # ZeroTier One - Network Virtualization Everywhere
  3. # Copyright (C) 2011-2015 ZeroTier, Inc.
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. # --
  19. #
  20. # ZeroTier may be used and distributed under the terms of the GPLv3, which
  21. # are available at: http://www.gnu.org/licenses/gpl-3.0.html
  22. #
  23. # If you would like to embed ZeroTier into a commercial application or
  24. # redistribute it in a modified binary form, please contact ZeroTier Networks
  25. # LLC. Start here: http://www.zerotier.com/
  26. #
  27. SHCC=gcc
  28. intercept_CFLAGS = -c -fPIC -g -O2 -Wall -std=c99 -DVERBOSE -DDEBUG_RPC -DCHECKS -D_GNU_SOURCE -DNETCON_INTERCEPT
  29. #LIB_NAME = intercept
  30. SHLIB_EXT=dylib
  31. SHLIB_MAJOR = 1
  32. SHLIB_MINOR = 8
  33. COMMON = Common
  34. OBJS= Intercept.o
  35. #SHLIB = ${LIB_NAME}.${SHLIB_EXT}.${SHLIB_MAJOR}.${SHLIB_MINOR}
  36. SHLDFLAGS = -g -O2 -Wall -I. -nostdlib -shared
  37. LIBS = -ldl -lc -lrt -lpthread
  38. lib:
  39. ${SHCC} $(intercept_CFLAGS) -I. Intercept.c -o Intercept.o
  40. ${SHCC} $(intercept_CFLAGS) -I. Sendfd.c -o Sendfd.o
  41. ${SHCC} $(SHLDFLAGS) Intercept.o Sendfd.o -o libzerotierintercept.so.1.0 $(LIBS)
  42. install:
  43. cp libzerotierintercept.so.1.0 /lib/libzerotierintercept.so.1.0
  44. ln -sf /lib/libzerotierintercept.so.1.0 /lib/libzerotierintercept
  45. /usr/bin/install -c zerotier-intercept /usr/bin
  46. uninstall:
  47. rm -r /lib/libzerotierintercept.so.1.0
  48. rm -r /lib/libzerotierintercept
  49. rm -r /usr/bin/zerotier-intercept