# Makefile for libinstaller.
# $Id: Makefile,v 1.21 2005/01/29 22:30:37 cpressey Exp $

OSTYPE!=sysctl -n kern.ostype

LIB=	installer

SRCS=	commands.c confed.c diskutil.c functions.c \
	mount.c package.c survey.c uiutil.c

CFLAGS+=-Wall -I/usr/local/include
.ifdef DEBUG
CFLAGS+=-DDEBUG -g
.endif

.if ${OSTYPE} == "NetBSD"
NOGCCERROR=D
CPPFLAGS=${CFLAGS}
SHLIBDIR=/usr/local/lib
USE_SHLIBDIR=yes
.else
INSTALL_FILE?=install -C
.endif

LIBDIR=/usr/local/lib
USELIBDIR=/usr/local/lib
USESHLIBDIR=/usr/local/lib

NOPROFILE=yes
SHLIB_MAJOR=4
SHLIB_MINOR=0

installincludes:
	[ -d /usr/local/include/installer ] || mkdir /usr/local/include/installer
	rm -f /usr/local/include/installer/* || echo "no files"
	${INSTALL_FILE} -o root -g wheel -m 444  commands.h /usr/local/include/installer/
	${INSTALL_FILE} -o root -g wheel -m 444  confed.h /usr/local/include/installer/
	${INSTALL_FILE} -o root -g wheel -m 444  diskutil.h /usr/local/include/installer/
	${INSTALL_FILE} -o root -g wheel -m 444  functions.h /usr/local/include/installer/
	${INSTALL_FILE} -o root -g wheel -m 444  package.h /usr/local/include/installer/
	${INSTALL_FILE} -o root -g wheel -m 444  uiutil.h /usr/local/include/installer/

# NetBSD kludge
afterinstall: installincludes

.include <bsd.lib.mk>
