# Generated automatically from Makefile.in by configure.
# /************************************************************-*-makefile-*-
#  * Myricom GM networking software, interface, and documentation          *
#  * Copyright (c) 1999 by Myricom, Inc.                                   *
#  * All rights reserved.  See the file `COPYING' for copyright notice.    *
#  *************************************************************************/

srcdir = .
GENDAT = /opt/lanai3/bin/gendat

SHELL = /bin/sh

top_srcdir = ../../..
top_builddir = ../../..

host_cpu = sparc



.SUFFIXES:

CC = gcc

# WARNING! Do NOT use the "-g" option in solaris driver!
#          The kernel will panic.

CFLAGS = \
     -DSUNDDI -DKERNEL -DGM_KERNEL -D_KERNEL \
      -DSET_WANTW \
      -DIPQ	  \
	 -DPRINT_LEVEL=0 -Wall -Wno-unused \
	 -I$(srcdir) -I$(top_srcdir)/drivers \
	 -I$(top_builddir)/include -I$(top_srcdir)/include -I../gm \
	  -DHAVE_CONFIG_H -g0 -O3 

INSTALL = /usr/local/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
LDFLAGS =  -lgcc 
LN_S = ln -s

#############
# Building
#############

all: myri

#############
# Installation
#############

install: all
	@echo =====================================
	@echo If this fails, it is because you need to be root to install
	@echo the GM IP driver (myri).
	@echo =====================================
#	cd $(srcdir);./lomem.sh
#	cd $(srcdir);./devlink.sh
#	-rm -f /kernel/drv/gm*
#	$(LN_S) `pwd`/gm /kernel/drv/gm || cp `pwd`/gm /kernel/drv/gm
#	/sbin/sync
#	cd $(srcdir);./add_drv.sh
#	/sbin/sync

uninstall:
	rm -f /kernel/drv/myri
	rm -f /kernel/drv/myri.conf
	/usr/sbin/rem_drv myri

#############
# Cleanliness
#############

mostlyclean:
	-rm -f *.o myri
clean: mostlyclean
distclean: clean
	-rm -f Makefile
maintainer-clean: distclean

#############
# Utility
#############

TAGS:
	cd .. && $(MAKE) TAGS

#############
# Utility
#############

info:
dvi:

#############
# Distribution
#############

dist:

check:

installcheck:
installdirs:

#############
# Configuration
#############

Makefile: Makefile.in
	cd $(top_builddir) && $(MAKE) Makefile

#############
# Utility
#############

force:

######################################################################


myri: myri_buff.o dlpi.o myri.o
	ld -r \
        -o ../../../binary/sbin/myri dlpi.o myri.o myri_buff.o ../../../libgm/libgm_k.a
	cp myri.conf ../../../binary/sbin/myri.conf
myri.o:  myri.c myri.h $(INCLUDES)
	$(CC)  $(CFLAGS) \
           -DMYRI_CFLAGS="\"Myrinet compile flags: $(CFLAGS)\"" \
            -o myri.o -c myri.c

dlpi.o:  dlpi.c myri.h $(INCLUDES)
	$(CC)  -DKSTAT $(CFLAGS) -o dlpi.o -c dlpi.c

myri_buff.o: myri_buff.c myri.h $(INCLUDES)
	$(CC) $(CFLAGS) -o myri_buff.o -c myri_buff.c

