# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

# Make modified install
DEST=@DEST@
TOP_INCDIR=@TOP_INCDIR@
TOP_LIBDIR=@TOP_LIBDIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libexecdir=@libexecdir@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
afssrvbindir=@afssrvbindir@
afssrvsbindir=@afssrvsbindir@
afssrvlibexecdir=@afssrvlibexecdir@
COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
RXGEN=${TOP_SRCDIR}/rxgen/rxgen
TOP_SRCDIR=@TOP_SRCDIR@
SYS_NAME=@AFS_SYSNAME@

SHELL = /bin/sh

include ../config/Makefile.${SYS_NAME}

LIBS= ${XLIBS}
CFLAGS=${OPTMZ} -g -I. -I${TOP_INCDIR} -I${TOP_SRCDIR}/config ${XCFLAGS}

all: pinstall

pinstall: install.c AFS_component_version_number.c 
	case ${SYS_NAME} in \
                sgi_64 | sgi_65) \
                        ${CC} ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
                sgi_* ) \
                        ${CC} ${CFLAGS} install.c -o pinstall ${LIBS} -lmld ;; \
                *) \
                        ${CC} ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
        esac

test: pinstall
	csh ./test/test_install

${DEST}/bin/install: pinstall
	${INSTALL} -f $? $@

# Note: Some rule needs to appear here so that OSF's make does not try to
# compile install from install.c. A ";" will not work since other platforms
# complain. That's why we use 'echo'.
install:
	@echo -n

clean:
	$(RM) -f *.o pinstall AFS_component_version_number.c

include ../config/Makefile.version


dest: ${DEST}/bin/install

