]> git.sesse.net Git - mlt/blob - src/framework/Makefile
Initial port to Windows using MinGW.
[mlt] / src / framework / Makefile
1 include ../../config.mak
2
3 NAME = libmlt$(LIBSUF)
4 TARGET = $(NAME).$(version)
5
6 ifeq ($(targetos), Darwin)
7 NAME = libmlt$(LIBSUF)
8 TARGET = libmlt.$(version)$(LIBSUF)
9 SONAME = libmlt.$(soversion)$(LIBSUF)
10 SHFLAGS += -install_name $(libdir)/$(SONAME) -current_version $(version) -compatibility_version $(soversion)
11 else ifeq ($(targetos), MinGW)
12 NAME = libmlt$(LIBSUF)
13 TARGET = libmlt-$(soversion)$(LIBSUF)
14 libdir = $(prefix)
15 else
16 NAME = libmlt$(LIBSUF)
17 TARGET = $(NAME).$(version)
18 SONAME = $(NAME).$(soversion)
19 SHFLAGS += -Wl,-soname,$(SONAME)
20 endif
21
22 OBJS = mlt_frame.o \
23            mlt_version.o \
24            mlt_geometry.o \
25            mlt_deque.o \
26            mlt_property.o \
27            mlt_properties.o \
28            mlt_events.o \
29            mlt_parser.o \
30            mlt_service.o \
31            mlt_producer.o \
32            mlt_multitrack.o \
33            mlt_playlist.o \
34            mlt_consumer.o \
35            mlt_filter.o \
36            mlt_transition.o \
37            mlt_field.o \
38            mlt_tractor.o \
39            mlt_factory.o \
40            mlt_repository.o \
41            mlt_pool.o \
42            mlt_tokeniser.o \
43            mlt_profile.o \
44            mlt_log.o \
45            mlt_cache.o
46
47 INCS = mlt_consumer.h \
48            mlt_version.h \
49            mlt_factory.h \
50            mlt_filter.h \
51            mlt.h \
52            mlt_multitrack.h \
53            mlt_pool.h \
54            mlt_properties.h \
55            mlt_events.h \
56            mlt_parser.h \
57            mlt_repository.h \
58            mlt_tractor.h \
59            mlt_types.h \
60            mlt_deque.h \
61            mlt_field.h \
62            mlt_frame.h \
63            mlt_geometry.h \
64            mlt_playlist.h \
65            mlt_producer.h \
66            mlt_property.h \
67            mlt_service.h  \
68            mlt_transition.h \
69            mlt_tokeniser.h \
70            mlt_profile.h \
71            mlt_log.h \
72            mlt_cache.h
73
74 SRCS := $(OBJS:.o=.c)
75
76 CFLAGS += $(RDYNAMIC) -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
77
78 LDFLAGS += $(LIBDL) -lpthread
79
80 all:    $(TARGET)
81
82 $(TARGET): $(OBJS)
83                 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
84                 ln -sf $(TARGET) $(NAME)
85                 if [ "$(targetos)" != "MinGW" ]; then \
86                         ln -sf $(TARGET) $(SONAME) ; \
87                 fi
88
89 depend: $(SRCS)
90         $(CC) -MM $(CFLAGS) $^ 1>.depend
91
92 distclean:      clean
93                 rm -f .depend
94
95 clean:  
96                 rm -f $(OBJS) $(TARGET) $(NAME) $(SONAME)
97
98 install:
99         install -d $(DESTDIR)$(libdir)
100         install -m 755 $(TARGET) $(DESTDIR)$(libdir)
101         if [ "$(targetos)" != "MinGW" ]; then \
102                 ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME) ; \
103                 ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME) ; \
104         fi
105         install -d "$(DESTDIR)$(prefix)/include/mlt/framework"
106         install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/framework"
107         install -d "$(DESTDIR)$(datadir)/mlt"
108         install -m 644 metaschema.yaml "$(DESTDIR)$(datadir)/mlt/"
109
110 uninstall:
111         rm -f "$(DESTDIR)$(libdir)/$(TARGET)"
112         if [ "$(targetos)" != "MinGW" ]; then \
113                 rm -f "$(DESTDIR)$(libdir)/$(SONAME)" ; \
114                 rm -f "$(DESTDIR)$(libdir)/$(NAME)" ; \
115         fi
116         rm -rf "$(DESTDIR)$(prefix)/include/mlt/framework"
117         rm -f "$(DESTDIR)$(datadir)/mlt/metaschema.yaml"
118
119 ifneq ($(wildcard .depend),)
120 include .depend
121 endif