srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
top_builddir = ../..
my_dir = lib/evms
INSTALL = @INSTALL@

MAJOR_VERSION	= 1
MINOR_VERSION	= 2
PATCH_LEVEL	= 1
EXTRAVERSION	=

XTRA_CFLAGS= -I@srcdir@ -DMAJOR_VERSION=$(MAJOR_VERSION) -DMINOR_VERSION=$(MINOR_VERSION) -DPATCH_LEVEL=$(PATCH_LEVEL) -DEVMS_ABI_CODE=@EVMS_ABI_CODE@

@MCONFIG@

OBJS= fs_ext2.o fsimext2.o

SRCS= $(srcdir)/fs_ext2.c $(srcdir)/fsimext2.c


LIBRARY= libext2fsim
LIBDIR= evms

ELF_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
ELF_SO_VERSION = $(MAJOR_VERSION)
ELF_IMAGE = libe2fsim
ELF_MYDIR = evms
ELF_INSTALL_DIR = $(root_libdir)/evms
#ELF_OTHER_LIBS = -L../.. -lcom_err

ELF_LIB = $(ELF_IMAGE).$(ELF_VERSION).so
ELF_SONAME = $(ELF_IMAGE).$(ELF_SO_VERSION).so

all:: $(ELF_LIB)

$(ELF_LIB): $(OBJS)
	$(CC) --shared -o $(ELF_LIB) -Wl,-soname,$(ELF_SONAME) \
		$(OBJS) $(ELF_OTHER_LIBS)

installdirs:: 
	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) 

install:: $(ELF_LIB) installdirs
	$(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)
	$(STRIP) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB)

uninstall-shlibs uninstall::
	$(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) 

clean::
	$(RM) -f $(ELF_LIB)
	$(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)

.c.o:
	$(CC) $(ALL_CFLAGS) -fPIC -c $< -o $@

clean::
	$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* 

mostlyclean:: clean
distclean:: clean
	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old

# +++ Dependency line eater +++
# 
# Makefile dependencies follow.  This must be the last section in
# the Makefile.in file
#
fs_ext2.o: $(srcdir)/fs_ext2.c $(srcdir)/plugin.h $(srcdir)/dlist.h \
 $(srcdir)/common.h $(srcdir)/options.h $(srcdir)/enginestructs.h \
 $(srcdir)/plugfuncs.h $(srcdir)/fsimext2.h
fsimext2.o: $(srcdir)/fsimext2.c $(srcdir)/plugin.h $(srcdir)/dlist.h \
 $(srcdir)/common.h $(srcdir)/options.h $(srcdir)/enginestructs.h \
 $(srcdir)/plugfuncs.h $(srcdir)/fsimext2.h
