]> git.sesse.net Git - mlt/blobdiff - src/valerie/Makefile
Merge ../mlt++
[mlt] / src / valerie / Makefile
index 908c432f8f7a763afc5cc638340d3f419ca4e39b..52b61e15a59265272e3579254411b1a195795ad4 100644 (file)
@@ -1,5 +1,16 @@
+include ../../config.mak
 
-AR = ar
+ifneq ($(targetos), Darwin)
+NAME = libvalerie$(LIBSUF)
+TARGET = $(NAME).$(version)
+SONAME = $(NAME).$(soversion)
+SHFLAGS += -Wl,-soname,$(SONAME)
+else
+NAME = libvalerie$(LIBSUF)
+TARGET = libvalerie.$(version)$(LIBSUF)
+SONAME = libvalerie.$(soversion)$(LIBSUF)
+SHFLAGS += -install_name $(libdir)/$(SONAME) -current_version $(version) -compatibility_version $(soversion)
+endif
 
 OBJS = valerie.o \
           valerie_notifier.o \
@@ -11,26 +22,50 @@ OBJS = valerie.o \
           valerie_remote.o \
           valerie_socket.o
 
+INCS = valerie.h \
+          valerie_notifier.h \
+          valerie_parser.h \
+          valerie_remote.h \
+          valerie_response.h \
+          valerie_socket.h \
+          valerie_status.h \
+          valerie_tokeniser.h \
+          valerie_util.h
+
 SRCS := $(OBJS:.o=.c)
 
-CFLAGS=-Wall -g -D_FILE_OFFSET_BITS=64 -pthread
+CFLAGS += -I.. $(RDYNAMIC)
 
-LDFLAGS=-ldv -lpthread
+LDFLAGS += -L../framework -lmlt -lpthread
 
-all: libvalerie.a
+all: $(TARGET)
 
-libvalerie.a: $(OBJS)
-       $(AR) rvu $@ $(OBJS)
-       ranlib $@
+$(TARGET): $(OBJS)
+               $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+               ln -sf $(TARGET) $(NAME)
+               ln -sf $(TARGET) $(SONAME)
 
 depend:        $(SRCS)
                $(CC) -MM $(CFLAGS) $^ 1>.depend
 
-dist-clean:    clean
+distclean:     clean
                rm -f .depend
 
 clean: 
-               rm -f $(OBJS) libvalerie.a 
+               rm -f $(OBJS) $(TARGET) $(NAME)
+
+install:       all
+       install -m 755 $(TARGET) $(DESTDIR)$(libdir)
+       ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME)
+       ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME)
+       mkdir -p "$(DESTDIR)$(prefix)/include/mlt/valerie"
+       install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/valerie"
+
+uninstall:
+       rm -f "$(DESTDIR)$(libdir)/$(TARGET)"
+       rm -f "$(DESTDIR)$(libdir)/$(SONAME)"
+       rm -f "$(DESTDIR)$(libdir)/$(NAME)"
+       rm -rf "$(DESTDIR)$(prefix)/include/mlt/valerie"
 
 ifneq ($(wildcard .depend),)
 include .depend