make install part 1
[melted] / src / valerie / Makefile
index 908c432..d7ff25c 100644 (file)
@@ -1,5 +1,6 @@
+include ../../config.mak
 
-AR = ar
+TARGET = libvalerie.so
 
 OBJS = valerie.o \
           valerie_notifier.o \
@@ -13,15 +14,19 @@ OBJS = valerie.o \
 
 SRCS := $(OBJS:.o=.c)
 
-CFLAGS=-Wall -g -D_FILE_OFFSET_BITS=64 -pthread
+CFLAGS=-O3 -Wall -g -D_FILE_OFFSET_BITS=64 -pthread
 
 LDFLAGS=-ldv -lpthread
 
-all: libvalerie.a
+ifeq ($(MLT_GPROF),true)
+CFLAGS+=-p
+LDFLAGS+=-p
+endif
+
+all: $(TARGET)
 
-libvalerie.a: $(OBJS)
-       $(AR) rvu $@ $(OBJS)
-       ranlib $@
+$(TARGET): $(OBJS)
+               $(CC) -shared -o $@ $(OBJS) $(LDFLAGS)
 
 depend:        $(SRCS)
                $(CC) -MM $(CFLAGS) $^ 1>.depend
@@ -30,7 +35,22 @@ dist-clean:  clean
                rm -f .depend
 
 clean: 
-               rm -f $(OBJS) libvalerie.a 
+               rm -f $(OBJS) $(TARGET)
+
+install:       all
+       install -m 755 $(TARGET) $(prefix)/lib/libvalerie.so
+       mkdir -p "$(prefix)/include/mlt/valerie"
+       install -m 644 \
+                       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 \
+            "$(prefix)/include/mlt/valerie"
 
 ifneq ($(wildcard .depend),)
 include .depend