CC=gcc
OPTS=-Wall -O2
BIN_DIR=/usr/sbin
BIN_LIST=compartment
DOC_DIR=/usr/doc/packages/compartment
DOC_LIST=README LICENCE CHANGES TODO
MAN_DIR=/usr/share/man/man1
MAN_LIST=compartment.1

all:	compartment

compartment: compartment.c
	${CC} ${OPTS} -o ${BIN_LIST} compartment.c
	strip ${BIN_LIST}

clean:
	rm -f ${BIN_LIST} core *~

install:	compartment
	install -o root -g root -m 751 ${BIN_LIST} ${BIN_DIR}
	install -d -o root -g root -m 755 ${DOC_DIR}
	install -o root -g root -m 644 ${DOC_LIST} ${DOC_DIR}
	install -d -o root -g root -m 755 ${MAN_DIR}
	install -o root -g root -m 644 ${MAN_LIST} ${MAN_DIR}
