#    Mohawk Software Framework by Mohawk Software
#    Copyright (C) 1998-2001 Mark L. Woodward
# 
#    This library 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 library 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 library; if not, write to the Free
#    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
#    MA 02111-1307, USA
# 
#    If you want support or to commercially license this library, the author
#    can be reached at info@mohawksoft.com


INCLUDES=Phoenix.h bmtbl.h marray.h mavl.h mfile.h mhist.h \
	mlist.h mnode.h msocket.h msort.h mthread.h mutils.h strtbl.h mtoken.h \
	mcircular.h mconfig.h msql.h mserver.h mstrops.h\
	mhash.h mwww.h memheap.h mfblkfile.h mfprst.h  mfkbd.h unixcom.h \
	mftimer.h metadef.h \
	Phoenix.mak

COREOBJS=mnode.$(OBJ_EXT) mfile.$(OBJ_EXT) mutils.$(OBJ_EXT) msocket.$(OBJ_EXT) \
	mlist.$(OBJ_EXT) mthread.$(OBJ_EXT) mtoken.$(OBJ_EXT) mserver.$(OBJ_EXT) \
	mservpool.$(OBJ_EXT) mcmp.$(OBJ_EXT) msql.$(OBJ_EXT) mconfig.$(OBJ_EXT) \
	mtknmeta.$(OBJ_EXT) mwww.$(OBJ_EXT) mfblkfile.$(OBJ_EXT) mfprst.$(OBJ_EXT) \
	mfprstfil.$(OBJ_EXT) mfkbd.$(OBJ_EXT) mfamort.$(OBJ_EXT) mftimer.$(OBJ_EXT) \
	mrwlock.$(OBJ_EXT) session.$(OBJ_EXT) msession.$(OBJ_EXT) reqclient.$(OBJ_EXT) \
	reqmsession.$(OBJ_EXT) mmutex.$(OBJ_EXT) mmemfile.$(OBJ_EXT) mplugin.$(OBJ_EXT) \
	ndxfile.$(OBJ_EXT) ndxsearch.$(OBJ_EXT) mbitmap.$(OBJ_EXT) getoption.$(OBJ_EXT) \
	mplist.$(OBJ_EXT) mtreeint.$(OBJ_EXT) mtserver.$(OBJ_EXT)


# These are UNIX only files
UNIXOBJS=mfserial.$(OBJ_EXT) unixcom.$(OBJ_EXT)

# These modules need MNode's meta data (count and meta)
# Remove them and define MNODE_NO_META and you will save
# 8 bytes per node.
NMETAOBJS=mavl.$(OBJ_EXT) mhist.$(OBJ_EXT) mhash.$(OBJ_EXT) memheap.$(OBJ_EXT)

ifdef MNODE_NO_META
OBJS=$(COREOBJS)
GCCNM=-DMNODE_NO_META
else
ifdef POSIX
OBJS=$(COREOBJS) $(NMETAOBJS) $(UNIXOBJS)
else
OBJS=$(COREOBJS) $(NMETAOBJS)
endif
endif

include config.mak

ALL=$(LIBNAM).$(LIB_EXT)

all : $(ALL)

$(LIBNAM).a : $(OBJS)
	$(LIB) $(LIBNAM).$(LIB_EXT) $(OBJS)

$(LIBNAM).so : $(OBJS)
	$(LINK_DLL) $(LINK_OUT) $(LIBNAM).$(DLL_EXT) $(OBJS)

$(LIBNAM).lib: $(OBJS)
	link -lib /out:$(LIBNAM).lib $(OBJS)

clean :
	rm -f *.$(OBJ_EXT)
	rm -f $(LIBNAM).$(LIB_EXT)
	rm -f $(LIBNAM).$(DLL_EXT)

distclean : clean
	rm -f config.mak

docs : 
	rm -f ../doc/*.html
	kdoc -n "Project Phoenix" -d ../doc *.h
