]> git.sesse.net Git - mlt/blob - src/miracle/Makefile
281b78471d0b14f8105ebbaaa26d0cd8098cbd1a
[mlt] / src / miracle / Makefile
1 include ../../config.mak
2
3 TARGET = miracle
4
5 ifneq ($(targetos), Darwin)
6 LIBNAME = libmiracle$(LIBSUF)
7 LIBTARGET = $(LIBNAME).$(version)
8 SHFLAGS += -Wl,-soname,$(LIBTARGET)
9 else
10 LIBNAME = libmiracle$(LIBSUF)
11 LIBTARGET = libmiracle.$(version)$(LIBSUF)
12 SHFLAGS += -install_name $(libdir)/$(LIBTARGET)
13 endif
14
15 APP_OBJS = miracle.o
16
17 LIB_OBJS = miracle_log.o \
18            miracle_server.o \
19            miracle_connection.o \
20            miracle_local.o \
21            miracle_unit.o \
22            miracle_commands.o \
23            miracle_unit_commands.o
24
25 INCS = miracle_server.h \
26            miracle_local.h \
27            miracle_log.h
28
29 OBJS = $(APP_OBJS) $(LIB_OBJS)
30
31 CFLAGS += -I.. $(RDYNAMIC)
32
33 LDFLAGS += -L../valerie -lvalerie -L../framework -lmlt 
34
35 SRCS := $(OBJS:.o=.c)
36
37 all:            $(TARGET)
38
39 $(TARGET):      $(APP_OBJS) $(LIBTARGET)
40                         $(CC) -o $@ $(APP_OBJS) -L. -lmiracle $(LDFLAGS)
41
42 $(LIBTARGET):   $(LIB_OBJS)
43                         $(CC) $(SHFLAGS) -o $@ $(LIB_OBJS) $(LDFLAGS)
44                         ln -sf $(LIBTARGET) $(LIBNAME)
45
46 depend:         $(SRCS)
47                         $(CC) -MM $(CFLAGS) $^ 1>.depend
48
49 distclean:      clean
50                         rm -f .depend
51
52 clean:  
53                         rm -f $(OBJS) $(TARGET) $(LIBNAME) $(LIBTARGET)
54
55 install:        all
56         install -d "$(DESTDIR)$(bindir)"
57         install -c -s -m 755 $(TARGET) "$(DESTDIR)$(bindir)"
58         install -m 755 $(LIBTARGET) $(DESTDIR)$(libdir)
59         ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBNAME)
60         mkdir -p "$(DESTDIR)$(prefix)/include/mlt/miracle"
61         install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/miracle"
62
63 ifneq ($(wildcard .depend),)
64 include .depend
65 endif