# Solaris specific defines, passed to subdirectories.
# To use Sun CC, uncomment the CC and KFLAGS variables.
#
# $Id: Makefile,v 1.1 2008-08-14 07:27:41 shearer_lu Exp $


CC	= gcc
# LD hardcoded to sun ld, GNU ld has been reported to cause some trouble with 64 bit
LD	= /usr/ccs/bin/ld

INSTALL = /usr/bin/install -c
GREP=/bin/grep


# -D_ISOC9X_SOURCE is handled by OSVERSION. basically, it's not needed
# with 2.5.1.
DEFS=	-D__svr4__ -DSOLARIS -I../../sys/generic \
	-I.. -DHAVE_CONFIG_H

# Variables
KCFLAGS=
KLDFLAGS=
COMPILE_KERNEL_GCC=
SPARC64=
SOLARIS_MODULE_FALSE=
SOLARIS_MODULE_TRUE=#
USE_SOLARIS_TRUE=#
USE_SOLARIS_FALSE=

OPTOPTS=

# Local build stuff.

SRC= linkage.c tpi.c dlpi.c ioc.c if.c aarp.c ddp.c sock.c rt.c
OBJ= linkage.o tpi.o dlpi.o ioc.o if.o aarp.o ddp.o sock.o rt.o
HEADERS= if.h ioc.h rt.h sock.h
EXTRA_DIST= ddp.conf Makefile

INCPATH=	-I../../include -I../netatalk -I../..
CFLAGS=	${DEFS} ${OPTOPTS} ${INCPATH} ${KCFLAGS}

# Not building on Solaris
all:

# No Solaris kernel module build
#all:
#	@echo
#	@echo "Solaris kernel module cannot be build"
install:

uninstall:

# Build Solaris kernel module
#all :	kernel

#kernel: ddp 

#FRC: 

#ddp :	${OBJ}
#	${LD} ${KLDFLAGS} -r -o ddp ${OBJ}

#linkage.o : linkage.c
#	${CC} ${CFLAGS} -DVERSION=\"`cat ../../VERSION`\" -c linkage.c

#kuninstall : FRC
#	@if [ x"${SPARC64}" = x"yes" ] ; then \
#		${RM} /usr/kernel/drv/sparcv9/ddp; \
#		${RM} /usr/kernel/strmod/sparcv9/ddp; \
#	else \
#		${RM} /usr/kernel/drv/ddp; \
#		${RM} /usr/kernel/strmod/ddp; \
#	fi
#	${RM} /usr/kernel/drv/ddp.conf
#	-rem_drv ddp
#	sync;sync;sync

#kinstall : kernel kuninstall
#	@if [ x"${SPARC64}" = x"yes" ]; then \
#		${INSTALL} -o root -g sys -c ddp /usr/kernel/drv/sparcv9/ddp; \
#		ln /usr/kernel/drv/sparcv9/ddp /usr/kernel/strmod/sparcv9/ddp; \
#	else \
#		${INSTALL} -o root -g sys -c ddp /usr/kernel/drv/ddp; \
#		ln /usr/kernel/drv/ddp /usr/kernel/strmod/ddp; \
#	fi
#	${INSTALL} -o root -g sys -c ddp.conf /usr/kernel/drv/ddp.conf
#	add_drv -m '* 0666 root sys' ddp
#	sync;sync;sync
#	@if ${GREP} 'ddp' /etc/netconfig; then \
#            echo "netconfig already contains a ddp module, skipping"; \
#        else \
#            echo "adding ddp module to netconfig"; \
#            echo "ddp        tpi_clts      -    appletalk ddp   /dev/ddp        -" >> /etc/netconfig; \
#	fi
#	@echo "Installed Solaris kernel module"


#install:
#	@echo
#	@echo "To install the Solaris kernel module type 'make kinstall' as root user"

#uninstall:
#	@echo
#	@echo "To uninstall the Solaris kernel module type 'make kuninstall' as root user"

distdir :

clean : sysclean

klean sysclean :
	rm -f a.out core* *.o *.bak *[Ee]rrs tags
	rm -f ddp

distclean: clean
	 -rm -f Makefile

maintainer-clean: distclean

depend :

check:

# DO NOT DELETE THIS LINE

