CFLAGS=-O -I. -D_POSIX_SOURCE
LIBS+=-lcap

PROGS=start-stop-daemon initcaps

all: $(PROGS)

start-stop-daemon: start-stop-daemon.c config.h
	$(CC) $(CFLAGS) $(LIBS) start-stop-daemon.c -o start-stop-daemon

initcaps: initcaps.c
	$(CC) $(CFLAGS) $(LIBS) initcaps.c -o initcaps

clean:
	-rm -f $(PROGS)

test:
	./start-stop-daemon --chcaps cap_net_bind_service+ep \
		--chuid md --start --exec /usr/local/sbin/getpcaps 0

tar:
	cd .. && tar czvvf ssd.tgz ssd/Makefile ssd/*c ssd/config.h ssd/README
