This blob has been accessed 1,092 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:
- /bin/rm $(INSTALLDIR)$(CHILDDIR)/*
- /bin/rmdir $(INSTALLDIR)$(CHILDDIR)
- install:
- @echo "Creating directory $(INSTALLDIR)"
- @if [ ! -d $(INSTALLDIR) ]; then /bin/mkdir $(INSTALLDIR); fi
- @echo "Setting directory permissions"
- @echo "Creating kalasag directory $(INSTALLDIR)$(CHILDDIR)"
- @if [ ! -d $(INSTALLDIR)$(CHILDDIR) ]; then /bin/mkdir $(INSTALLDIR)$(CHILDDIR); fi
- @echo "Setting directory permissions"
- chmod 700 $(INSTALLDIR)$(CHILDDIR)
- @echo "Copying files"
- cp ./kalasag.conf $(INSTALLDIR)$(CHILDDIR)
- cp ./kalasag.ignore $(INSTALLDIR)$(CHILDDIR)
- cp ./kalasag $(INSTALLDIR)$(CHILDDIR)
- @echo "Setting permissions"
- chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.ignore
- chmod 600 $(INSTALLDIR)$(CHILDDIR)/kalasag.conf
- chmod 700 $(INSTALLDIR)$(CHILDDIR)/kalasag
- @echo ""
- @echo ""
- @echo "Edit $(INSTALLDIR)$(CHILDDIR)/kalasag.conf and change"
- @echo "your settings if you haven't already. (route, etc)"
- @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