# $Id: Makefile.in,v 1.6 2004/01/22 20:36:57 markus Rel $

# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

SHELL = @SHELL@

prefix = @prefix@
exec_prefix = @exec_prefix@

top_srcdir =  @top_srcdir@
top_builddir = ..
srcdir = @srcdir@

subdir=CORBA

DESTDIR=

libdir = @libdir@
includedir = @includedir@

AS = @AS@
CC = @CC@
CPP = @CPP@
CXX = @CXX@

CXXLD = $(CXX)

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RELEASE = @RELEASE@
VERSION = @VERSION@

INCLUDES =  -I. -I$(top_srcdir) -I$(top_srcdir)/Common
DEFS = @DEFS@
CXXFLAGS = @CXXFLAGS@ -Wall
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)

# CORBACOMPILE = mico-shc++
# CORBALINK = mico-shld
CORBACOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CORBALINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@

OBJECTS=CCompDir.o CICompDir.o

IDL_FILES=CCompDir.idl
DIST_HEADERS=CICompDir.h $(IDL_FILES)
HEADERS=$(DIST_HEADERS)
SOURCES=CCompDir.idl CICompDir.cpp

EXTRA_DIST=

DIST_COMMON = Makefile.in

DISTFILES = $(DIST_COMMON) $(SOURCES) $(DIST_HEADERS) $(TEXINFOS) $(EXTRA_DIST)

TESTS = TestCORBA


.SUFFIXES: .cc .cpp .lo .o .idl

.idl.cc:
	idl --boa --no-poa -I $(INCLUDES) -I /usr/include -I /usr/local/include $<

.cc.o:
	@echo '$(CXXCOMPILE) -c $<'; \
	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
	@-cp .deps/$(*F).pp .deps/$(*F).P; \
	tr ' ' '\012' < .deps/$(*F).pp \
	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
	    >> .deps/$(*F).P; \
	rm .deps/$(*F).pp

.cpp.o:
	@echo '$(CXXCOMPILE) -c $<'; \
	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
	@-cp .deps/$(*F).pp .deps/$(*F).P; \
	tr ' ' '\012' < .deps/$(*F).pp \
	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
	    >> .deps/$(*F).P; \
	rm .deps/$(*F).pp

all: Makefile $(OBJECTS)

Makefile: Makefile.in $(top_builddir)/config.status
	cd $(top_builddir) \
	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status

install:
	$(mkinstalldirs) $(DESTDIR)$(includedir)
	@list='$(IDL_FILES)'; for p in $$list; do \
	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
	done


uninstall:
	$(mkinstalldirs) $(DESTDIR)$(includedir)
	@list='$(IDL_FILES)'; for p in $$list; do \
	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
	  rm -f $(DESTDIR)$(includedir)/$$p; \
	done

clean:
	rm -f *.o *.lo core *.core;
	@list=$(IDL_FILES); \
	for i in $$list; do \
	   rm -f $${i%.*}.cc $${i%.*}.h; \
	done
	@for tests in $(TESTS); do \
	   rm -f $$tests; \
	done

distdir: $(DISTFILES)
	@for file in $(DISTFILES); do \
	  d=$(srcdir); \
	  if test -d $$d/$$file; then \
	    cp -pr $$/$$file $(distdir)/$$file; \
	  else \
	    test -f $(distdir)/$$file \
	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
	    || cp -p $$d/$$file $(distdir)/$$file || :; \
	  fi; \
	done

Testclient: Testclient.o CCompDir.o
	$(CORBALINK) CCompDir.o $<

TestCORBA: Makefile Testclient
	echo "#!/bin/sh" > $@
	echo "../Common/DirComp --CORBA |./Testclient" >> $@
	chmod +x $@

../Common/DirComp:
	@echo Programm $@ missing! Run make all in $(top_srcdir) first
	@test 1 -eq 0

check: all $(TESTS) ../Common/DirComp
	@failed=0; all=0; \
	srcdir=$(srcdir); export srcdir; \
	for tst in $(TESTS); do \
	  if test -f $$tst; then dir=.; \
	  else dir="$(srcdir)"; fi; \
	  if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
	    all=`expr $$all + 1`; \
	    echo "PASS: $$tst"; \
	  elif test $$? -ne 77; then \
	    all=`expr $$all + 1`; \
	    failed=`expr $$failed + 1`; \
	    echo "FAIL: $$tst"; \
	  fi; \
	done; \
	if test "$$failed" -eq 0; then \
	  banner="All $$all tests passed"; \
	else \
	  banner="$$failed of $$all tests failed"; \
	fi; \
	dashes=`echo "$$banner" | sed s/./=/g`; \
	echo "$$dashes"; \
	echo "$$banner"; \
	echo "$$dashes"; \
	test "$$failed" -eq 0


syntax highlighted by Code2HTML, v. 0.9.1