+ Added a --libdir switch to the configure and build
[melted] / src / valerie / Makefile
index 7322577..64c2fc1 100644 (file)
@@ -1,5 +1,6 @@
+include ../../config.mak
 
-TARGET = libvalerie.so
+TARGET = libvalerie$(LIBSUF)
 
 OBJS = valerie.o \
           valerie_notifier.o \
@@ -11,21 +12,25 @@ OBJS = valerie.o \
           valerie_remote.o \
           valerie_socket.o
 
-SRCS := $(OBJS:.o=.c)
+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
 
-CFLAGS=-O3 -Wall -g -D_FILE_OFFSET_BITS=64 -pthread
+SRCS := $(OBJS:.o=.c)
 
-LDFLAGS=-ldv -lpthread
-
-ifeq ($(MLT_GPROF),true)
-CFLAGS+=-p
-LDFLAGS+=-p
-endif
+CFLAGS += -I.. $(RDYNAMIC)
+LDFLAGS += -L../framework -lmlt -lpthread
 
 all: $(TARGET)
 
 $(TARGET): $(OBJS)
-               $(CC) -shared -o $@ $(OBJS) $(LDFLAGS)
+               $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
 
 depend:        $(SRCS)
                $(CC) -MM $(CFLAGS) $^ 1>.depend
@@ -36,6 +41,11 @@ dist-clean:  clean
 clean: 
                rm -f $(OBJS) $(TARGET)
 
+install:       all
+       install -m 755 $(TARGET) $(DESTDIR)$(libdir)/libvalerie$(LIBSUF)
+       mkdir -p "$(DESTDIR)$(prefix)/include/mlt/valerie"
+       install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/valerie"
+
 ifneq ($(wildcard .depend),)
 include .depend
 endif