742ec91dd0b9408f8768369df634b305d3113233
[melted] / 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 LIBSONAME = $(LIBNAME).$(soversion)
9 SHFLAGS += -Wl,-soname,$(LIBSONAME)
10 else
11 LIBNAME = libmiracle$(LIBSUF)
12 LIBTARGET = libmiracle.$(version)$(LIBSUF)
13 LIBSONAME = libmiracle.$(soversion)$(LIBSUF)
14 SHFLAGS += -install_name $(libdir)/$(LIBSONAME) -current_version $(version) -compatibility_version $(soversion)
15 endif
16
17 APP_OBJS = miracle.o
18
19 LIB_OBJS = miracle_log.o \
20 miracle_server.o \
21 miracle_connection.o \
22 miracle_local.o \
23 miracle_unit.o \
24 miracle_commands.o \
25 miracle_unit_commands.o
26
27 INCS = miracle_server.h \
28 miracle_local.h \
29 miracle_log.h
30
31 OBJS = $(APP_OBJS) $(LIB_OBJS)
32
33 CFLAGS += -I.. $(RDYNAMIC)
34
35 LDFLAGS += -L../valerie -lvalerie -L../framework -lmlt -lpthread
36
37 SRCS := $(OBJS:.o=.c)
38
39 all: $(TARGET)
40
41 $(TARGET): $(APP_OBJS) $(LIBTARGET)
42 $(CC) -o $@ $(APP_OBJS) -L. -lmiracle $(LDFLAGS)
43
44 $(LIBTARGET): $(LIB_OBJS)
45 $(CC) $(SHFLAGS) -o $@ $(LIB_OBJS) $(LDFLAGS)
46 ln -sf $(LIBTARGET) $(LIBNAME)
47 ln -sf $(LIBTARGET) $(LIBSONAME)
48
49 depend: $(SRCS)
50 $(CC) -MM $(CFLAGS) $^ 1>.depend
51
52 distclean: clean
53 rm -f .depend
54
55 clean:
56 rm -f $(OBJS) $(TARGET) $(LIBNAME) $(LIBTARGET)
57
58 install: all
59 install -d "$(DESTDIR)$(bindir)"
60 install -c -s -m 755 $(TARGET) "$(DESTDIR)$(bindir)"
61 install -m 755 $(LIBTARGET) $(DESTDIR)$(libdir)
62 ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBSONAME)
63 ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBNAME)
64 mkdir -p "$(DESTDIR)$(prefix)/include/mlt/miracle"
65 install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/miracle"
66
67 uninstall:
68 rm -f "$(DESTDIR)$(bindir)/$(TARGET)"
69 rm -f "$(DESTDIR)$(libdir)/$(LIBTARGET)"
70 rm -f "$(DESTDIR)$(libdir)/$(LIBSONAME)"
71 rm -f "$(DESTDIR)$(libdir)/$(LIBNAME)"
72 rm -rf "$(DESTDIR)$(prefix)/include/mlt/miracle"
73
74 ifneq ($(wildcard .depend),)
75 include .depend
76 endif