# File   : /home/cvs/cvsroot/projects/visualstate/scope/lib/makefile,v
# Comment: Unix Makefile for additional libraries needed by scope
# Release: scope-0-10
#
#    Copyright (C) 2001-2002 Andrzej Wasowski
#     
#    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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Usage:
#
#    make lib    - builds all library modules
#    make        - equivalent to make lib
#    make all    - equivalent to make lib
#
#    make clean  - cleans current directory from all temporary files (and .ui
#    	           and .uo files)
#    make mrprop - currently equivalent to make clean 
#
# makefile,v 1.5 2002/10/24 20:17:17 wasowski Exp

MOSMLHOME=/usr/mosml
MOSMLTOOLS=camlrunm $(MOSMLHOME)/tools
MOSMLLIBS=-I .
MOSMLC=mosmlc -c $(MOSMLLIBS) 
MOSMLL=mosmlc $(MOSMLLIBS)
MOSMLLEX=mosmllex
MOSMLYACC=mosmlyac


UNITS=-structure Parsercomb Fifo -toplevel ord-key-sig -toplevel ord-set-sig \
      -toplevel binary-set-fn -toplevel getopt-sig -toplevel getopt

OBJECTS=Parsercomb.uo Fifo.uo ord-key-sig.uo ord-set-sig.uo binary-set-fn.uo \
	getopt.uo getopt-sig.uo

all: $(OBJECTS)

lib: all


.SUFFIXES :
.SUFFIXES : .sml .sig .ui .uo .mlp .lex .c .o

.sig.ui:
	$(MOSMLC) $<

.sml.uo:
	$(MOSMLC) $<

.lex.sml:
	$(MOSMLLEX) $<



#dep: lexer.sml parser.sml makefile
dep: makefile
	rm -f makefile.bak
	mv makefile makefile.bak
	$(MOSMLTOOLS)/cutdeps < makefile.bak > makefile
	$(MOSMLTOOLS)/mosmldep $(UNITS) >> makefile

.PHONY: lib clean mrprop all


clean:
	make -f ../makefile doclean
	
mrprop: clean

### DO NOT DELETE THIS LINE
Parsercomb.ui: Parsercomb.sig 
	$(MOSMLC) -structure Parsercomb.sig 
Parsercomb.uo: Parsercomb.sml Parsercomb.ui 
	$(MOSMLC) -structure Parsercomb.sml 
Fifo.ui: Fifo.sig Parsercomb.ui 
	$(MOSMLC) -structure Parsercomb.ui Fifo.sig 
Fifo.uo: Fifo.sml Fifo.ui Parsercomb.ui 
	$(MOSMLC) -structure Parsercomb.ui Fifo.sml 
ord-key-sig.uo: ord-key-sig.sml Fifo.ui 
	$(MOSMLC) -toplevel Fifo.ui Parsercomb.ui \
    ord-key-sig.sml 
ord-set-sig.uo: ord-set-sig.sml ord-key-sig.uo 
	$(MOSMLC) -toplevel ord-key-sig.ui Fifo.ui \
    Parsercomb.ui ord-set-sig.sml 
binary-set-fn.uo: binary-set-fn.sml ord-set-sig.uo 
	$(MOSMLC) -toplevel ord-set-sig.ui \
    ord-key-sig.ui Fifo.ui Parsercomb.ui binary-set-fn.sml 
getopt-sig.uo: getopt-sig.sml binary-set-fn.uo 
	$(MOSMLC) -toplevel binary-set-fn.ui \
    ord-set-sig.ui ord-key-sig.ui Fifo.ui Parsercomb.ui getopt-sig.sml 
getopt.uo: getopt.sml getopt-sig.uo 
	$(MOSMLC) -toplevel getopt-sig.ui binary-set-fn.ui \
    ord-set-sig.ui ord-key-sig.ui Fifo.ui Parsercomb.ui getopt.sml 
