#
# Makefile -- [makefile of DCP]
# 
#
# This file is part of
#
# DCP -- Dynamic Configuration Protocol
#
# (C) 1996, 1997, 1998, 1999 Markus Hofmann, Christian Fuchs and Jochen Schlick
#     (hofmann@acm.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#      This product includes software developed by Markus Hofmann,
#      Christian Fuchs and other contributors.
# 4. Neither the name of the Authors nor the names of other contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# 
# (cfuchs@telematik.informatik.uni-karlsruhe.de)
# (schlick@telematik.informatik.uni-karlsruhe.de)
#
# "$Id: Makefile,v 1.4 1999/02/20 13:58:12 schlick Exp $"
###############################################################################

#................................... include system/compiler dependant Rules ..
include ../Rules.Make


###############################################################################
PRG     	= dcp
DCPRUNDIR       = ../$(RUNDIR)


#........................................................... progs / subdirs ..
PRGOBJS		= core.o	\
		  monitor.o	\
                  interface.o

INCLUDES	= core.h          \
		  interface.h     \
		  metrics.h       \
		  monitor.h       \
		  packets.h       \
		  types.h         \
		  lgmp_shm.h

#............................................ additional include-directories ..
INCLUDEDIRS	= -I.

#................................................................. libraries ..
LOADLIBS	= $(SYSTHRDLIBS) $(SYSDEPLIBS) 

#..................................................................... shell ..
SHELL		= /bin/sh

#.............................................................  preprocessor ..
CPP		= $(COMPILER)  -E




###############################################################################
all:	dcp

dcp:	cp2inc $(PRGOBJS)
	@echo "**************** make dynamic dcp ..........................."
	$(COMPILER) $(LDFLAGS) -o $@  $(PRGOBJS)  $(LOADLIBS)

install:
	@echo "**************** install dynamic dcp --> $(DCPRUNDIR) ......."
	-cp -f $(PRG) $(DCPRUNDIR)
	-cp -f dcp.rc $(DCPRUNDIR)


#..................................................
cp2inc:
	-cp -f ../lgmp_src/lgmp_shm.h .


rminc:
	-rm -f ./lgmp_shm.h


#..................................................
installclean:
	@echo "**************** clean installed $(PRG).."
	-rm -f $(DCPRUNDIR)$(PRG)
	-rm -f $(DCPRUNDIR)$(PRG)_out*
	-rm -f $(DCPRUNDIR)$(PRG).rc

osclean:  clean


mrproper: installclean osclean rminc 
	@echo "**************** mrproper $(PRG) .........."


clean:
	@echo "**************** clean $(PRG) ............."
	-rm -f *.o core *~ dcp dcp_out*


#............................................................ implicit rules ..
.c.o:   $(INCLUDES)
	$(COMPILER) $(CFLAGS) $(INCLUDEDIRS) -c $*.c



#............................................................ phony targets ..
.PHONY: dcp rminc cp2inc installclean osclean mrproper clean

########################## end of Makefile ####################################
###############################################################################
