# $Id: Makefile,v 1.6 2000/02/05 12:49:57 akiyama Exp $

PREFIX?= /usr/local

# Get __FreeBSD_version
.if !defined(OSVERSION)
.if exists(/sbin/sysctl)
OSVERSION!= /sbin/sysctl -n kern.osreldate
.else
OSVERSION!= /usr/sbin/sysctl -n kern.osreldate
.endif
.endif

PROG= odcontrol
SRCS= odcontrol.c
.if ${OSVERSION} >= 300000
SRCS+= camio.c

odcontrol.8: odcontrol-cam.8
	ln -sf $? $@
.else
SRCS+= scsiio.c scsi_sense.c

odcontrol.8: odcontrol-scsi.8
	ln -sf $? $@
.endif

CLEANFILES+= odcontrol.8
MAN8= odcontrol.8

BINDIR= ${PREFIX}/sbin
MANDIR= ${PREFIX}/man/man

.if ${OSVERSION} >= 300000
CFLAGS+= -DUSE_SCSI_CAM
LDADD+= -lcam
.endif

.include <bsd.prog.mk>
