##################################################################
#   Copyright  2004, Sebastian Heutling. All rights reserved.
#   $Id: Makefile,v 1.6 2004/09/11 15:03:24 basti Exp $
#
#   Descr. : Makefile for the console plugin
#   Authors: Sebastian Heutling, sheutlin@gmx.de
##################################################################
TOP      := ../../..
include $(TOP)/config/make.tmpl
LD       :=$(CXX)
FILES    := init RunCommandPlugin
LIBNAME  := runcommand.so
OBJECTS  := $(foreach f, $(FILES), .$(f).o)
DEPENDS  := $(foreach f, $(FILES), .$(f).d)
cleanobjects=$(OBJECTS) $(LIBNAME) $(DEPENDS)

INCLUDES := -I$(TOP)/server/include -I/usr/include/libxml++-2.6
CXXFLAGS += $(INCLUDES)
LDLIBS   :=
LDFLAGS  := $(LDLIBS) -Wl,--no-undefined

.PHONY: all depend clean

all: $(LIBNAME)

$(eval $(call link_so,$(LIBNAME),$(OBJECTS),$(LDFLAGS)))
$(eval $(call compile_source,cpp,Makefile,$(CXXFLAGS)))
$(eval $(call build_depends,cpp,Makefile,$(CXXFLAGS)))
$(eval $(call clean,,$(cleanobjects)))
$(eval $(call distclean,,$(cleanobjects)))

install:
	@$(INSTALL) -d $(DESTDIR)$(PLUGINDIR)
	@$(INSTALL_DATA) $(LIBNAME) $(DESTDIR)$(PLUGINDIR)

ifeq (,$(filter clean distclean depend install,$(MAKECMDGOALS)))
-include $(DEPENDS)
endif

