# -*- Makefile -*-
# $Id: Makefile,v 1.8 1996/06/05 08:37:59 yumiko Exp $
#
# Copyright (C) 1996 by Yokota-Laboratory, 
#	Japan Advanced Inst. of Sci. and Tech.,
#	1-1 Asahidai, Tatsunokuchi, Ishikawa 923-12, Japan.


#### klic compiler for work stations
KLIC		= klic
KLICFLAGS	= -v
#KLICFLAGS	= -v -dp

#### klic compiler for an nCUBE2
NKLIC		= /usr/ncube/klic/bin/klic
NKLICFLAGS	= -v -dp


##
SHELL		= /bin/sh
RM		= /bin/rm -f

FLAGS_TO_PASS = \
	MAKE='$(MAKE)' \
	KLIC='$(KLIC)' \
	KLICFLAGS='$(KLICFLAGS)' \
	NKLIC='$(NKLIC)' \
	NKLICFLAGS='$(NKLICFLAGS)'

SUBDIRS		= common sun ncube

####
.PHONY:	all common sun ncube install install.sun install.ncube FORCE

all: sun

install:

sun: FORCE
	@ for subdir in $(SUBDIRS); do \
	  echo "making for Suns"; \
	  ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

install.sun:
	@ for subdir in $(SUBDIRS); do \
	  echo "installing for Suns"; \
	  ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

###
ncube: FORCE
	@ for subdir in $(SUBDIRS); do \
	  echo "making for an nCUBE2"; \
	  ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

install.ncube:
	@ for subdir in $(SUBDIRS); do \
	  echo "installing for an nCUBE2"; \
	  ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

FORCE:

###
.PHONY:	all-clean clean

all-clean:
	@ for subdir in $(SUBDIRS); do \
	   echo "cleaning $$subdir"; \
	   (cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

clean:
	@ for subdir in $(SUBDIRS); do \
	   echo "cleaning $$subdir"; \
	   (cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done
