#
# This file is part of the Alliance CAD System
# Copyright (C) Laboratoire LIP6 - Dpartement ASIM
# Universite Pierre et Marie Curie
# 
# Home page          : http://www-asim.lip6.fr/alliance/
# E-mail support     : mailto:alliance-support@asim.lip6.fr
# 
# This progam is  free software; you can redistribute it  and/or modify it
# under the  terms of the GNU  General Public License as  published by the
# Free Software Foundation;  either version 2 of the License,  or (at your
# option) any later version.
# 
# Alliance VLSI  CAD System  is distributed  in the hope  that it  will be
# useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
# 
# You should have received a copy  of the GNU General Public License along
# with the GNU C Library; see the  file COPYING. If not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

#
# Makefile Alliance source
#
# Works well with gmake...
#
# diff -r -b -B sources/ ../old/labo_11_97/ | grep -i "^diff\|architectu" | diffcolor | less -r
#ALL_DIRS = 	$(shell find * -name "sce" -maxdepth 1 -type d)
# -i comportemental `find . -type f \( -name "*.[ch]" -o  -name "*.yac" -o  -name "*.lex" \)`
#
# Copyright (C) 1996-1998 Olivier Sirol 
# $Id: Makefile,v 1.14 2000/01/27 17:40:00 czo Exp $
#


ALL_DIRS = mbk mbkal mbkedif mbkhilo mbkspice mbkvhdl mbkvti mbkvrlog mbkap mbkmg bdd beh behvhdl gscr pat rds rdscif rdsgds elp icones cns genlib rsa bsg rfg amg asimut alcban asm fitpath dpr druc syf dreal graal rage genview flop grog rds2ps scr lvx ring s2r lynx genpat sl testools flatbeh mbktools algue fpmap

# STRIP="echo" CFLAGS="-Wall -g" 

all :
	@for FILE in $(ALL_DIRS)		;\
	do echo %%%%%%%%% building $$FILE ; $(MAKE) -C $$FILE 	;\
	if [ $$? -ne 0 ] 			;\
	  then  exit 1  			;\
	fi					;\
	done
	@echo "##########################################"
	@echo "###########                  #############"
	@echo "###########       O K        #############"
	@echo "###########                  #############"
	@echo "##########################################"

finger :
	@for FILE in $(ALL_DIRS)		;\
	do echo %%%%%%%%% building $$FILE ; finger $$FILE | grep ^Login ;\
	done

# C tags source code for ViM
# ctags -e pour des tags emacs

ctags :
	@for FILE in $(shell find . -type d -a \! -iname CVS)		;\
	do ( 					 \
	   echo %%%%%%%%%% $$FILE ;              \
           cd $$FILE	;                        \
           ctags    *.c *.h ;                    \
		)				;\
	if [ $$? -ne 0 ] 			;\
	  then  exit 1  			;\
	fi					;\
	done
	find -type f -name "*.c" -o -name "*.h"  | xargs ctags -a

etags :
	@for FILE in $(shell find . -type d -a \! -iname CVS)		;\
	do ( 					 \
	   echo %%%%%%%%%% $$FILE ;              \
           cd $$FILE	;                        \
           ctags -e *.c *.h	                ;\
		)				;\
	if [ $$? -ne 0 ] 			;\
	  then  exit 1  			;\
	fi					;\
	done
	find -type f -name "*.c" -o -name "*.h"  | xargs ctags -a -e

cleantag :
	find . -iname tags | xargs rm -f dummy
	find . -iname TAGS | xargs rm -f dummy

% :
	@for FILE in $(ALL_DIRS)		;\
	do $(MAKE) -C $$FILE  $@		;\
	if [ $$? -ne 0 ] 			;\
	  then  exit 1 				;\
	fi					;\
	done


.PHONY : list_files

list_files : 
	echo $(ALL_DIRS)

