added uninstall make targets
[melted] / src / framework / Makefile
index bc6fdcf..0ce2439 100644 (file)
@@ -1,6 +1,17 @@
 include ../../config.mak
 
-TARGET = libmlt$(LIBSUF)
+NAME = libmlt$(LIBSUF)
+TARGET = $(NAME).$(version)
+
+ifneq ($(targetos), Darwin)
+NAME = libmlt$(LIBSUF)
+TARGET = $(NAME).$(version)
+SHFLAGS += -Wl,-soname,$(TARGET)
+else
+NAME = libmlt$(LIBSUF)
+TARGET = libmlt.$(version)$(LIBSUF)
+SHFLAGS += -install_name $(libdir)/$(TARGET)
+endif
 
 OBJS = mlt_frame.o \
           mlt_geometry.o \
@@ -56,22 +67,29 @@ all:        $(TARGET)
 
 $(TARGET): $(OBJS)
                $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+               ln -sf $(TARGET) $(NAME)
 
 depend:        $(SRCS)
-               $(CC) -MM $(CFLAGS) $^ 1>.depend
+       $(CC) -MM $(CFLAGS) $^ 1>.depend
 
-dist-clean:    clean
+distclean:     clean
                rm -f .depend
 
 clean: 
-               rm -f $(OBJS) $(TARGET)
+               rm -f $(OBJS) $(TARGET) $(NAME)
 
 install:
        install -d $(DESTDIR)$(libdir)
-       install -m 755 $(TARGET) $(DESTDIR)$(libdir)/libmlt$(LIBSUF)
+       install -m 755 $(TARGET) $(DESTDIR)$(libdir)
+       ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME)
        install -d "$(DESTDIR)$(prefix)/include/mlt/framework"
        install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/framework"
 
+uninstall:
+       rm -f "$(DESTDIR)$(libdir)/$(TARGET)"
+       rm -f "$(DESTDIR)$(libdir)/$(NAME)"
+       rm -rf "$(DESTDIR)$(prefix)/include/mlt/framework"
+
 ifneq ($(wildcard .depend),)
 include .depend
 endif