#    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) reqclient.$(OBJ_EXT) mmutex.$(OBJ_EXT) \
	mmemfile.$(OBJ_EXT) mplugin.$(OBJ_EXT) mbitmap.$(OBJ_EXT) getoption.$(OBJ_EXT) \
	mplist.$(OBJ_EXT) mtreeint.$(OBJ_EXT) phmalloc.$(OBJ_EXT) \
	mnodelist.$(OBJ_EXT) tserv.$(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
LIBOBJS=$(COREOBJS)
GCCNM=-DMNODE_NO_META
else
ifdef POSIX
LIBOBJS=$(COREOBJS) $(NMETAOBJS) $(UNIXOBJS)
else
LIBOBJS=$(COREOBJS) $(NMETAOBJS)
endif
endif
ifndef MOHAWK_HOME
MOHAWK_HOME=..
endif

include config.mak

#
#
phoenix.$(LIB_EXT) : phoenix.$(OBJ_EXT) $(LIBOBJS)

phoenix.$(DLL_EXT) : phoenix.$(OBJ_EXT) $(LIBOBJS)

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

distclean : clean
	rm -f config.mak

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

install: $(ALL)
	cp phoenix.$(LIB_EXT) $(MOHAWK_HOME)/lib/libphoenix.$(LIB_EXT)
#	cp phoenix.$(DLL_EXT) $(MOHAWK_HOME)/lib/libphoenix.$(DLL_EXT)
	

linux :
	cp Linux.mak config.mak

freebsd : 
	cp FreeBSD.mak config.mak

osx :
	cp MacOSX.mak config.mak

windows :
	cp Windows.mak config.mak

cygwin :
	cp Cygwin.mak config.mak




