This blob has been accessed 482 times via Git panel.
- # Makefile for Kalasag
- #
- # STEALTH MODE: Only works on Linux systems right now.
- #
- # The snprintf included with the package is for use with NEXTSTEP only,
- # (Thanks Timothy <tjl@luomat.org>) although it may work elsewhere.
- # We've not tried it under any other OS to date. It shouldn't be needed
- # by any modern OS.
- #
- # Others have used the snprintf from:
- #
- # http://www.ijs.si/software/snprintf/
- #
- # We've not tried this yet but others have had good success. Our only
- # piece of advice for those running an OS without built in snprintf()
- # is to upgrade. :)
- #
- #
- # Generic compiler (usually linked to gcc on most platforms)
- CC = cc
- # GNU..
- #CC = gcc
- # Normal systems flags
- CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -Wall
- # Debug mode for kalasag
- #CFLAGS = -Wall -g -DNODAEMON -DDEBUG
- #CFLAGS = -Wall -g -DNODAEMON
- #CFLAGS = -Wall -g -DDEBUG
- # Profiler mode for kalasag
- #CFLAGS = -pg -O -Wall -DNODAEMON
- #LIBS = /usr/lib/libefence.a
- INSTALLDIR = /opt
- CHILDDIR=/kalasag
- all:
- @echo "Usage: make <systype>"
- @echo "<systype> is one of: linux, linux-x86_64, debian-linux, bsd, solaris, hpux, hpux-gcc,"
- @echo "freebsd, osx, openbsd, netbsd, bsdi, aix, osf, irix, generic"
- @echo ""
- @echo "This code requires snprintf()/vsnprintf() system calls"
- @echo "to work. If you run a modern OS it should work on"
- @echo "your system with 'make generic'. If you get it to"
- @echo "work on an unlisted OS please write us with the"
- @echo "changes."
- @echo ""
- @echo "Install: make install"
- @echo ""
- @echo "NOTE: This will install the package in this"
- @echo " directory: $(INSTALLDIR)"
- @echo ""
- @echo "Edit the makefile if you wish to change these paths."
- @echo "Any existing files will be overwritten."
- @echo ""
- clean:
- /bin/rm ./kalasag
- uninstall:
- @if [ -d $(INSTALLDIR)$(CHILDDIR) ]; then rm -rf $(INSTALLDIR)$(CHILDDIR)/*; fi
- install:
- @if [ ! -d $(INSTALLDIR)$(CHILDDIR) ]; then mkdir -p $(INSTALLDIR)$(CHILDDIR); fi
- @chmod 700 $(INSTALLDIR)$(CHILDDIR)
- @cp ./kalasag.conf $(INSTALLDIR)$(CHILDDIR)
- @cp ./kalasag.ignore $(INSTALLDIR)$(CHILDDIR)
- @cp ./kalasag $(INSTALLDIR)$(CHILDDIR)
- @if [ -d /usr/lib/systemd/system ]; then cp ./kalasag.service /usr/lib/systemd/system/; systemctl enable kalasag.service; fi
- @chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.ignore
- @chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.conf
- @chmod 700 $(INSTALLDIR)$(CHILDDIR)/kalasag
- @echo ""
- @echo 'Issue "systemctl restart kalasag.service" after editing $(INSTALLDIR)$(CHILDDIR)/kalasag.conf.'
- @echo ""
- linux:
- SYSTYPE=linux
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DLINUX -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
- linux-x86_64:
- SYSTYPE=linux
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -m64 -DLINUX -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
- debian-linux:
- SYSTYPE=debian-linux
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DLINUX -DDEBIAN -DSUPPORT_STEALTH -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c $(LIBS)
- bsd:
- SYSTYPE=bsd
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- openbsd:
- SYSTYPE=openbsd
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- freebsd:
- SYSTYPE=freebsd
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- osx:
- SYSTYPE=osx
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- netbsd:
- SYSTYPE=netbsd
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- bsdi:
- SYSTYPE=bsdi
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DBSD44 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- generic:
- SYSTYPE=generic
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- hpux:
- SYSTYPE=hpux
- @echo "Making $(SYSTYPE)"
- $(CC) -Ae -DHPUX -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- hpux-gcc:
- SYSTYPE=hpux-gcc
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -DHPUX -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- solaris:
- SYSTYPE=solaris
- @echo "Making $(SYSTYPE)"
- $(CC) -lnsl -lsocket -lresolv -lc -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- aix:
- SYSTYPE=aix
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- osf:
- SYSTYPE=osf
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -taso -ldb -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- irix:
- SYSTYPE=irix
- @echo "Making $(SYSTYPE)"
- $(CC) $(CFLAGS) -O -n32 -mips3 -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c
- # NeXTSTEP Users. NeXT used to work, but we changed the log function and
- # it now uses vsnprintf() to format strings. This means that this
- # version does not work under NeXTSTEP until we can find a workable
- # vsnprintf() call to put in the program. Sorry. If you have some good
- # vsnprintf() code to use under NeXT please send it to us and we'll
- # include it on the next update.
- #next:
- # SYSTYPE=next
- # @echo "Making $(SYSTYPE)"
- # $(CC) $(CFLAGS) -DNEXT -DHAS_NO_SNPRINTF -posix -o ./kalasag ./kalasag.c ./kalasag_io.c ./kalasag_util.c