#------------------------------------------------------------------------------
# Ulm's Oberon Library
# Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany
# -----------------------------------------------------------------------------
# This makefile 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 makefile 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.
# -----------------------------------------------------------------------------
# afb 1/92
#------------------------------------------------------------------------------

# the library directories must be given in the topological order of
# their modules
LibDirs := base conf fp fpbase if tasks sun unix math

#------------------------------------------------------------------------------
# the Oberon library is self-containing, so OBPATH should be "."
OBPATH :=	.
# directory of the compiler and the associated files
OBLIB :=	/usr/local/lib/oberon
# compilation flags (usually -OC -OT to suppress range and conversion checks)
OCFLAGS :=	-OC -OT -OS
# where to install the libraries (usually equivalent to OBLIB)
LIBDIR :=	$(OBLIB)

#------------------------------------------------------------------------------
define propagate-target
@for dir in $(LibDirs) ;\
do	cd $$dir; \
	echo make $@ in $$dir; \
	$(MAKE) -r $@ || break; \
	cd ..; \
done
endef
#------------------------------------------------------------------------------

.PHONY: all
all:		; $(propagate-target)

.PHONY: install
install:	; $(propagate-target)

.PHONY: clean
clean:		; $(propagate-target)

.PHONY: depend
depend:
		@for dir in $(LibDirs) ;\
		do	cd $$dir; \
			echo make depend in $$dir; \
			OBPATH=. mmo -u makefile; \
			cd ..; \
		done
