# =============================================================================
# 
# @(#) $Id: Makefile,v 0.7.4.2 2001/02/18 09:44:11 brian Exp $
# 
# -----------------------------------------------------------------------------
# 
# Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
# 
# All Rights Reserved.
# 
# This program 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.
# 
# This program 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
# this program; if not, write to the Free Software Foundation, Inc., 675 Mass
# Ave, Cambridge, MA 02139, USA.
# 
# -----------------------------------------------------------------------------
# 
# Last Modified $Date: 2001/02/18 09:44:11 $ by $Author: brian $
#
# =============================================================================

INCDIR ?= $(shell ( cd ../include; pwd ))
SRCDIR ?= $(shell ( cd ../drivers; pwd ))

export INCDIR
export SRCDIR

export WFLAGS ?= \
    -Wall \
    -Werror \
    -Wunused \
    -Wpointer-arith \
    -Wcast-qual \
    -Wcast-align \
    -Wstrict-prototypes \
    -Wnested-externs \
    -Winline \
    -Wold-style-cast \

SRCFILES = $(shell find . -name "*.c" -o -name "*.h")

#SUBDIRS = $(shell find . -maxdepth 1 -mindepth 1 -type d ! -name "CVS" ! -name "RCS" ! -name "include" ! -name "man" ! -name "doc")
SUBDIRS = lmi sdli sdti sli # slsi

all: # depend tags
	for subdir in ${SUBDIRS}; do $(MAKE) -C $$subdir $@; done

tags: $(SRCFILES)
	ctags $(SRCFILES)
	for subdir in ${SUBDIRS}; do $(MAKE) -C $$subdir $@; done

clean:
	for subdir in ${SUBDIRS}; do $(MAKE) -C $$subdir $@; done

install::
	@ if [ $$(id -u) -ne 0 ]; then \
	    echo -e "\nYou must be superuser to install!\n"; \
	    exit 1; \
	fi
	for subdir in ${SUBDIRS}; do $(MAKE) -C $$subdir $@; done

%:
	for subdir in ${SUBDIRS}; do $(MAKE) -C $$subdir $@; done

