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