# Enterprise Volume Management System
#
# (C) Copyright IBM Corp. 2003
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

srcdir = @srcdir@
top_srcdir = @top_srcdir@
include $(top_srcdir)/make.rules

subdirs = worker
distsubdirs = worker

NAME		= evms
TARGET		= $(LIB_TARGET)

EVMS_DEFS	+= -DPluginDirectory=\"$(evmspluginsdir)\"
EVMS_LIBS	+= $(PTHREAD_LIBS) -ldl

all: .depend $(TARGET)
	$(PROCESS_DIRS)


$(TARGET): $(OBJECTS)
	$(BUILD_SHARED_LIB)
	$(BUILD_STATIC_LIB)
	$(LN_S) -f $(TARGET) $(LIBNAME)
	$(LN_S) -f $(TARGET) $(SONAME)

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	$(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(libdir)
	$(INSTALL) -m 644 $(ARNAME) $(DESTDIR)$(libdir)
	rm -f $(DESTDIR)$(libdir)/$(LIBNAME)
	$(LN_S) $(TARGET) $(DESTDIR)$(libdir)/$(LIBNAME)
	$(PROCESS_DIRS)

uninstall:
	rm -f $(DESTDIR)$(libdir)/$(LIBNAME)
	rm -f $(DESTDIR)$(libdir)/$(ARNAME)
	rm -f $(DESTDIR)$(libdir)/$(TARGET)
	$(PROCESS_DIRS)

clean:
	rm -f .depend $(OBJECTS) $(TARGET) $(ARNAME) $(LIBNAME) $(SONAME)
	$(PROCESS_DIRS)

distclean: clean
	rm -f Makefile
	$(PROCESS_DISTDIRS)

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