Makefile.unix 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # 3 proxy Makefile for GCC/Unix
  3. #
  4. # You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
  5. # libraries
  6. #
  7. # remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
  8. # library support. Add -DSAFESQL for poorely written ODBC library / drivers.
  9. BUILDDIR = ../bin/
  10. CC = gcc
  11. # you may need -L/usr/pkg/lib for older NetBSD versions
  12. CFLAGS = -g -O2 -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
  13. COUT = -o
  14. LN = $(CC)
  15. LDFLAGS = -O2 -fno-strict-aliasing -pthread
  16. # -lpthreads may be reuqired on some platforms instead of -pthreads
  17. # -ldl or -lld may be required for some platforms
  18. DCFLAGS = -fPIC
  19. DLFLAGS = -shared
  20. DLSUFFICS = .ld.so
  21. LIBS =
  22. LIBSPREFIX = -l
  23. LIBSSUFFIX =
  24. LNOUT = -o
  25. EXESUFFICS =
  26. OBJSUFFICS = .o
  27. DEFINEOPTION = -D
  28. COMPFILES = *~
  29. REMOVECOMMAND = rm -f
  30. AFTERCLEAN = find src/ -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete
  31. TYPECOMMAND = cat
  32. COMPATLIBS =
  33. MAKEFILE = Makefile.unix
  34. PLUGINS = StringsPlugin TrafficPlugin PCREPlugin PamAuth TransparentPlugin
  35. include Makefile.inc
  36. install: all
  37. if [ ! -d /usr/local/etc/3proxy/bin ]; then mkdir -p /usr/local/etc/3proxy/bin/; fi
  38. install bin/3proxy /usr/local/etc/3proxy/bin/3proxy
  39. install bin/mycrypt /usr/local/etc/3proxy/bin/mycrypt
  40. install scripts/rc.d/proxy.sh /usr/local/etc/rc.d/proxy.sh
  41. install scripts/add3proxyuser.sh /usr/local/etc/3proxy/bin/
  42. if [ -s /usr/local/etc/3proxy/3proxy.cfg ]; then
  43. echo /usr/local/etc/3proxy/3proxy.cfg already exists
  44. else
  45. install scripts/3proxy.cfg /usr/local/etc/3proxy/
  46. if [ ! -d /var/log/3proxy/ ]; then
  47. mkdir /var/log/3proxy/
  48. fi
  49. touch /usr/local/etc/3proxy/passwd
  50. touch /usr/local/etc/3proxy/counters
  51. touch /usr/local/etc/3proxy/bandlimiters
  52. echo Run /usr/local/etc/3proxy/bin/add3proxyuser.sh to add \'admin\' user
  53. fi
  54. allplugins:
  55. @list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done