CC = gcc
# if you want to crosscompile, you can do for example
#CC = arm-linux-gcc -mcpu=xscale -mbig-endian

# you can add to CFLAGS:
#	-DLinux if you compile on Linux
#	-DFreeBSD if you compile on FreeBSD
#	-DUSE_INTERNAL_SENDFILE_COPY (less performance) if you cannot use
#		the sendfile syscall on your target platform with
#		64-bit file access.  Needed for Unslung 5.5 on NSLU2.
#	-DUSE_INTERNAL_SENDFILE_MMAP (better performance) if your target
#		platform supports memory mapped files with 64-bit file access
#		and you want to use it.  Not possible with >2GB files on
#		Unslung 5.5 on NSLU2.
CFLAGS = -DLinux -g -O2 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
OBJS = kissd.o connection.o playlist.o sendfile.o

kissd: $(OBJS) kissd.h
	$(CC) -o $@ $(OBJS)

all: kissd

# warning: on FreeBSD the root's group is wheel, edit the lines
# below accordingly
install:
	install -b -S .old -o root -g root -m 755 kissd $(DESTDIR)/usr/sbin/kissd
	install -b -S .old -o root -g root -m 644 kissd.conf $(DESTDIR)/etc/kissd.conf
	install -o root -g root -m 644 kissd.1 $(DESTDIR)/usr/share/man/man1/kissd.1

clean:
	rm -rf kissd $(OBJS) *.bak *~

