kalasag.org

kalasag.org

Git

This blob has been accessed 4 times via Git panel.

  1. # Makefile for Kalasag
  2. #
  3. # STEALTH MODE: Only works on Linux systems right now.
  4. #
  5. # The snprintf included with the package is for use with NEXTSTEP only,
  6. # (Thanks Timothy <tjl@luomat.org>) although it may work elsewhere.
  7. # We've not tried it under any other OS to date. It shouldn't be needed
  8. # by any modern OS.
  9. #
  10. # Others have used the snprintf from:
  11. #
  12. # http://www.ijs.si/software/snprintf/
  13. #
  14. # We've not tried this yet but others have had good success. Our only
  15. # piece of advice for those running an OS without built in snprintf()
  16. # is to upgrade. :)
  17. #
  18. #
  19. # Generic compiler (usually linked to gcc on most platforms)
  20. CC = cc
  21.  
  22. # GNU..
  23. #CC = gcc
  24.  
  25. # Base flags (portable across all platforms)
  26. BASE_CFLAGS = -O3 -Wall -Wextra -pipe -flto
  27.  
  28. # Linux hardening flags (GCC/Linux specific)
  29. LINUX_CFLAGS = -funroll-loops -fomit-frame-pointer $(BASE_CFLAGS) \
  30.     -D_FORTIFY_SOURCE=2 -fpie -Wl,-pie -fstack-clash-protection \
  31.     -fstack-protector-strong -fcf-protection \
  32.     -Werror=format-security -Werror=implicit-function-declaration \
  33.     -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack
  34.  
  35. # BSD/macOS hardening flags (compatible with clang and BSD linkers)
  36. BSD_CFLAGS = $(BASE_CFLAGS) -fPIE -Wl,-pie -fstack-protector-strong
  37.  
  38. # Debug mode for kalasag
  39. #BASE_CFLAGS = -Wall -g -DNODAEMON -DDEBUG
  40. #BASE_CFLAGS = -Wall -g -DNODAEMON
  41. #BASE_CFLAGS = -Wall -g -DDEBUG
  42.  
  43. # Profiler mode for kalasag
  44. #BASE_CFLAGS = -pg -O -Wall -DNODAEMON
  45. #LIBS = /usr/lib/libefence.a
  46.  
  47. INSTALLDIR = /opt
  48. CHILDDIR=/kalasag
  49.  
  50. all:
  51.                 @echo "Usage: make <systype>"
  52.                 @echo "<systype> is one of: linux, linux-x86_64, debian-linux, bsd, solaris, hpux, hpux-gcc,"
  53.                 @echo "freebsd, osx, openbsd, netbsd, bsdi, aix, osf, irix, generic"
  54.                 @echo ""
  55.                 @echo "This code requires snprintf()/vsnprintf() system calls"
  56.                 @echo "to work. If you run a modern OS it should work on"
  57.                 @echo "your system with 'make generic'. If you get it to"
  58.                 @echo "work on an unlisted OS please write us with the"
  59.                 @echo "changes."
  60.                 @echo ""
  61.                 @echo "Install: make install"
  62.                 @echo ""
  63.                 @echo "NOTE: This will install the package in this"
  64.                 @echo "      directory: $(INSTALLDIR)"
  65.                 @echo ""
  66.                 @echo "Edit the makefile if you wish to change these paths."
  67.                 @echo "Any existing files will be overwritten."
  68.                 @echo ""
  69.  
  70. clean:         
  71.                 /bin/rm ./kalasag
  72.  
  73. uninstall:     
  74.                 @for svc in kalasag-tcp kalasag-udp; do \
  75.                     if [ -f /usr/lib/systemd/system/$$svc.service ]; then \
  76.                         systemctl stop $$svc.service; \
  77.                         systemctl disable $$svc.service; \
  78.                         rm -f /usr/lib/systemd/system/$$svc.service; \
  79.                     fi; \
  80.                 done
  81.                 @if [ -d $(INSTALLDIR)$(CHILDDIR) ]; then rm -rf $(INSTALLDIR)$(CHILDDIR)/*; fi
  82.  
  83. install:       
  84.                 @if [ ! -d $(INSTALLDIR)$(CHILDDIR) ]; then mkdir -p $(INSTALLDIR)$(CHILDDIR); fi
  85.                 @chmod 700 $(INSTALLDIR)$(CHILDDIR)
  86.                 @cp ./kalasag.conf $(INSTALLDIR)$(CHILDDIR)
  87.                 @cp ./kalasag.ignore $(INSTALLDIR)$(CHILDDIR)
  88.                 @cp ./kalasag $(INSTALLDIR)$(CHILDDIR)
  89.                 @if [ -d /usr/lib/systemd/system ]; then \
  90.                     cp ./kalasag-tcp.service /usr/lib/systemd/system/; \
  91.                     cp ./kalasag-udp.service /usr/lib/systemd/system/; \
  92.                     systemctl enable kalasag-tcp.service; \
  93.                     systemctl enable kalasag-udp.service; \
  94.                 fi
  95.                 @chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.ignore
  96.                 @chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.conf
  97.                 @chmod 700 $(INSTALLDIR)$(CHILDDIR)/kalasag
  98.                 @echo ""
  99.                 @echo 'Issue "systemctl start kalasag-tcp kalasag-udp" after editing $(INSTALLDIR)$(CHILDDIR)/kalasag.conf.'
  100.                 @echo ""
  101.  
  102. linux:         
  103.                 SYSTYPE=linux
  104.                 @echo "Making $(SYSTYPE)"
  105.                 $(CC) $(LINUX_CFLAGS) -DLINUX -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
  106.  
  107. linux-x86_64:          
  108.                 SYSTYPE=linux
  109.                 @echo "Making $(SYSTYPE)"
  110.                 $(CC) $(LINUX_CFLAGS) -m64 -DLINUX -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
  111.  
  112. debian-linux:          
  113.                 SYSTYPE=debian-linux
  114.                 @echo "Making $(SYSTYPE)"
  115.                 $(CC) $(LINUX_CFLAGS) -DLINUX -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
  116.  
  117.  
  118. bsd:           
  119.                 SYSTYPE=bsd
  120.                 @echo "Making $(SYSTYPE)"
  121.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  122.  
  123.  
  124. openbsd:               
  125.                 SYSTYPE=openbsd
  126.                 @echo "Making $(SYSTYPE)"
  127.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  128.  
  129.  
  130. freebsd:               
  131.                 SYSTYPE=freebsd
  132.                 @echo "Making $(SYSTYPE)"
  133.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  134.  
  135. osx:           
  136.                 SYSTYPE=osx
  137.                 @echo "Making $(SYSTYPE)"
  138.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  139.  
  140.  
  141. netbsd:        
  142.                 SYSTYPE=netbsd
  143.                 @echo "Making $(SYSTYPE)"
  144.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  145.  
  146.  
  147. bsdi:          
  148.                 SYSTYPE=bsdi
  149.                 @echo "Making $(SYSTYPE)"
  150.                 $(CC) $(BSD_CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  151.  
  152.  
  153. generic:               
  154.                 SYSTYPE=generic
  155.                 @echo "Making $(SYSTYPE)"
  156.                 $(CC) $(BASE_CFLAGS) -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  157.  
  158.  
  159. hpux:          
  160.                 SYSTYPE=hpux
  161.                 @echo "Making $(SYSTYPE)"
  162.                 $(CC) -Ae -DHPUX -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  163.  
  164.  
  165. hpux-gcc:
  166.                 SYSTYPE=hpux-gcc
  167.                 @echo "Making $(SYSTYPE)"
  168.                 $(CC) $(BASE_CFLAGS) -DHPUX -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  169.  
  170.  
  171. solaris:               
  172.                 SYSTYPE=solaris
  173.                 @echo "Making $(SYSTYPE)"
  174.                 $(CC) -lnsl -lsocket -lresolv -lc -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  175.  
  176.  
  177. aix:           
  178.                 SYSTYPE=aix
  179.                 @echo "Making $(SYSTYPE)"
  180.                 $(CC) $(BASE_CFLAGS) -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  181.  
  182.  
  183. osf:
  184.                 SYSTYPE=osf
  185.                 @echo "Making $(SYSTYPE)"
  186.                 $(CC) $(BASE_CFLAGS) -taso -ldb -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  187.  
  188.  
  189. irix:
  190.                 SYSTYPE=irix
  191.                 @echo "Making $(SYSTYPE)"
  192.                 $(CC) $(BASE_CFLAGS) -O -n32 -mips3 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  193.  
  194.  
  195. # NeXTSTEP Users. NeXT used to work, but we changed the log function and
  196. # it now uses vsnprintf() to format strings. This means that this
  197. # version does not work under NeXTSTEP until we can find a workable
  198. # vsnprintf() call to put in the program. Sorry. If you have some good
  199. # vsnprintf() code to use under NeXT please send it to us and we'll
  200. # include it on the next update.
  201. #next:         
  202. #               SYSTYPE=next
  203. #               @echo "Making $(SYSTYPE)"
  204. #               $(CC) $(CFLAGS) -DNEXT -DHAS_NO_SNPRINTF -posix -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
  205.  
filedropkalasag.git-8eed43a.tar.bz2 new
21.31 KB
2 downloads
filedropkalasag.git-8eed43a.zip
26.47 KB
1 download
filedropkalasag.git-83beb57.tar.bz2
21.32 KB
3 downloads
filedropkalasag.git-83beb57.zip
26.49 KB
1 download
filedropkalasag.git-89d9746.tar.bz2
21.25 KB
3 downloads
filedropkalasag.git-89d9746.zip
26.41 KB
2 downloads
filedropkalasag.git-a1e8b2b.tar.bz2
21.14 KB
2 downloads
filedropkalasag.git-a1e8b2b.zip
26.30 KB
1 download
filedropkalasag.git-8c3a288.tar.bz2
21.20 KB
3 downloads
filedropkalasag.git-8c3a288.zip
26.46 KB
2 downloads
filedropkalasag.git-1c9f013.tar.bz2
20.95 KB
131 downloads
filedropkalasag.git-1c9f013.zip
25.81 KB
76 downloads
filedropkalasag.git-3ca3612.tar.bz2
20.80 KB
34 downloads
filedropkalasag.git-3ca3612.zip
25.66 KB
19 downloads
filedropkalasag.git-2ffeaa6.tar.bz2
20.80 KB
36 downloads
filedropkalasag.git-2ffeaa6.zip
25.65 KB
90 downloads
filedropkalasag.git-2834a11.tar.bz2
20.84 KB
139 downloads
filedropkalasag.git-2834a11.zip
25.72 KB
18 downloads
filedropkalasag.git-afd7b31.tar.bz2
20.84 KB
119 downloads
filedropkalasag.git-afd7b31.zip
25.71 KB
98 downloads
filedropkalasag.git-97c89e1.tar.bz2
20.82 KB
116 downloads
filedropkalasag.git-97c89e1.zip
25.68 KB
96 downloads
filedropkalasag.git-1141d13.tar.bz2
20.65 KB
122 downloads
filedropkalasag.git-1141d13.zip
25.37 KB
82 downloads
filedropkalasag.git-ee3c17b.tar.bz2
20.65 KB
113 downloads
filedropkalasag.git-ee3c17b.zip
25.34 KB
24 downloads
filedropkalasag.git-4032c54.tar.bz2
20.63 KB
32 downloads
filedropkalasag.git-4032c54.zip
25.13 KB
87 downloads
filedropkalasag.git-e51a2a6.tar.bz2
20.65 KB
108 downloads
filedropkalasag.git-e51a2a6.zip
25.13 KB
19 downloads
filedropkalasag.git-599c93a.tar.bz2
20.63 KB
104 downloads
filedropkalasag.git-599c93a.zip
25.11 KB
1,612 downloads
filedropkalasag.git-acdc640.tar.bz2
20.63 KB
105 downloads
filedropkalasag.git-acdc640.zip
25.10 KB
14 downloads