]> git.sesse.net Git - mlt/blob - src/modules/gtk2/Makefile
Avoid unnecessary compilation when running "./configure; make; make install" multiple...
[mlt] / src / modules / gtk2 / Makefile
1 CFLAGS := -I../.. $(CFLAGS)
2
3 LDFLAGS += -L../../framework -lmlt -lpthread -lm
4
5 include ../../../config.mak
6 include config.mak
7
8 TARGET = ../libmltgtk2$(LIBSUF)
9
10 OBJS = factory.o
11
12 ifdef USE_GTK2
13 OBJS += consumer_gtk2.o
14 CFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --cflags gtk+-2.0)
15 LDFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --libs gtk+-2.0)
16 endif
17
18 ifdef USE_PIXBUF
19 OBJS += producer_pixbuf.o pixops.o filter_rescale.o
20 CFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --cflags gdk-pixbuf-2.0)
21 LDFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --libs gdk-pixbuf-2.0)
22 endif
23
24 ifdef USE_EXIF
25 CFLAGS += $(EXIFCXXFLAGS) 
26 LDFLAGS += $(EXIFLIBS)
27 endif
28
29 ifdef MMX_FLAGS
30 ifndef ARCH_X86_64
31 ASM_OBJS = have_mmx.o scale_line_22_yuv_mmx.o
32 endif
33 endif
34
35 ifdef USE_PANGO
36 OBJS += producer_pango.o
37 CFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --cflags pangoft2)
38 CFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --cflags-only-I freetype2 | awk '{for (i=1; i<=NF; i++) $$i=sprintf("%s/freetype", $$i); print}')
39 LDFLAGS += $(shell pkg-config $(PKGCONFIG_PREFIX) --libs pangoft2)
40 ifeq ($(targetos),Darwin)
41 LDFLAGS += -liconv
42 endif
43 ifeq ($(targetos),FreeBSD)
44 LDFLAGS += -liconv
45 endif
46 ifeq ($(targetos), MinGW)
47 LDFLAGS += -liconv
48 endif
49 endif
50
51 SRCS := $(OBJS:.o=.c)
52
53 all:    $(TARGET)
54
55 $(TARGET): $(OBJS) $(ASM_OBJS)
56                 $(CC) $(SHFLAGS) -o $@ $(OBJS) $(ASM_OBJS) $(LDFLAGS)
57
58 have_mmx.o:
59         $(CC) -o $@ -c have_mmx.S
60
61 scale_line_22_yuv_mmx.o: scale_line_22_yuv_mmx.S
62         $(CC) -o $@ -c scale_line_22_yuv_mmx.S
63
64 depend: $(SRCS)
65                 $(CC) -MM $(CFLAGS) $^ 1>.depend
66
67 distclean:      clean
68                 rm -f .depend
69
70 clean:  
71                 rm -f $(OBJS) $(ASM_OBJS) $(TARGET)
72
73 install: all
74         install -m 755 $(TARGET) "$(DESTDIR)$(moduledir)"
75         install -d "$(DESTDIR)$(mltdatadir)/gtk2"
76         install -m 644 *.yml "$(DESTDIR)$(mltdatadir)/gtk2"
77
78 ifneq ($(wildcard .depend),)
79 include .depend
80 endif