#******************************************************************************
#FILE:				$(MAKEDIR)/project
#LANGUAGE:			make
#SYSTEM:			UNIX
#USER-INTERFACE:	None
#DESCRIPTION
#	This is the project level makefile.
#
#	Input variables are:
#
#       $(MAKEDIR)      where the makefiles are located.
#
#       $(PREFIX)   where the libraries are installed.
#                       It will be created a subdirectory in this
#                       $(PREFIX) for each library compiled by
#                       this makefile.
#
#       $(MODULES)      the list of the modules to compile.
#
#	Output:
#
#		$(PREFIX)/bin/$(PROGRAM)           the executables.
#		$(PREFIX)/$(MODULE)/interfaces/    the interface of the module,
#		$(PREFIX)/$(MODULE)/documentation/ the documentation of the module,
#		$(PREFIX)/$(MODULE)/libraries/     the libraries of the module.
#
#AUTHORS
#	<PJB> Pascal J. Bourguignon
#MODIFICATIONS
#	1993-03-16 <PJB> Creation.
#LEGAL
#	Copyright Pascal J. Bourguignon 1993 - 2001
#
#   This script 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 script 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 library; see the file COPYING.LIB.
#   If not, write to the Free Software Foundation,
#   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#******************************************************************************
include $(MAKEDIR)/common-targets
-include $(MAKEDIR)/target$(TARGET)

$(COMMON_TARGETS) ::
	@if [ -z "$(TARGET)" ] ; then \
		$(MAKE) $(MFLAGS) \
			TARGET=`$(MAKEDIR)/distribution|awk '{print $$1}'` \
			MAKEDIR=$(MAKEDIR) \
			PREFIX=$(PREFIX) \
			MODULE=$(MODULE) \
			$@ ;\
	else \
		for MODULE in $(MODULES) ; do \
			echo $(LINE2) ;\
			$(MAKE) $(MFLAGS) \
				-C $$MODULE \
				TARGET=$(TARGET) \
				MAKEDIR=$(MAKEDIR) \
				PREFIX=$(PREFIX) \
				MODULE=$$MODULE \
				$@ ;\
		done ;\
	fi

help::
	@echo ""
	@echo " $(MAKE) depend        Generates the Makefile.depend files."
	@echo " $(MAKE) all           Compiles and links all modules: "
	@echo $(MODULES) | fmt -40 | sed -e 's/^/                       /'
	@echo " $(MAKE) install       Installs the libraries and programs into: "
	@echo "                       $(PREFIX)/."
	@echo ""
	@echo " $(MAKE) clean         Removes backups and objects."
	@echo " $(MAKE) cleanall      Remove libraries and executables."
	@echo " $(MAKE) distclean     Prepares for a source distribution."
	@echo " $(MAKE) cvsclean      Removes everything that can be regenerated."
	@echo ""
	@echo " $(MAKE) showvars      Displays the value of the variables."
	@echo ""



clean::
cleanall::clean
	-@rm -f *~
distclean::cleanall
cvsclean::distclean

showvars::
	@echo "   MAKEDIR = $(MAKEDIR)"
	@echo "    PREFIX = $(PREFIX)"
	@echo "    TARGET = $(TARGET)"
	@echo "   MODULES = $(MODULES)"


# This is for Emacs.
# Local Variables:
# indent-tabs-mode: t
# mode: makefile
# End:

#### project                          -- 2004-01-19 01:49:02 -- pascal   ####
ViewGit