#
# Makefile
# Copyright (C) 1996, Onno Hovers
#
# This software is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
# 
# This software 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
# Library General Public License for more details.
# 
# You should have received a copy of the GNU Library General Public
# License along with this software; see the file COPYING.LIB. If
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.  
#
 
TOPSRC=.
include Make.global

DEPDIRS   = kernel nls
CLEANDIRS = dll kernel tools nls
ALLDIRS   = doc dll tools kernel nls 

all:    wfc

wfc:	_dll_ _kernel_ _nls_
	$(CC) $(CFLAGS) -o wfc dll/dll.o kernel/kernel.o nls/nls.o
	
_tools_:
	cd tools; $(MAKE) all

_dll_:	_tools_
	cd dll; $(MAKE) all

_kernel_:
	cd kernel; $(MAKE) all

_nls_:
	cd nls; $(MAKE) all

dist:	
	cp wfc $(TOPSRC)/dist/bin/wfc		
	cd doc; $(MAKE) dist	

clean:
	for i in $(CLEANDIRS); do (cd $$i; $(MAKE) clean); done
	$(RM) *.o *.bak *~ *.orig *.rej *.flc
	$(RM) wfc

depend dep:
	for i in $(DEPDIRS); do (cd $$i; $(MAKE) depend); done

