# -*- Makefile -*-
#
# MICO --- an Open Source CORBA implementation
# Copyright (c) 1997-2002 by The Mico Team
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# For more information, visit the MICO Home Page at
# http://www.mico.org/
#

include $(DIR_PREFIX)../../MakeVars

LD = $(CXX)

CXXFLAGS := -I. -I$(DIR_PREFIX)../../include $(CXXFLAGS) $(EHFLAGS)
CFLAGS   := -I. -I$(DIR_PREFIX)../../include $(CFLAGS)
LDLIBS   := $(LDMICO) $(CONFLIBS)
LDFLAGS  := -L$(DIR_PREFIX)../../libs $(LDFLAGS)
DEPS     := $(DIR_PREFIX)../../orb/$(LIBMICO)
IDLFLAGS := -B$(DIR_PREFIX)../.. -I.

AUX_CXXFLAGS =
AUX_LDLIBS   = $(LDMICOAUX)
AUX_LDFLAGS  =
AUX_DEPS     = $(DIR_PREFIX)../../auxdir/$(LIBMICOAUX)

X11_CXXFLAGS = $(X_CFLAGS)
X11_LDLIBS   = -lmicox$(VERSION) -lXaw -lXmu -lXt -lX11 -lXext $(X_LIBS)
X11_LDFLAGS  =
ifeq  ($(HAVE_SHARED), yes)
X11_DEPS     = $(DIR_PREFIX)../../auxdir/libmicox$(VERSION).$(SOEXT)
else
X11_DEPS     = $(DIR_PREFIX)../../auxdir/libmicox$(VERSION).a
endif

QT_LDLIBS   = -lmicoqt$(VERSION) $(QT_LIBS) $(X_LIBS)
QT_LDFLAGS  =
ifeq  ($(HAVE_SHARED), yes)
QT_DEPS     = $(DIR_PREFIX)../../auxdir/libmicoqt$(VERSION).$(SOEXT)
else
QT_DEPS     = $(DIR_PREFIX)../../auxdir/libmicoqt$(VERSION).a
endif

GTK_CXXFLAGS = $(GTK_CFLAGS)
GTK_LDLIBS   = -lmicogtk$(VERSION) $(GTK_LIBS)
GTK_LDFLAGS  =
ifeq  ($(HAVE_SHARED), yes)
GTK_DEPS     = $(DIR_PREFIX)../../auxdir/libmicogtk$(VERSION).$(SOEXT)
else
GTK_DEPS     = $(DIR_PREFIX)../../auxdir/libmicogtk$(VERSION).a
endif

COS_CXXFLAGS =
COS_LDLIBS   = -lmicocoss$(VERSION)
COS_LDFLAGS  =
ifeq  ($(HAVE_SHARED_EXCEPTS), yes)
COS_DEPS     = $(DIR_PREFIX)../../coss/libmicocoss$(VERSION).$(SOEXT)
else
COS_DEPS     = $(DIR_PREFIX)../../coss/libmicocoss$(VERSION).a
endif

install:
	$(IDIRCMD) $(SHARED_INSTDIR)/examples/mico/$(INSTALL_DIR)
	test -z "$(INSTALL_SRCS)" || \
	  eval 'for i in $(INSTALL_SRCS); do \
	    $(ISRCCMD) $$i $(SHARED_INSTDIR)/examples/mico/$(INSTALL_DIR); \
	  done'
	test -z "$(INSTALL_SCRIPTS)" || \
	  eval 'for i in $(INSTALL_SCRIPTS); do \
	    $(ISCRIPTCMD) $$i $(SHARED_INSTDIR)/examples/mico/$(INSTALL_DIR); \
	  done'

ifeq (.depend, $(wildcard .depend))
include .depend
endif

.depend:
	echo '# Module dependencies' > .depend
	$(MKDEPEND) $(CXXFLAGS) *.c *.cc >> .depend

