#   Makefile, Copyright 1999 (c) by G. Fankhauser, L. Ruf & C. Jeker,
#   Swiss Federal Institute of Technology,
#   Computer Engineering and Networks Laboratory.
#
#   TOPSY -- A Teachable Operating System.
#            Implementation of a tiny and simple
#            micro kernel for teaching purposes.
#
#   For further information, please visit http://www.tik.ee.ethz.ch/~topsy
#
#   This software is provided under the terms of the GNU General Public Licence.
#   A full copy of the GNU GPL is provided in the file COPYING found in the 
#   development root of Topsy.
#
#       
#       File:                  $Source: /usr/drwho/vault/cvs/topsy/Topsy/Makefile,v $
#       Author(s):             
#       Affiliation:           ETH Zuerich, TIK
#       Version:               $Revision: 1.79 $
#       Creation Date:         
#       Last Date of Change:   $Date: 2000/03/31 17:50:31 $      by: $Author: gfa $
#       
#       
#       $Log: Makefile,v $
#       Revision 1.79  2000/03/31 17:50:31  gfa
#       Merged with /Net from several term projects
#
#       Revision 1.78  1999/12/15 15:15:41  gfa
#       *** empty log message ***
#
#       Revision 1.77  1999/12/14 10:22:08  gfa
#       *** empty log message ***
#
#       Revision 1.76  1999/12/13 21:48:22  ruf
#       GNU General Public Licence Update
#
#       Revision 1.75  1999/11/30 18:11:31  ruf
#       *** empty log message ***
#
#       Revision 1.74  1999/11/30 18:11:25  ruf
#       *** empty log message ***
#
#       Revision 1.73  1999/10/31 14:42:43  jeker
#       first fixes for SimOS
#
#       Revision 1.72  1999/10/23 19:07:08  jeker
#       added Makefile.SimOS.mips and did some code cleanup
#
#       Revision 1.71  1999/09/20 13:11:19  gfa
#       *** empty log message ***
#
#       Revision 1.70  1999/06/10 13:15:41  jeker
#       cleaning up
#
#       Revision 1.69  1999/06/10 08:30:09  gfa
#       linux tweaking...
#
#       Revision 1.68  1999/06/09 19:09:55  gfa
#       clean up for unix
#
#       Revision 1.67  1999/06/09 18:53:30  gfa
#       bla
#
#       Revision 1.66  1999/06/06 20:57:08  jeker
#       putting everything together for Topsy 2.0
#
#
#

###############################################################################
FIND=find
XARGS=xargs
RM=rm
ALLARCH=mips ia32 unix

info:
	@echo "Topsy pre2.0"
	@echo "These are the possible Platforms:"
	@echo "- make mips: builds Topsy for IDT MIPS (ecoff)."
	@echo "- make solaris/linux: builds a unix application Topsy."
	@echo "- make ia32: builds a ia32/i386 port of Topsy."
	@echo "             use make ia32-disk to copy Topsy on a floppy."
	@echo
	@echo "Perhaps you need to edit the right Makefiles/Platform File."
	@echo "- make clean: cleans the entire tree."

mips:
	@echo "Starting to make IDT MIPS R3000 Topsy,"
	@echo "for more info use \"make info\""
	$(MAKE) -f Makefiles/Makefile.IDT.mips

mips-simos:
	$(MAKE) -f Makefiles/Makefile.SimOS.mips

ia32:
	$(MAKE) -f Makefiles/Makefile.ia32.i386

ia32-disk:
	$(MAKE) -f Makefiles/Makefile.ia32.i386 alldisk

solaris:
	$(MAKE) -f Makefiles/Makefile.unix.solaris

linux:
	$(MAKE) -f Makefiles/Makefile.unix.linux

net:
	$(MAKE) -f Net/Makefile.net

# use this to remove temporary files
clean:
	$(RM) -rf $(addsuffix .obj, $(ALLARCH))
	$(RM) -f kernel* \
	   user* topsy* \
	   segmap.bin segmap.srec \
	   kSize uSize segmap Boot/mips/BootLinker 
	$(FIND) . -name "*~"      -print | $(XARGS) $(RM) -f
	$(FIND) . -name ".*~"     -print | $(XARGS) $(RM) -f
	$(FIND) . -name "*.bak"   -print | $(XARGS) $(RM) -f

# this is a practical command to show some statistics on source and object size
size:
	find . -name "*.[chS]" -print | xargs -x wc -l
	make -f Makefiles/Makefile.IDT.mips size
	make -f Makefiles/Makefile.ia32.i386 size
	make -f Makefiles/Makefile.unix.linux size

update:
	cvs -q update -d -P

commit:
	cvs -q commit